summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--apc-svn.patch104
-rw-r--r--php-pecl-apc.spec64
3 files changed, 143 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index 1e65467..13af741 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
SRCDIR := $(shell pwd)
NAME := $(shell basename $(SRCDIR))
-include ../common/Makefile
+include ../../../common/Makefile
diff --git a/apc-svn.patch b/apc-svn.patch
new file mode 100644
index 0000000..3cb72ba
--- /dev/null
+++ b/apc-svn.patch
@@ -0,0 +1,104 @@
+Revision: http://svn.php.net/viewvc?view=revision&revision=325482
+- Fix bug #59829 APC should not try to canonicalize file URLs
+
+Revision: http://svn.php.net/viewvc?view=revision&revision=325483
+- Fix bug #61799 Typo in 'SEARCH' regex of apc.php
+
+Revision: http://svn.php.net/viewvc?view=revision&revision=325875
+- Fixed possible memory leak in apc_inc() and apc_dec()
+
+Revision: http://svn.php.net/viewvc?view=revision&revision=325977
+- Fix bug 62230 apc_copy_internal_strings does not copy terminating \0 of class entry
+
+Revision: http://svn.php.net/viewvc?view=revision&revision=326089
+- Make sure interned strings are null-terminated (cschneid)
+
+--- pecl/apc/trunk/apc_cache.c 2012/04/30 21:13:32 325481
++++ pecl/apc/trunk/apc_cache.c 2012/05/01 00:09:36 325482
+@@ -944,7 +944,7 @@
+
+ len = strlen(filename);
+ if(APCG(fpstat)==0) {
+- if(IS_ABSOLUTE_PATH(filename,len)) {
++ if(IS_ABSOLUTE_PATH(filename,len) || strstr(filename, "://")) {
+ key->data.fpfile.fullpath = filename;
+ key->data.fpfile.fullpath_len = len;
+ key->h = string_nhash_8(key->data.fpfile.fullpath, key->data.fpfile.fullpath_len);
+--- pecl/apc/trunk/apc.php 2012/05/01 00:09:36 325482
++++ pecl/apc/trunk/apc.php 2012/05/01 00:34:04 325483
+@@ -91,7 +91,7 @@
+ 'SORT1' => '/^[AHSMCDTZ]$/', // first sort key
+ 'SORT2' => '/^[DA]$/', // second sort key
+ 'AGGR' => '/^\d+$/', // aggregation by dir level
+- 'SEARCH' => '~^[a-zA-Z0-1/_.-]*$~' // aggregation by dir level
++ 'SEARCH' => '~^[a-zA-Z0-9/_.-]*$~' // aggregation by dir level
+ );
+
+ // default cache mode
+--- pecl/apc/trunk/php_apc.c 2012/05/27 16:15:36 325874
++++ pecl/apc/trunk/php_apc.c 2012/05/27 17:15:26 325875
+@@ -724,6 +724,10 @@
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) {
+ return;
+ }
++
++ if (success) {
++ zval_dtor(success);
++ }
+
+ if(_apc_update(strkey, strkey_len, inc_updater, &args TSRMLS_CC)) {
+ if(success) ZVAL_TRUE(success);
+@@ -747,6 +751,10 @@
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lz", &strkey, &strkey_len, &(args.step), &success) == FAILURE) {
+ return;
+ }
++
++ if (success) {
++ zval_dtor(success);
++ }
+
+ args.step = args.step * -1;
+
+--- pecl/apc/trunk/apc_string.c 2012/06/05 04:25:50 325976
++++ pecl/apc/trunk/apc_string.c 2012/06/05 05:34:21 325977
+@@ -154,7 +154,7 @@
+ }
+
+ if (ce->name) {
+- ce->name = apc_new_interned_string(ce->name, ce->name_length TSRMLS_CC);
++ ce->name = apc_new_interned_string(ce->name, ce->name_length+1 TSRMLS_CC);
+ }
+
+ q = ce->properties_info.pListHead;
+@@ -166,7 +166,7 @@
+ }
+
+ if (info->name) {
+- info->name = apc_new_interned_string(info->name, info->name_length TSRMLS_CC);
++ info->name = apc_new_interned_string(info->name, info->name_length+1 TSRMLS_CC);
+ }
+
+ q = q->pListNext;
+--- pecl/apc/trunk/apc_string.c 2012/06/05 05:34:21 325977
++++ pecl/apc/trunk/apc_string.c 2012/06/11 04:29:57 326089
+@@ -91,17 +91,18 @@
+ p = p->pNext;
+ }
+
+- if (APCSG(interned_strings_top) + ZEND_MM_ALIGNED_SIZE(sizeof(Bucket) + nKeyLength) >=
++ if (APCSG(interned_strings_top) + ZEND_MM_ALIGNED_SIZE(sizeof(Bucket) + nKeyLength + 1) >=
+ APCSG(interned_strings_end)) {
+ /* no memory */
+ return NULL;
+ }
+
+ p = (Bucket *) APCSG(interned_strings_top);
+- APCSG(interned_strings_top) += ZEND_MM_ALIGNED_SIZE(sizeof(Bucket) + nKeyLength);
++ APCSG(interned_strings_top) += ZEND_MM_ALIGNED_SIZE(sizeof(Bucket) + nKeyLength + 1);
+
+ p->arKey = (char*)(p+1);
+ memcpy(p->arKey, arKey, nKeyLength);
++ ((char *)p->arKey)[nKeyLength] = '\0';
+ p->nKeyLength = nKeyLength;
+ p->h = h;
+ p->pData = &p->pDataPtr;
diff --git a/php-pecl-apc.spec b/php-pecl-apc.spec
index bc93907..c27f50e 100644
--- a/php-pecl-apc.spec
+++ b/php-pecl-apc.spec
@@ -1,32 +1,27 @@
-%{!?phpname: %{expand: %%global phpname php}}
-%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
+%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
%global pecl_name APC
-#global svnver 324329
Summary: APC caches and optimizes PHP intermediate code
-Name: %{phpname}-pecl-apc
+Name: php-pecl-apc
Version: 3.1.10
+Release: 2%{?dist}.2
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/APC
-%if 0%{?svnver}
-# svn co -r 324329 https://svn.php.net/repository/pecl/apc/trunk apc-svn324329
-# tar czf apc-svn324329.tgz apc-svn324329
-Source: apc-svn%{svnver}.tgz
-Release: 8.svn%{svnver}%{?dist}
-%else
-Release: 2%{?dist}
Source: http://pecl.php.net/get/APC-%{version}.tgz
-%endif
+# Upstream patch from SVN.
+Patch0: apc-svn.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
-Conflicts: %{phpname}-mmcache %{phpname}-eaccelerator
-BuildRequires: %{phpname}-devel >= 5.1.0, httpd-devel, %{phpname}-pear, pcre-devel
-Requires: %{phpname}(zend-abi) = %{php_zend_api}
-Requires: %{phpname}(api) = %{php_core_api}
-Provides: %{phpname}-pecl(%{pecl_name}) = %{version}
+Conflicts: php-mmcache php-eaccelerator
+BuildRequires: php-devel >= 5.1.0, httpd-devel, php-pear, pcre-devel
+Requires(post): %{__pecl}
+Requires(postun): %{__pecl}
+Requires: php(zend-abi) = %{php_zend_api}
+Requires: php(api) = %{php_core_api}
+Provides: php-pecl(%{pecl_name}) = %{version}
Requires(post): %{__pecl}
Requires(postun): %{__pecl}
@@ -46,8 +41,8 @@ intermediate code.
%package devel
Summary: APC developer files (header)
Group: Development/Libraries
-Requires: %{phpname}-pecl-apc%{?_isa} = %{version}-%{release}
-Requires: %{phpname}-devel%{?_isa}
+Requires: php-pecl-apc%{?_isa} = %{version}-%{release}
+Requires: php-devel%{?_isa}
%description devel
These are the files needed to compile programs using APC serializer.
@@ -56,22 +51,24 @@ These are the files needed to compile programs using APC serializer.
%prep
%setup -q -c
-%if 0%{?svnver}
-mv apc-svn%{svnver}/package.xml .
-mv apc-svn%{svnver} APC-%{version}
-%endif
+cd APC-%{version}
+%patch0 -p3 -b .orig
# https://bugs.php.net/61696
-sed -i -e 's/"3.1.9"/"%{version}"/' APC-%{version}/php_apc.h
+sed -i -e 's/"3.1.9"/"%{version}"/' php_apc.h
# Sanity check, really often broken
-extver=$(sed -n '/#define PHP_APC_VERSION/{s/.* "//;s/".*$//;p}' APC-%{version}/php_apc.h)
+extver=$(sed -n '/#define PHP_APC_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h)
if test "x${extver}" != "x%{version}"; then
: Error: Upstream extension version is ${extver}, expecting %{version}.
exit 1
fi
+cd ..
+%if 0%{?__ztsphp:1}
+# duplicate for ZTS build
cp -pr APC-%{version} APC-%{version}-zts
+%endif
# Drop in the bit of configuration
cat > apc.ini << 'EOF'
@@ -154,10 +151,12 @@ cd APC-%{version}
%configure --enable-apc-mmap --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
+%if 0%{?__ztsphp:1}
cd ../APC-%{version}-zts
%{_bindir}/zts-phpize
%configure --enable-apc-mmap --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
+%endif
%install
@@ -173,10 +172,12 @@ popd
install -D -m 644 apc.ini %{buildroot}%{_sysconfdir}/php.d/apc.ini
# Install the ZTS stuff
+%if 0%{?__ztsphp:1}
pushd APC-%{version}-zts
make install INSTALL_ROOT=%{buildroot}
popd
install -D -m 644 apc.ini %{buildroot}%{php_ztsinidir}/apc.ini
+%endif
# Install the package XML file
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
@@ -188,10 +189,12 @@ TEST_PHP_EXECUTABLE=%{_bindir}/php %{_bindir}/php run-tests.php \
-n -q -d extension_dir=modules \
-d extension=apc.so
+%if 0%{?__ztsphp:1}
cd ../%{pecl_name}-%{version}-zts
TEST_PHP_EXECUTABLE=%{__ztsphp} %{__ztsphp} run-tests.php \
-n -q -d extension_dir=modules \
-d extension=apc.so
+%endif
%post
@@ -216,16 +219,25 @@ rm -rf %{buildroot}
%config(noreplace) %{_sysconfdir}/php.d/apc.ini
%{php_extdir}/apc.so
%{pecl_xmldir}/%{name}.xml
+%if 0%{?__ztsphp:1}
%{php_ztsextdir}/apc.so
%config(noreplace) %{php_ztsinidir}/apc.ini
-
+%endif
%files devel
%{_includedir}/php/ext/apc
+%if 0%{?__ztsphp:1}
%{php_ztsincldir}/ext/apc
+%endif
%changelog
+* Fri Jun 22 2012 Remi Collet <remi@fedoraproject.org> - 3.1.10-2.1
+- sync with rawhide, rebuild for remi repo
+
+* Fri Jun 22 2012 Remi Collet <remi@fedoraproject.org> - 3.1.10-2
+- add patches from upstream
+
* Wed Apr 11 2012 Remi Collet <remi@fedoraproject.org> - 3.1.10-2
- Update to 3.1.10 (beta) for PHP 5.4