[php-pecl-memcache] PHP 5.4.0 Build

Remi Collet remi at fedoraproject.org
Fri Jan 20 17:55:26 UTC 2012


commit c49ce34b4f87f1b0b13d5460e486b2d67b636dba
Author: remi <fedora at famillecollet.com>
Date:   Fri Jan 20 18:54:57 2012 +0100

    PHP 5.4.0 Build

 memcache-php54.patch   |   51 +++++++++++++++++++++++++++++++++++
 php-pecl-memcache.spec |   69 +++++++++++++++++++++++++++--------------------
 2 files changed, 91 insertions(+), 29 deletions(-)
---
diff --git a/memcache-php54.patch b/memcache-php54.patch
new file mode 100644
index 0000000..be9f200
--- /dev/null
+++ b/memcache-php54.patch
@@ -0,0 +1,51 @@
+diff -up memcache-3.0.6/memcache.c.orig memcache-3.0.6/memcache.c
+--- memcache-3.0.6/memcache.c.orig	2011-11-13 10:54:04.230073555 +0100
++++ memcache-3.0.6/memcache.c	2011-11-13 10:55:41.867315825 +0100
+@@ -718,7 +718,11 @@ mmc_t *mmc_find_persistent(const char *h
+ 			mmc_server_free(mmc TSRMLS_CC);
+ 			mmc = NULL;
+ 		} else {
++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
++			zend_list_insert(mmc, le_memcache_server TSRMLS_CC);
++#else
+ 			zend_list_insert(mmc, le_memcache_server);
++#endif
+ 		}
+ 	}
+ 	else if (le->type != le_memcache_server || le->ptr == NULL) {
+@@ -735,7 +739,11 @@ mmc_t *mmc_find_persistent(const char *h
+ 			mmc = NULL;
+ 		}
+ 		else {
++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
++			zend_list_insert(mmc, le_memcache_server TSRMLS_CC);
++#else
+ 			zend_list_insert(mmc, le_memcache_server);
++#endif
+ 		}
+ 	}
+ 	else {
+@@ -775,7 +783,11 @@ static mmc_t *php_mmc_pool_addserver(
+ 	if (zend_hash_find(Z_OBJPROP_P(mmc_object), "connection", sizeof("connection"), (void **)&connection) == FAILURE) {
+ 		pool = mmc_pool_new(TSRMLS_C);
+ 		pool->failure_callback = &php_mmc_failure_callback;
++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
++		list_id = zend_list_insert(pool, le_memcache_pool TSRMLS_CC);
++#else
+ 		list_id = zend_list_insert(pool, le_memcache_pool);
++#endif
+ 		add_property_resource(mmc_object, "connection", list_id);
+ 	}
+ 	else {
+@@ -836,7 +848,11 @@ static void php_mmc_connect(INTERNAL_FUN
+ 		int list_id;
+ 		mmc_pool_t *pool = mmc_pool_new(TSRMLS_C);
+ 		pool->failure_callback = &php_mmc_failure_callback;
++#if (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION > 3) || (PHP_MAJOR_VERSION > 5)
++		list_id = zend_list_insert(pool, le_memcache_pool TSRMLS_CC);
++#else
+ 		list_id = zend_list_insert(pool, le_memcache_pool);
++#endif
+ 		mmc_object = return_value;
+ 		object_init_ex(mmc_object, memcache_ce);
+ 		add_property_resource(mmc_object, "connection", list_id);
diff --git a/php-pecl-memcache.spec b/php-pecl-memcache.spec
index a46c387..02e01b7 100644
--- a/php-pecl-memcache.spec
+++ b/php-pecl-memcache.spec
@@ -7,7 +7,7 @@
 Summary:      Extension to work with the Memcached caching daemon
 Name:         php-pecl-memcache
 Version:      3.0.6
-Release:      2%{?dist}
+Release:      3%{?dist}
 License:      PHP
 Group:        Development/Languages
 URL:          http://pecl.php.net/package/%{pecl_name}
@@ -15,6 +15,9 @@ URL:          http://pecl.php.net/package/%{pecl_name}
 Source:       http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
 Source2:      xml2changelog
 
+# https://bugs.php.net/60284
+Patch0:       memcache-php54.patch
+
 BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires: php-devel >= 4.3.11, php-pear, zlib-devel
 
@@ -32,11 +35,13 @@ Requires:     php(api) = %{php_core_api}
 Requires:     php-api = %{php_apiver}
 %endif
 
-
-%{?filter_setup:
-%filter_provides_in %{php_extdir}/.*\.so$
-%filter_setup
-}
+# RPM 4.8
+%{?filter_provides_in: %filter_provides_in %{php_extdir}/.*\.so$}
+%{?filter_provides_in: %filter_provides_in %{php_ztsextdir}/.*\.so$}
+%{?filter_setup}
+# RPM 4.9
+%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{php_extdir}/.*\\.so$
+%global __provides_exclude_from %__provides_exclude_from|%{php_ztsextdir}/.*\\.so$
 
 
 %description
@@ -52,27 +57,12 @@ Memcache can be used as a PHP session handler.
 
 %prep 
 %setup -c -q
-%{_bindir}/php -n %{SOURCE2} package.xml | tee CHANGELOG | head -n 5
-
-# avoid spurious-executable-perm
-find . -type f -exec chmod -x {} \;
-
-
-%build
-cd %{pecl_name}-%{version}
-phpize
-%configure
-%{__make} %{?_smp_mflags}
 
+%patch0 -p0 -b .php54
 
-%install
-cd %{pecl_name}-%{version}
-%{__rm} -rf %{buildroot}
-%{__make} install INSTALL_ROOT=%{buildroot}
+%{_bindir}/php -n %{SOURCE2} package.xml | tee CHANGELOG | head -n 5
 
-# Drop in the bit of configuration
-%{__mkdir_p} %{buildroot}%{_sysconfdir}/php.d
-%{__cat} > %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini << 'EOF'
+cat >%{pecl_name}.ini << 'EOF'
 ; ----- Enable %{pecl_name} extension module
 extension=%{pecl_name}.so
 
@@ -109,23 +99,40 @@ extension=%{pecl_name}.so
 ;session.save_path="tcp://localhost:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
 EOF
 
+# avoid spurious-executable-perm
+find . -type f -exec chmod -x {} \;
+
+
+%build
+cd %{pecl_name}-%{version}
+phpize
+%configure
+make %{?_smp_mflags}
+
+
+%install
+rm -rf %{buildroot}
+make -C %{pecl_name}-%{version} \
+     install INSTALL_ROOT=%{buildroot}
+
+# Drop in the bit of configuration
+install -D -m 644 %{pecl_name}.ini %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini
+
 # Install XML package description
-# use 'name' rather than 'pecl_name' to avoid conflict with pear extensions
-%{__mkdir_p} %{buildroot}%{pecl_xmldir}
-%{__install} -m 644 ../package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
+install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
 
 
 %check
 cd %{pecl_name}-%{version}
 # simple module load test
 %{_bindir}/php --no-php-ini \
-    --define extension_dir=modules \
+    --define extension_dir=%{buildroot}%{php_extdir} \
     --define extension=%{pecl_name}.so \
     --modules | grep %{pecl_name}
 
 
 %clean
-%{__rm} -rf %{buildroot}
+rm -rf %{buildroot}
 
 
 %if 0%{?pecl_install:1}
@@ -152,6 +159,10 @@ fi
 
 
 %changelog
+* Thu Jan 19 2012 Remi Collet <remi at fedoraproject.org> - 3.0.6-3
+- rebuild against PHP 5.4, with patch
+- fix filters
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.0.6-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 


More information about the scm-commits mailing list