1
1
# Fedora spec file for php-pecl-memcached
2
2
#
3
- # Copyright (c) 2009-2016 Remi Collet
3
+ # Copyright (c) 2009-2017 Remi Collet
4
4
# License: CC-BY-SA
5
5
# http://creativecommons.org/licenses/by-sa/4.0/
6
6
#
7
7
# Please, preserve the changelog entries
8
8
#
9
9
10
- %global with_zts 0%{? __ztsphp:1}
11
- %global with_tests 0%{? _with_tests :1 }
10
+ %global with_zts 0%{! ?_without_zts:%{? __ztsphp:1} }
11
+ %global with_tests 0%{!? _without_tests :1 }
12
12
%global pecl_name memcached
13
13
# After 40-igbinary, 40-json, 40-msgpack
14
14
%global ini_name 50-%{pecl_name }.ini
15
- # https://github.com/php-memcached-dev/php-memcached/commits/php7
16
- %global gh_commit 6ace07da69a5ebc021e56a9d2f52cdc8897b4f23
17
- %global gh_short %(c= %{gh_commit }; echo ${c:0:7})
18
- %global gh_date 20160217
19
- %global gh_owner php-memcached-dev
20
- %global gh_project php-memcached
21
15
22
16
Summary: Extension to work with the Memcached caching daemon
23
17
Name: php-pecl-memcached
24
- Version: 3.0.0
25
- %if 0%{?gh_date:1 }
26
- Release: 0.2.%{gh_date }git%{gh_short }%{?dist }
27
- Source0: https://github.com/%{gh_owner }/%{gh_project }/archive/%{gh_commit }/%{gh_project }-%{version }%{?prever }-%{gh_short }.tar.gz
28
- %else
29
- Release: 2%{?dist }
30
- Source0: http://pecl.php.net/get/%{pecl_name }-%{version }.tgz
31
- %endif
18
+ Version: 3.0.1
19
+ Release: 1%{?dist }
32
20
License: PHP
33
21
Group: Development/Languages
34
22
URL: http://pecl.php.net/package/%{pecl_name }
35
23
24
+ Source0: http://pecl.php.net/get/%{pecl_name }-%{version }.tgz
25
+
26
+ # https://github.com/php-memcached-dev/php-memcached/pull/319
27
+ Patch0: %{pecl_name }-pr319.patch
36
28
37
29
BuildRequires: php-devel >= 7
38
30
BuildRequires: php-pear
@@ -42,7 +34,7 @@ BuildRequires: php-pecl-igbinary-devel
42
34
BuildRequires: php-pecl-msgpack-devel
43
35
%endif
44
36
BuildRequires: libevent-devel > 2
45
- BuildRequires: libmemcached-devel > 1
37
+ BuildRequires: libmemcached-devel > 1.0.16
46
38
BuildRequires: zlib-devel
47
39
BuildRequires: cyrus-sasl-devel
48
40
BuildRequires: fastlz-devel
@@ -77,20 +69,7 @@ It also provides a session handler (memcached).
77
69
78
70
%prep
79
71
%setup -c -q
80
-
81
- %if 0%{?gh_date:1 }
82
- mv %{gh_project }-%{gh_commit } NTS
83
- sed -e '/PHP_MEMCACHED_VERSION/s/3.0.0b1/%{version }-dev/' -i NTS/php_memcached.h
84
- %{__php} -r '
85
- $pkg = simplexml_load_file("NTS/package.xml");
86
- $pkg-> date = substr("%{gh_date }",0,4)."-".substr("%{gh_date }",4,2)."-".substr("%{gh_date }",6,2);
87
- $pkg-> version-> release = "%{version }dev";
88
- $pkg-> stability-> release = "devel";
89
- $pkg-> asXML("package.xml");
90
- '
91
- %else
92
72
mv %{pecl_name }-%{version }%{?prever } NTS
93
- %endif
94
73
95
74
# Don't install/register tests
96
75
sed -e 's/role= "test"/role= "src"/' \
@@ -100,13 +79,17 @@ sed -e 's/role="test"/role="src"/' \
100
79
101
80
rm -r NTS/fastlz
102
81
82
+ cd NTS
83
+ %patch0 -p1 -b .pr319
84
+
103
85
# Chech version as upstream often forget to update this
104
- extver= $(sed -n '/#define PHP_MEMCACHED_VERSION/{s/.* "//;s/".*$//;p}' NTS/ php_memcached.h)
86
+ extver= $(sed -n '/#define PHP_MEMCACHED_VERSION/{s/.* "//;s/".*$//;p}' php_memcached.h)
105
87
if test "x${extver}" != "x%{version }%{?gh_date:-dev}%{?intver }"; then
106
88
: Error: Upstream HTTP version is now ${extver}, expecting %{version }.
107
89
: Update the pdover macro and rebuild.
108
90
exit 1
109
91
fi
92
+ cd ..
110
93
111
94
cat > %{ini_name } << 'EOF'
112
95
; Enable %{pecl_name } extension module
@@ -182,7 +165,7 @@ make install -C ZTS INSTALL_ROOT=%{buildroot}
182
165
install -D -m 644 %{ini_name } %{buildroot }%{php_ztsinidir }/%{ini_name }
183
166
%endif
184
167
185
- # Test & Documentation
168
+ # Documentation
186
169
cd NTS
187
170
for i in $(grep 'role= "doc"' ../package.xml | sed -e 's/^.*name= "//;s/".*$//')
188
171
do install -Dpm 644 $i %{buildroot }%{pecl_docdir }/%{pecl_name }/$i
@@ -208,10 +191,15 @@ OPT="-n"
208
191
%endif
209
192
210
193
%if %{with_tests }
194
+ # XFAIL and very slow so no value
195
+ rm ?TS/tests/expire.phpt
196
+
211
197
ret= 0
212
198
213
199
: Launch the Memcached service
214
- memcached -p 11211 -U 11211 -d -P $PWD/memcached.pid
200
+ port= $(%{__php} -r 'echo 10000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE;')
201
+ memcached -p $port -U $port -d -P $PWD/memcached.pid
202
+ sed -e "s/11211/$port/" -i ?TS/tests/*
215
203
216
204
: Run the upstream test Suite for NTS extension
217
205
pushd NTS
@@ -220,7 +208,7 @@ TEST_PHP_EXECUTABLE=%{__php} \
220
208
TEST_PHP_ARGS= "$OPT -d extension= $PWD/modules/%{pecl_name }.so" \
221
209
NO_INTERACTION= 1 \
222
210
REPORT_EXIT_STATUS= 1 \
223
- %{__php} -n run-tests.php || ret= 1
211
+ %{__php} -n run-tests.php --show-diff || ret= 1
224
212
popd
225
213
226
214
%if %{with_zts }
@@ -231,7 +219,7 @@ TEST_PHP_EXECUTABLE=%{__ztsphp} \
231
219
TEST_PHP_ARGS= "$OPT -d extension= $PWD/modules/%{pecl_name }.so" \
232
220
NO_INTERACTION= 1 \
233
221
REPORT_EXIT_STATUS= 1 \
234
- %{__ztsphp} -n run-tests.php || ret= 1
222
+ %{__ztsphp} -n run-tests.php --show-diff || ret= 1
235
223
popd
236
224
%endif
237
225
@@ -259,6 +247,13 @@ exit $ret
259
247
260
248
261
249
%changelog
250
+ *
Thu Feb 9 2017 Remi Collet <[email protected] > -
3.0.1-1
251
+ - update to 3.0.1 (php 7, stable)
252
+ - switch to pecl sources
253
+ - enable test suite
254
+ - open https://github.com/php-memcached-dev/php-memcached/pull/319
255
+ fix test suite for 32bits build
256
+
262
257
*
Mon Nov 14 2016 Remi Collet <[email protected] > -
3.0.0-0.2.20160217git6ace07d
263
258
- rebuild for https://fedoraproject.org/wiki/Changes/php71
264
259
0 commit comments