1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
|
# remirepo spec file for php-pecl-memcached
# With SCL compatibility, from:
#
# Fedora spec file for php-pecl-memcached
#
# Copyright (c) 2009-2015 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
%if 0%{?scl:1}
%if "%{scl}" == "rh-php56"
%global sub_prefix more-php56-
%else
%global sub_prefix %{scl_prefix}
%endif
%endif
%{?scl: %scl_package php-pecl-memcached}
%{!?scl: %global _root_prefix %{_prefix}}
%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d}
%{!?__pecl: %global __pecl %{_bindir}/pecl}
%{!?__php: %global __php %{_bindir}/php}
%global with_fastlz 1
%global with_igbin 0
%global with_zts 0%{?__ztsphp:1}
%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
%global pecl_name memcached
%global gh_commit 4187e2277fa7469b0b8a67045083dde1950cecc0
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_date 20150423
#global gh_owner php-memcached-dev
# Temporarily use Rasmus fork
%global gh_owner rlerdorf
%global gh_project php-memcached
#global prever RC1
#global intver rc1
%if "%{php_version}" < "5.6"
# After igbinary, json, msgpack
%global ini_name z-%{pecl_name}.ini
%else
# After 40-igbinary, 40-json, 40-msgpack
%global ini_name 50-%{pecl_name}.ini
%endif
Summary: Extension to work with the Memcached caching daemon
Name: %{?sub_prefix}php-pecl-memcached
Version: 2.2.0
Release: 7.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/%{pecl_name}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}.tar.gz
# https://github.com/rlerdorf/php-memcached/pull/2
Patch0: %{pecl_name}-pr2.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# 5.2.10 required to HAVE_JSON enabled
BuildRequires: %{?scl_prefix}php-devel >= 5.2.10
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-json
%if %{with_igbin}
BuildRequires: %{?sub_prefix}php-pecl-igbinary-devel
%endif
%ifnarch ppc64
BuildRequires: %{?sub_prefix}php-pecl-msgpack-devel
%endif
BuildRequires: zlib-devel
BuildRequires: cyrus-sasl-devel
%if %{with_fastlz}
BuildRequires: fastlz-devel
%endif
%if %{with_tests}
BuildRequires: memcached
%endif
%if 0%{?scl:1} && 0%{?fedora} < 15 && 0%{?rhel} < 7 && "%{?scl_vendor}" != "remi"
# Filter in the SCL collection
%{?filter_requires_in: %filter_requires_in %{_libdir}/.*\.so}
# libvent from SCL as not available in system
BuildRequires: %{?sub_prefix}libevent-devel > 2
Requires: %{?sub_prefix}libevent%{_isa} > 2
BuildRequires: %{?sub_prefix}libmemcached-devel > 1
Requires: %{?sub_prefix}libmemcached-libs%{_isa} > 1
%else
BuildRequires: libevent-devel >= 2.0.2
%if 0%{?rhel} == 5
BuildRequires: libmemcached-devel > 1
%else
# To ensure use of libmemcached-last for --enable-memcached-protocol
BuildRequires: libmemcached-devel >= 1.0.16
%endif
%endif
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-json%{?_isa}
%if %{with_igbin}
Requires: %{?sub_prefix}php-pecl-igbinary%{?_isa}
%endif
%ifnarch ppc64
Requires: %{?sub_prefix}php-pecl-msgpack%{?_isa}
%endif
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1}
# Other third party repo stuff
Obsoletes: php53-pecl-%{pecl_name} <= %{version}
Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
Obsoletes: php54-pecl-%{pecl_name} <= %{version}
Obsoletes: php54w-pecl-%{pecl_name} <= %{version}
%if "%{php_version}" > "5.5"
Obsoletes: php55u-pecl-%{pecl_name} <= %{version}
Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "5.6"
Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
%endif
%if "%{php_version}" > "7.0"
Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
%endif
%endif
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
# Filter private shared
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
%{?filter_setup}
%endif
%description
This extension uses libmemcached library to provide API for communicating
with memcached servers.
memcached is a high-performance, distributed memory object caching system,
generic in nature, but intended for use in speeding up dynamic web
applications by alleviating database load.
It also provides a session handler (memcached).
Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl})}.
%prep
%setup -c -q
mv %{gh_project}-%{gh_commit} NTS
mv NTS/package.xml .
# Don't install/register tests
sed -e 's/role="test"/role="src"/' -i package.xml
cd NTS
%patch0 -p1 -b .fastlz
%if %{with_fastlz}
rm -r fastlz
sed -e '/name=.fastlz/d' -i ../package.xml
%endif
# Check version as upstream often forget to update this
extver=$(sed -n '/#define PHP_MEMCACHED_VERSION/{s/.* "//;s/".*$//;p}' php_memcached.h)
if test "x${extver}" != "x%{version}%{?intver}"; then
: Error: Upstream HTTP version is now ${extver}, expecting %{version}%{?prever}.
: Update the pdover macro and rebuild.
exit 1
fi
cd ..
cat > %{ini_name} << 'EOF'
; Enable %{pecl_name} extension module
extension=%{pecl_name}.so
; ----- Options to use the memcached session handler
; RPM note : save_handler and save_path are defined
; for mod_php, in /etc/httpd/conf.d/php.conf
; for php-fpm, in %{_sysconfdir}/php-fpm.d/*conf
; Use memcache as a session handler
;session.save_handler=memcached
; Defines a comma separated list of server urls to use for session storage
;session.save_path="localhost:11211"
; ----- Configuration options
; http://php.net/manual/en/memcached.configuration.php
EOF
# default options with description from upstream
cat NTS/memcached.ini >>%{ini_name}
%if %{with_zts}
cp -r NTS ZTS
%endif
%build
# only needed for SCL
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig
peclconf() {
%configure \
%if %{with_igbin}
--enable-memcached-igbinary \
%endif
--enable-memcached-json \
--enable-memcached-sasl \
%ifnarch ppc64
--enable-memcached-msgpack \
%endif
%if 1
--disable-memcached-protocol \
%else
--enable-memcached-protocol \
%endif
%if %{with_fastlz}
--with-system-fastlz \
%endif
--with-php-config=$1
}
cd NTS
%{_bindir}/phpize
peclconf %{_bindir}/php-config
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
%{_bindir}/zts-phpize
peclconf %{_bindir}/zts-php-config
make %{?_smp_mflags}
%endif
%install
# Install the NTS extension
make install -C NTS INSTALL_ROOT=%{buildroot}
# Drop in the bit of configuration
# rename to z-memcached to be load after msgpack
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
# Install XML package description
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# Install the ZTS extension
%if %{with_zts}
make install -C ZTS INSTALL_ROOT=%{buildroot}
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
cd NTS
for i in $(grep "role='doc'" ../package.xml | sed -e "s/^.*name='//;s/'.*$//")
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
%clean
rm -rf %{buildroot}
# when pear installed alone, after us
%triggerin -- %{?scl_prefix}php-pear
if [ -x %{__pecl} ] ; then
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
fi
# posttrans as pear can be installed after us
%posttrans
if [ -x %{__pecl} ] ; then
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
fi
%postun
if [ $1 -eq 0 -a -x %{__pecl} ] ; then
%{pecl_uninstall} %{pecl_name} >/dev/null || :
fi
%check
OPT="-n"
[ -f %{php_extdir}/igbinary.so ] && OPT="$OPT -d extension=igbinary.so"
[ -f %{php_extdir}/json.so ] && OPT="$OPT -d extension=json.so"
[ -f %{php_extdir}/msgpack.so ] && OPT="$OPT -d extension=msgpack.so"
: Minimal load test for NTS extension
%{__php} $OPT \
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
%if %{with_zts}
: Minimal load test for ZTS extension
%{__ztsphp} $OPT \
-d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep %{pecl_name}
%endif
%if %{with_tests}
ret=0
: Launch the Memcached service
memcached -p 11211 -U 11211 -d -P $PWD/memcached.pid
: Run the upstream test Suite for NTS extension
pushd NTS
rm tests/flush_buffers.phpt tests/touch_binary.phpt
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php || ret=1
popd
%if %{with_zts}
: Run the upstream test Suite for ZTS extension
pushd ZTS
rm tests/flush_buffers.phpt tests/touch_binary.phpt
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php || ret=1
popd
%endif
# Cleanup
if [ -f memcached.pid ]; then
kill $(cat memcached.pid)
fi
exit $ret
%endif
%files
%defattr(-,root,root,-)
%{?_licensedir:%license NTS/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
%{php_extdir}/%{pecl_name}.so
%if %{with_zts}
%config(noreplace) %{php_ztsinidir}/%{ini_name}
%{php_ztsextdir}/%{pecl_name}.so
%endif
%changelog
* Sat Jun 27 2015 Remi Collet <rcollet@redhat.com> - 2.2.0-7.20150423git4187e22
- switch sources from pecl to github
- temporarily use rlerdorf fork (php7 compatibility)
- disable igbinary
- open https://github.com/rlerdorf/php-memcached/pull/2 - msgpack
* Tue Jun 23 2015 Remi Collet <rcollet@redhat.com> - 2.2.0-6
- allow build against rh-php56 (as more-php56)
- don't install/register tests
- drop runtime dependency on pear, new scriptlets
* Wed Dec 24 2014 Remi Collet <remi@fedoraproject.org> - 2.2.0-5.1
- Fedora 21 SCL mass rebuild
* Fri Aug 29 2014 Remi Collet <rcollet@redhat.com> - 2.2.0-5
- test build with system fastlz
* Fri Aug 29 2014 Remi Collet <rcollet@redhat.com> - 2.2.0-4
- improve SCL build
* Wed Apr 9 2014 Remi Collet <remi@fedoraproject.org> - 2.2.0-3
- add numerical prefix to extension configuration file
* Wed Apr 2 2014 Remi Collet <remi@fedoraproject.org> - 2.2.0-2
- add all ini options in configuration file (comments)
* Wed Apr 2 2014 Remi Collet <remi@fedoraproject.org> - 2.2.0-1
- update to 2.2.0 (stable)
- msgpack not available for ppc64
* Wed Mar 19 2014 Remi Collet <rcollet@redhat.com> - 2.2.0-0.3.RC1
- allow SCL build
* Thu Mar 13 2014 Remi Collet <remi@fedoraproject.org> - 2.2.0-0.2.RC1
- update to 2.2.0RC1 (beta)
* Mon Nov 25 2013 Remi Collet <remi@fedoraproject.org> - 2.2.0-0.1.b1
- update to 2.2.0b1 (beta)
- cleanups for Copr
- install doc in pecl doc_dir
- install tests in pecl test_dir (in devel)
- add dependency on pecl/msgpack
- add --with tests option to run upstream test suite during build
* Fri Nov 15 2013 Remi Collet <remi@fedoraproject.org> - 2.1.0-7
- drop requires libmemcached >= build version
as this can also be libmemcached-last
* Mon Nov 19 2012 Remi Collet <remi@fedoraproject.org> - 2.1.0-6
- requires libmemcached >= build version
* Sat Nov 17 2012 Remi Collet <remi@fedoraproject.org> - 2.1.0-5
- rebuild for libmemcached 1.0.14 (with SASL)
- switch to upstream patch
- add patch to report about SASL support in phpinfo
* Fri Oct 19 2012 Remi Collet <remi@fedoraproject.org> - 2.1.0-4
- improve comment in configuration about session.
* Sat Sep 22 2012 Remi Collet <remi@fedoraproject.org> - 2.1.0-3
- rebuild for new libmemcached
- drop sasl support
* Sat Sep 8 2012 Remi Collet <remi@fedoraproject.org> - 2.1.0-2
- sync with rawhide, cleanups
- Obsoletes php53*, php54* on EL
* Tue Aug 07 2012 Remi Collet <remi@fedoraproject.org> - 2.1.0-1
- update to 2.1.0
- add patch to lower libmemcached required version
* Sun Apr 22 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-6
- rebuild for libmemcached 1.0.6 (with SASL) and php 5.4
* Sun Apr 22 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-5
- rebuild for libmemcached 1.0.6 (with SASL) and php 5.3
* Sat Apr 21 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-4
- rebuild for libmemcached 1.0.6 and php 5.4
* Sat Apr 21 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-3
- rebuild for libmemcached 1.0.6 and php 5.3
* Sat Mar 03 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-2
- update to 2.0.1 for PHP 5.4
* Sat Mar 03 2012 Remi Collet <remi@fedoraproject.org> - 2.0.1-1
- update to 2.0.1 for PHP 5.3
* Sat Mar 03 2012 Remi Collet <remi@fedoraproject.org> - 2.0.0-2
- update to 2.0.0 for PHP 5.4
* Sat Mar 03 2012 Remi Collet <remi@fedoraproject.org> - 2.0.0-1
- update to 2.0.0 for PHP 5.3
* Wed Nov 16 2011 Remi Collet <remi@fedoraproject.org> - 2.0.0-0.1.1736623
- update to git snapshot (post 2.0.0b2) for php 5.4 build
* Sun Oct 16 2011 Remi Collet <remi@fedoraproject.org> - 1.0.2-10
- rebuild against latest libmemcached (f16 only)
* Tue Oct 04 2011 Remi Collet <remi@fedoraproject.org> - 1.0.2-9
- ZTS extension
* Sat Sep 17 2011 Remi Collet <remi@fedoraproject.org> - 1.0.2-8
- allow relocation
- work for ZTS (not yet ok)
* Sat Sep 17 2011 Remi Collet <remi@fedoraproject.org> - 1.0.2-7
- rebuild against libmemcached 0.52
- adapted filter
- clean spec
* Thu Jun 02 2011 Remi Collet <Fedora@FamilleCollet.com> - 1.0.2-6
- rebuild against libmemcached 0.49
* Sat Feb 19 2011 Remi Collet <fedora@famillecollet.com> - 1.0.2-3.2
- rebuild for remi repo with SASL for fedora <= 10 and EL <= 5
* Sat Oct 02 2010 Remi Collet <fedora@famillecollet.com> - 1.0.2-3.1
- remove patch
* Fri Oct 01 2010 Remi Collet <fedora@famillecollet.com> - 1.0.2-3
- rebuild against libmemcached 0.44 with SASL support
* Wed Sep 29 2010 Remi Collet <fedora@famillecollet.com> - 1.0.2-2
- rebuild with igbinary support
* Tue May 04 2010 Remi Collet <fedora@famillecollet.com> - 1.0.2-1
- update to 1.0.2 for libmemcached 0.40
* Sat Mar 13 2010 Remi Collet <fedora@famillecollet.com> - 1.0.1-1
- update to 1.0.1 for libmemcached 0.38
* Sun Feb 07 2010 Remi Collet <fedora@famillecollet.com> - 1.0.0-3.1
- bump release
* Sat Feb 06 2010 Remi Collet <fedora@famillecollet.com> - 1.0.0-3
- rebuilt against new libmemcached
- add minimal %%check
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sun Jul 12 2009 Remi Collet <fedora@famillecollet.com> - 1.0.0-1
- Update to 1.0.0 (First stable release)
* Sat Jun 27 2009 Remi Collet <fedora@famillecollet.com> - 0.2.0-1
- Update to 0.2.0 + Patch for HAVE_JSON constant
* Wed Apr 29 2009 Remi Collet <fedora@famillecollet.com> - 0.1.5-1
- Initial RPM
|