diff options
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | memcached-incl.patch | 12 | ||||
-rw-r--r-- | memcached-zts.patch | 21 | ||||
-rw-r--r-- | php-pecl-memcached.spec | 257 |
4 files changed, 294 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..1e65467 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../common/Makefile + diff --git a/memcached-incl.patch b/memcached-incl.patch new file mode 100644 index 0000000..f4eaa55 --- /dev/null +++ b/memcached-incl.patch @@ -0,0 +1,12 @@ +diff -up memcached-1.0.2/config.m4.orig memcached-1.0.2/config.m4 +--- memcached-1.0.2/config.m4.orig 2011-09-17 17:23:48.000000000 +0200 ++++ memcached-1.0.2/config.m4 2011-09-17 17:24:52.000000000 +0200 +@@ -94,7 +94,7 @@ if test "$PHP_MEMCACHED" != "no"; then + igbinary_inc_path="$abs_srcdir/include/php" + elif test -f "$abs_srcdir/ext/igbinary/igbinary.h"; then + igbinary_inc_path="$abs_srcdir" +- elif test -f "$phpincludedir/ext/session/igbinary.h"; then ++ elif test -f "$phpincludedir/ext/igbinary/igbinary.h"; then + igbinary_inc_path="$phpincludedir" + else + for i in php php4 php5 php6; do diff --git a/memcached-zts.patch b/memcached-zts.patch new file mode 100644 index 0000000..d8e72da --- /dev/null +++ b/memcached-zts.patch @@ -0,0 +1,21 @@ +diff -up memcached-1.0.2-zts/php_memcached.c.orig memcached-1.0.2-zts/php_memcached.c +--- memcached-1.0.2-zts/php_memcached.c.orig 2011-10-04 17:40:03.702545377 +0200 ++++ memcached-1.0.2-zts/php_memcached.c 2011-10-04 17:40:21.264586400 +0200 +@@ -2022,7 +2022,7 @@ static char *php_memc_zval_to_payload(zv + switch (serializer) { + #if HAVE_MEMCACHED_IGBINARY + case SERIALIZER_IGBINARY: +- igbinary_serialize((uint8_t **) &buf.c, &buf.len, value); ++ igbinary_serialize((uint8_t **) &buf.c, &buf.len, value TSRMLS_CC); + MEMC_VAL_SET_TYPE(*flags, MEMC_VAL_IS_IGBINARY); + break; + #endif +@@ -2177,7 +2177,7 @@ static int php_memc_zval_from_payload(zv + + case MEMC_VAL_IS_IGBINARY: + #if HAVE_MEMCACHED_IGBINARY +- if (igbinary_unserialize((uint8_t *)payload, payload_len, &value)) { ++ if (igbinary_unserialize((uint8_t *)payload, payload_len, &value TSRMLS_CC)) { + ZVAL_FALSE(value); + + if (flags & MEMC_VAL_COMPRESSED) { diff --git a/php-pecl-memcached.spec b/php-pecl-memcached.spec new file mode 100644 index 0000000..71f645a --- /dev/null +++ b/php-pecl-memcached.spec @@ -0,0 +1,257 @@ +%{!?phpname: %{expand: %%global phpname php}} +%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} + +%global pecl_name memcached +#global gitver 1736623 + +Summary: Extension to work with the Memcached caching daemon +Name: %{phpname}-pecl-memcached +Version: 2.0.1 +%if 0%{?gitver:1} +Release: 0.1.git%{gitver}%{?dist} +Source: php-memcached-dev-php-memcached-v2.0.0b2-14-g%{gitver}.tar.gz +%else +Release: 6%{?dist} +Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz +%endif +# memcached is PHP, FastLZ is MIT +License: PHP and MIT +Group: Development/Languages +URL: http://pecl.php.net/package/%{pecl_name} + + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +# 5.2.10 required to HAVE_JSON enabled +BuildRequires: %{phpname}-devel >= 5.2.10 +BuildRequires: %{phpname}-pear +BuildRequires: %{phpname}-pecl-igbinary-devel +BuildRequires: libmemcached-devel +BuildRequires: zlib-devel +BuildRequires: cyrus-sasl-devel + +Requires(post): %{__pecl} +Requires(postun): %{__pecl} + +Requires: %{phpname}-common%{?_isa} >= 5.2.10 +Requires: %{phpname}-pecl-igbinary%{?_isa} +Requires: %{phpname}(zend-abi) = %{php_zend_api} +Requires: %{phpname}(api) = %{php_core_api} + +Provides: %{phpname}-pecl(%{pecl_name}) = %{version}-%{release} +Provides: %{phpname}-pecl(%{pecl_name})%{?_isa} = %{version}-%{release} + + +# RPM 4.8 +%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} +%{?filter_setup} +# RPM 4.9 +%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{_libdir}/.*\\.so$ + + +%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). + + +%prep +%setup -c -q + +%if 0%{?gitver:1} +mv php-memcached-dev-php-memcached-%{gitver}/package.xml . +mv php-memcached-dev-php-memcached-%{gitver} %{pecl_name}-%{version} +%endif + +# Chech version as upstream often forget to update this +extver=$(sed -n '/#define PHP_MEMCACHED_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}/php_memcached.h) +if test "x${extver}" != "x%{version}"; then + : Error: Upstream HTTP version is now ${extver}, expecting %{version}. + : Update the pdover macro and rebuild. + exit 1 +fi + +cp %{pecl_name}-%{version}/fastlz/LICENSE LICENSE-FastLZ + +cat > %{pecl_name}.ini << 'EOF' +; Enable %{pecl_name} extension module +extension=%{pecl_name}.so + +; ----- Options to use the memcached session handler + +; 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" +EOF + +cp -r %{pecl_name}-%{version} %{pecl_name}-%{version}-zts + + +%build +cd %{pecl_name}-%{version} +%{_bindir}/phpize +%configure --enable-memcached-igbinary \ + --enable-memcached-json \ + --enable-memcached-sasl \ + --with-php-config=%{_bindir}/php-config +make %{?_smp_mflags} + +cd ../%{pecl_name}-%{version}-zts +%{_bindir}/zts-phpize +%configure --enable-memcached-igbinary \ + --enable-memcached-json \ + --enable-memcached-sasl \ + --with-php-config=%{_bindir}/zts-php-config +make %{?_smp_mflags} + + +%install +rm -rf %{buildroot} +make install -C %{pecl_name}-%{version} INSTALL_ROOT=%{buildroot} +make install -C %{pecl_name}-%{version}-zts INSTALL_ROOT=%{buildroot} + +# Drop in the bit of configuration +install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini +install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini + +# Install XML package description +install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml + + +%clean +rm -rf %{buildroot} + + +%post +%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : + + +%postun +if [ $1 -eq 0 ] ; then + %{pecl_uninstall} %{pecl_name} >/dev/null || : +fi + + +%check +cd %{pecl_name}-%{version} +# only check if build extension can be loaded +ln -s %{php_extdir}/json.so modules/ +ln -s %{php_extdir}/igbinary.so modules/ +%{__php} -n -q \ + -d extension_dir=modules \ + -d extension=json.so \ + -d extension=igbinary.so \ + -d extension=%{pecl_name}.so \ + --modules | grep %{pecl_name} + +cd ../%{pecl_name}-%{version}-zts +# only check if build extension can be loaded +ln -s %{php_ztsextdir}/json.so modules/ +ln -s %{php_ztsextdir}/igbinary.so modules/ +%{__ztsphp} -n -q \ + -d extension_dir=modules \ + -d extension=json.so \ + -d extension=igbinary.so \ + -d extension=%{pecl_name}.so \ + --modules | grep %{pecl_name} + + +%files +%defattr(-, root, root, -) +%doc %{pecl_name}-%{version}/{CREDITS,LICENSE,README.markdown,ChangeLog} +%doc LICENSE-FastLZ +%config(noreplace) %{php_inidir}/%{pecl_name}.ini +%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini +%{php_extdir}/%{pecl_name}.so +%{php_ztsextdir}/%{pecl_name}.so +%{pecl_xmldir}/%{name}.xml + + +%changelog +* 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 + +* Sun Apr 29 2009 Remi Collet <fedora@famillecollet.com> - 0.1.5-1 +- Initial RPM + |