[packages/php-xcache] do not load xcache extension twice

glen glen at pld-linux.org
Wed Aug 22 11:01:06 CEST 2012


commit 9d1b1092897f67a49e35d15f6bab38a76c303f82
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Aug 22 12:00:05 2012 +0300

    do not load xcache extension twice
    
    in fact, it was even declared three times in ini file to be loaded
    and as result PHP engine crashed (Memory Fault errors)
    
    Probably bug in PHP core allowing to load same extension more than once.

 ini.patch       | 17 +++++++++++++++++
 php-xcache.spec | 11 ++++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)
---
diff --git a/php-xcache.spec b/php-xcache.spec
index 6b13ebb..bc73aa5 100644
--- a/php-xcache.spec
+++ b/php-xcache.spec
@@ -3,7 +3,7 @@ Summary:	%{modname} - PHP opcode cacher
 Summary(pl.UTF-8):	%{modname} - buforowanie opcodów PHP
 Name:		php-%{modname}
 Version:	2.0.1
-Release:	2
+Release:	3
 License:	BSD
 Group:		Development/Languages/PHP
 URL:		http://xcache.lighttpd.net/
@@ -11,7 +11,8 @@ Source0:	http://xcache.lighttpd.net/pub/Releases/%{version}/xcache-%{version}.ta
 # Source0-md5:	d3bc9645dc1b084c1eb45cfc4d8e9ccc
 Source1:	%{modname}-apache.conf
 Source2:	%{modname}-lighttpd.conf
-BuildRequires:	php-devel >= 3:5.1
+Patch0:		ini.patch
+BuildRequires:	php-devel >= 4:5.2.17-8
 BuildRequires:	rpmbuild(macros) >= 1.344
 BuildRequires:	sed >= 4.0
 %{?requires_zend_extension}
@@ -46,9 +47,9 @@ More information you can find at %{url}.
 
 %prep
 %setup -q -n %{modname}-%{version}
-%{__sed} -i -e '
-	s,zend_extension =.*,zend_extension = %{php_extensiondir}/xcache.so,
-	s,zend_extension_ts = .*,zend_extension_ts = %{php_extensiondir}/xcache.so,
+%patch0 -p1
+%{__sed} -i.bak -e '
+	s, at extensiondir@,%{php_extensiondir},
 ' xcache.ini
 
 %build
diff --git a/ini.patch b/ini.patch
new file mode 100644
index 0000000..6120653
--- /dev/null
+++ b/ini.patch
@@ -0,0 +1,17 @@
+--- xcache-2.0.1/xcache.ini.bak	2012-06-26 13:11:30.000000000 +0300
++++ xcache-2.0.1/xcache.ini	2012-08-22 11:47:44.403556474 +0300
+@@ -5,11 +5,11 @@
+ 
+ ;; non-windows example
+ ;; update xxx accordingly
+-zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
++;zend_extension = /usr/local/lib/php/extensions/non-debug-non-zts-xxx/xcache.so
+ ;; windows example:
+-zend_extension_ts = c:/php/extensions/php_xcache.dll
++;zend_extension_ts = c:/php/extensions/php_xcache.dll
+ ;; for newer PHP, _ts is removed, use the following line instead
+-zend_extension = c:/php/extensions/php_xcache.dll
++zend_extension = @extensiondir@/xcache.so
+ 
+ [xcache.admin]
+ xcache.admin.enable_auth = On


More information about the pld-cvs-commit mailing list