From 0170039520406d74b98ed1b20d4faeaf4f43ef58 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 17 Nov 2012 10:16:20 +0100 Subject: php-pecl-memcached: rebuild for libmemcached 1.0.14 with SASL support --- memcached-build.patch | 34 +++++++++++----------------------- memcached-info.patch | 16 ++++++++++++++++ php-pecl-memcached.spec | 19 +++++++++++++++---- 3 files changed, 42 insertions(+), 27 deletions(-) create mode 100644 memcached-info.patch diff --git a/memcached-build.patch b/memcached-build.patch index 3b30972..1581e08 100644 --- a/memcached-build.patch +++ b/memcached-build.patch @@ -1,39 +1,27 @@ -From a66b1286b06ec0c8b11790d772725a2a7bb33d57 Mon Sep 17 00:00:00 2001 -From: Remi Collet -Date: Sat, 18 Aug 2012 18:57:39 +0200 -Subject: [PATCH] fix build with libmemcached < 1.0.10 +From 74542111f175fe2ec41c8bf722fc2cd3dac93eea Mon Sep 17 00:00:00 2001 +From: Andrei Zmievski +Date: Sun, 30 Sep 2012 11:09:01 -0700 +Subject: [PATCH] Fix version access for libmemcached older than 1.0.8. --- - config.m4 | 2 ++ - php_memcached.c | 6 ++++++ - 2 files changed, 8 insertions(+) + php_memcached.c | 7 +++++++ + 1 file changed, 7 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 +index 90ea8ab..7e6041a 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 +@@ -2642,10 +2642,17 @@ static memcached_return php_memc_do_version_callback(const memcached_st *ptr, me + struct callbackContext* context = (struct callbackContext*) in_context; hostport_len = spprintf(&hostport, 0, "%s:%d", memcached_server_name(instance), memcached_server_port(instance)); ++#if defined(LIBMEMCACHED_VERSION_HEX) && LIBMEMCACHED_VERSION_HEX >= 0x01000008 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 ++ version_len = snprintf(version, sizeof(version), "%d.%d.%d", + instance->major_version, + instance->minor_version, + instance->micro_version); diff --git a/memcached-info.patch b/memcached-info.patch new file mode 100644 index 0000000..c5c494f --- /dev/null +++ b/memcached-info.patch @@ -0,0 +1,16 @@ +diff -up memcached-2.1.0/php_memcached.c.info memcached-2.1.0/php_memcached.c +--- memcached-2.1.0/php_memcached.c.info 2012-11-17 09:52:02.576769778 +0100 ++++ memcached-2.1.0/php_memcached.c 2012-11-17 09:54:23.335280240 +0100 +@@ -3877,6 +3877,12 @@ PHP_MINFO_FUNCTION(memcached) + php_info_print_table_row(2, "Version", PHP_MEMCACHED_VERSION); + php_info_print_table_row(2, "libmemcached version", memcached_lib_version()); + ++#if HAVE_MEMCACHED_SASL ++ php_info_print_table_row(2, "SASL support", "yes"); ++#else ++ php_info_print_table_row(2, "SASL support", "no"); ++#endif ++ + #ifdef HAVE_MEMCACHED_SESSION + php_info_print_table_row(2, "Session support", "yes"); + #else diff --git a/php-pecl-memcached.spec b/php-pecl-memcached.spec index a83abc3..4d2e4c2 100644 --- a/php-pecl-memcached.spec +++ b/php-pecl-memcached.spec @@ -5,7 +5,7 @@ Summary: Extension to work with the Memcached caching daemon Name: php-pecl-memcached Version: 2.1.0 -Release: 4%{?dist} +Release: 5%{?dist} # memcached is PHP, FastLZ is MIT License: PHP and MIT Group: Development/Languages @@ -14,8 +14,10 @@ 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 +# https://github.com/php-memcached-dev/php-memcached/commit/74542111f175fe2ec41c8bf722fc2cd3dac93eea.patch Patch0: %{pecl_name}-build.patch +# https://github.com/php-memcached-dev/php-memcached/pull/43 +Patch1: %{pecl_name}-info.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # 5.2.10 required to HAVE_JSON enabled @@ -24,7 +26,7 @@ BuildRequires: php-pear BuildRequires: php-pecl-igbinary-devel BuildRequires: libmemcached-devel >= 1.0.0 BuildRequires: zlib-devel -# BuildRequires: cyrus-sasl-devel +BuildRequires: cyrus-sasl-devel Requires(post): %{__pecl} Requires(postun): %{__pecl} @@ -34,6 +36,8 @@ Requires: php-pecl-igbinary%{?_isa} Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} +Provides: php-%{pecl_name} = %{version} +Provides: php-%{pecl_name}%{?_isa} = %{version} Provides: php-pecl(%{pecl_name}) = %{version} Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} @@ -91,17 +95,18 @@ EOF cd %{pecl_name}-%{version} %patch0 -p1 -b .build +%patch1 -p1 -b .info cd .. cp -r %{pecl_name}-%{version} %{pecl_name}-%{version}-zts %build -# no --enable-memcached-sasl, droped from libmemcached 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} @@ -109,6 +114,7 @@ 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} @@ -175,6 +181,11 @@ ln -s %{php_ztsextdir}/igbinary.so modules/ %changelog +* Sat Nov 17 2012 Remi Collet - 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 - 2.1.0-4 - improve comment in configuration about session. -- cgit