diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | memcached-build.patch | 46 | ||||
-rw-r--r-- | memcached-incl.patch | 12 | ||||
-rw-r--r-- | memcached-zts.patch | 21 | ||||
-rw-r--r-- | php-pecl-memcached.spec | 89 |
5 files changed, 95 insertions, 75 deletions
@@ -1,4 +1,4 @@ SRCDIR := $(shell pwd) NAME := $(shell basename $(SRCDIR)) -include ../common/Makefile +include ../../../common/Makefile diff --git a/memcached-build.patch b/memcached-build.patch new file mode 100644 index 0000000..3b30972 --- /dev/null +++ b/memcached-build.patch @@ -0,0 +1,46 @@ +From a66b1286b06ec0c8b11790d772725a2a7bb33d57 Mon Sep 17 00:00:00 2001 +From: Remi Collet <fedora@famillecollet.com> +Date: Sat, 18 Aug 2012 18:57:39 +0200 +Subject: [PATCH] fix build with libmemcached < 1.0.10 + +--- + config.m4 | 2 ++ + php_memcached.c | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/config.m4 b/config.m4 +index 045758a..a346d4c 100644 +--- a/config.m4 ++++ b/config.m4 +@@ -250,6 +250,8 @@ if test "$PHP_MEMCACHED" != "no"; then + + PHP_MEMCACHED_FILES="php_memcached.c fastlz/fastlz.c g_fmt.c" + ++ AC_CHECK_LIB(memcached, memcached_server_major_version, AC_DEFINE(HAVE_MEMCACHED_SERVER_VERSION, 1, [Whether libmemcached have memcached_server_xxx_version functions])) ++ + if test "$PHP_MEMCACHED_SESSION" != "no"; then + PHP_MEMCACHED_FILES="${PHP_MEMCACHED_FILES} php_memcached_session.c" + fi +diff --git a/php_memcached.c b/php_memcached.c +index 90ea8ab..3f3882a 100644 +--- a/php_memcached.c ++++ b/php_memcached.c +@@ -2643,9 +2643,15 @@ static memcached_return php_memc_do_version_callback(const memcached_st *ptr, me + + hostport_len = spprintf(&hostport, 0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance)); + version_len = snprintf(version, sizeof(version), "%d.%d.%d", ++#ifdef HAVE_MEMCACHED_SERVER_VERSION + memcached_server_major_version(instance), + memcached_server_minor_version(instance), + memcached_server_micro_version(instance)); ++#else ++ instance->major_version, ++ instance->minor_version, ++ instance->micro_version); ++#endif + + add_assoc_stringl_ex(context->return_value, hostport, hostport_len+1, version, version_len, 1); + efree(hostport); +-- +1.7.10 + diff --git a/memcached-incl.patch b/memcached-incl.patch deleted file mode 100644 index f4eaa55..0000000 --- a/memcached-incl.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index d8e72da..0000000 --- a/memcached-zts.patch +++ /dev/null @@ -1,21 +0,0 @@ -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 index 71f645a..cf7bc29 100644 --- a/php-pecl-memcached.spec +++ b/php-pecl-memcached.spec @@ -1,51 +1,52 @@ -%{!?phpname: %{expand: %%global phpname php}} -%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} +%{!?__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 +Name: php-pecl-memcached +Version: 2.1.0 +Release: 2%{?dist} # memcached is PHP, FastLZ is MIT License: PHP and MIT Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} +Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz + +# https://github.com/php-memcached-dev/php-memcached/issues/25 +# https://github.com/remicollet/php-memcached/commit/a66b1286b06ec0c8b11790d772725a2a7bb33d57.patch +Patch0: %{pecl_name}-build.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +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: php-devel >= 5.2.10 +BuildRequires: php-pear +BuildRequires: php-pecl-igbinary-devel +BuildRequires: libmemcached-devel >= 1.0.0 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} +Requires: php-common%{?_isa} >= 5.2.10 +Requires: php-pecl-igbinary%{?_isa} +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} -Provides: %{phpname}-pecl(%{pecl_name}) = %{version}-%{release} -Provides: %{phpname}-pecl(%{pecl_name})%{?_isa} = %{version}-%{release} +Provides: php-pecl(%{pecl_name}) = %{version}-%{release} +Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}-%{release} +# Other third party repo stuff +Obsoletes: php53-pecl-memcached +Obsoletes: php53u-pecl-memcached +%if "%{php_version}" > "5.4" +Obsoletes: php54-pecl-memcached +%endif -# RPM 4.8 +# Filter private shared %{?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 @@ -62,11 +63,6 @@ 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 @@ -89,6 +85,10 @@ extension=%{pecl_name}.so ;session.save_path="localhost:11211" EOF +cd %{pecl_name}-%{version} +%patch0 -p1 -b .build +cd .. + cp -r %{pecl_name}-%{version} %{pecl_name}-%{version}-zts @@ -111,20 +111,18 @@ 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} +# Install the NTS extension +make install -C %{pecl_name}-%{version} 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} +# Install the ZTS extension +make install -C %{pecl_name}-%{version}-zts INSTALL_ROOT=%{buildroot} +install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini %post @@ -162,17 +160,26 @@ ln -s %{php_ztsextdir}/igbinary.so modules/ %files -%defattr(-, root, root, -) +%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 +%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini +%{php_ztsextdir}/%{pecl_name}.so + %changelog +* 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 |