[php-pecl-apc] add patches from upstream, delete tests which fail
Remi Collet
remi at fedoraproject.org
Mon Aug 27 08:18:48 UTC 2012
commit 4ba9b2ca2454913e14ad0a2a990d989f5765dc0a
Author: remi <fedora at famillecollet.com>
Date: Mon Aug 27 10:18:30 2012 +0200
add patches from upstream, delete tests which fail
apc-svn.patch | 99 +++++++++++++++++++++++++++++++++++++++++++++++++++++
php-pecl-apc.spec | 20 ++++++++++-
2 files changed, 118 insertions(+), 1 deletions(-)
---
diff --git a/apc-svn.patch b/apc-svn.patch
new file mode 100644
index 0000000..d2e4299
--- /dev/null
+++ b/apc-svn.patch
@@ -0,0 +1,99 @@
+--- pecl/apc/trunk/apc_string.c 2012/08/22 14:36:28 327232
++++ pecl/apc/trunk/apc_string.c 2012/08/22 14:54:39 327233
+@@ -206,48 +206,52 @@
+ int count = APCG(shm_strings_buffer) / (sizeof(Bucket) + sizeof(Bucket*) * 2);
+
+ apc_interned_strings_data = (apc_interned_strings_data_t*) apc_sma_malloc(APCG(shm_strings_buffer) TSRMLS_CC);
+- memset((void *)apc_interned_strings_data, 0, APCG(shm_strings_buffer));
++ if (apc_interned_strings_data) {
++ memset((void *)apc_interned_strings_data, 0, APCG(shm_strings_buffer));
+
+- CREATE_LOCK(APCSG(lock));
++ CREATE_LOCK(APCSG(lock));
+
+- zend_hash_init(&APCSG(interned_strings), count, NULL, NULL, 1);
+- APCSG(interned_strings).nTableMask = APCSG(interned_strings).nTableSize - 1;
+- APCSG(interned_strings).arBuckets = (Bucket**)((char*)apc_interned_strings_data + sizeof(apc_interned_strings_data_t));
+-
+- APCSG(interned_strings_start) = (char*)APCSG(interned_strings).arBuckets + APCSG(interned_strings).nTableSize * sizeof(Bucket *);
+- APCSG(interned_strings_end) = (char*)apc_interned_strings_data + APCG(shm_strings_buffer);
+- APCSG(interned_strings_top) = APCSG(interned_strings_start);
+-
+- old_interned_strings_start = CG(interned_strings_start);
+- old_interned_strings_end = CG(interned_strings_end);
+- old_new_interned_string = zend_new_interned_string;
+- old_interned_strings_snapshot = zend_interned_strings_snapshot;
+- old_interned_strings_restore = zend_interned_strings_restore;
+-
+- CG(interned_strings_start) = APCSG(interned_strings_start);
+- CG(interned_strings_end) = APCSG(interned_strings_end);
+- zend_new_interned_string = apc_dummy_new_interned_string_for_php;
+- zend_interned_strings_snapshot = apc_dummy_interned_strings_snapshot_for_php;
+- zend_interned_strings_restore = apc_dummy_interned_strings_restore_for_php;
++ zend_hash_init(&APCSG(interned_strings), count, NULL, NULL, 1);
++ APCSG(interned_strings).nTableMask = APCSG(interned_strings).nTableSize - 1;
++ APCSG(interned_strings).arBuckets = (Bucket**)((char*)apc_interned_strings_data + sizeof(apc_interned_strings_data_t));
++
++ APCSG(interned_strings_start) = (char*)APCSG(interned_strings).arBuckets + APCSG(interned_strings).nTableSize * sizeof(Bucket *);
++ APCSG(interned_strings_end) = (char*)apc_interned_strings_data + APCG(shm_strings_buffer);
++ APCSG(interned_strings_top) = APCSG(interned_strings_start);
++
++ old_interned_strings_start = CG(interned_strings_start);
++ old_interned_strings_end = CG(interned_strings_end);
++ old_new_interned_string = zend_new_interned_string;
++ old_interned_strings_snapshot = zend_interned_strings_snapshot;
++ old_interned_strings_restore = zend_interned_strings_restore;
++
++ CG(interned_strings_start) = APCSG(interned_strings_start);
++ CG(interned_strings_end) = APCSG(interned_strings_end);
++ zend_new_interned_string = apc_dummy_new_interned_string_for_php;
++ zend_interned_strings_snapshot = apc_dummy_interned_strings_snapshot_for_php;
++ zend_interned_strings_restore = apc_dummy_interned_strings_restore_for_php;
+
+- apc_copy_internal_strings(TSRMLS_C);
++ apc_copy_internal_strings(TSRMLS_C);
++ }
+ }
+
+ void apc_interned_strings_shutdown(TSRMLS_D)
+ {
+- zend_hash_clean(CG(function_table));
+- zend_hash_clean(CG(class_table));
+- zend_hash_clean(EG(zend_constants));
+-
+- CG(interned_strings_start) = old_interned_strings_start;
+- CG(interned_strings_end) = old_interned_strings_end;
+- zend_new_interned_string = old_new_interned_string;
+- zend_interned_strings_snapshot = old_interned_strings_snapshot;
+- zend_interned_strings_restore = old_interned_strings_restore;
++ if (apc_interned_strings_data) {
++ zend_hash_clean(CG(function_table));
++ zend_hash_clean(CG(class_table));
++ zend_hash_clean(EG(zend_constants));
++
++ CG(interned_strings_start) = old_interned_strings_start;
++ CG(interned_strings_end) = old_interned_strings_end;
++ zend_new_interned_string = old_new_interned_string;
++ zend_interned_strings_snapshot = old_interned_strings_snapshot;
++ zend_interned_strings_restore = old_interned_strings_restore;
+
+- apc_sma_free(apc_interned_strings_data TSRMLS_CC);
++ apc_sma_free(apc_interned_strings_data TSRMLS_CC);
+
+- DESTROY_LOCK(APCSG(lock));
++ DESTROY_LOCK(APCSG(lock));
++ }
+ }
+ #endif
+
+--- pecl/apc/trunk/apc_string.c 2012/08/23 07:39:44 327243
++++ pecl/apc/trunk/apc_string.c 2012/08/23 09:08:12 327244
+@@ -248,8 +248,6 @@
+ zend_interned_strings_snapshot = old_interned_strings_snapshot;
+ zend_interned_strings_restore = old_interned_strings_restore;
+
+- apc_sma_free(apc_interned_strings_data TSRMLS_CC);
+-
+ DESTROY_LOCK(APCSG(lock));
+ }
+ }
diff --git a/php-pecl-apc.spec b/php-pecl-apc.spec
index 739a1c3..b50491f 100644
--- a/php-pecl-apc.spec
+++ b/php-pecl-apc.spec
@@ -5,12 +5,17 @@
Summary: APC caches and optimizes PHP intermediate code
Name: php-pecl-apc
Version: 3.1.12
-Release: 1%{?dist}
+Release: 2%{?dist}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/APC
Source: http://pecl.php.net/get/APC-%{version}.tgz
+# Upstream patch from SVN.
+# http://svn.php.net/viewvc?view=revision&revision=327233
+# http://svn.php.net/viewvc?view=revision&revision=327244
+Patch0: apc-svn.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: php-devel >= 5.1.0, httpd-devel, php-pear, pcre-devel
@@ -49,6 +54,11 @@ These are the files needed to compile programs using APC serializer.
%setup -q -c
cd APC-%{version}
+%patch0 -p3 -b .orig
+
+# There are currently some failed tests
+# which requires dom extension, so drop them for now.
+rm -f tests/apc54_00{3,8,9}.phpt
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_APC_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h)
@@ -179,6 +189,7 @@ install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%check
cd %{pecl_name}-%{version}
TEST_PHP_EXECUTABLE=%{_bindir}/php \
+REPORT_EXIT_STATUS=1 \
%{_bindir}/php run-tests.php \
-n -q -d extension_dir=modules \
-d extension=apc.so
@@ -186,6 +197,7 @@ TEST_PHP_EXECUTABLE=%{_bindir}/php \
%if 0%{?__ztsphp:1}
cd ../%{pecl_name}-%{version}-zts
TEST_PHP_EXECUTABLE=%{__ztsphp} \
+REPORT_EXIT_STATUS=1 \
%{__ztsphp} run-tests.php \
-n -q -d extension_dir=modules \
-d extension=apc.so
@@ -218,6 +230,7 @@ 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
@@ -226,12 +239,17 @@ rm -rf %{buildroot}
%files devel
%defattr(-, root, root, 0755)
%{_includedir}/php/ext/apc
+
%if 0%{?__ztsphp:1}
%{php_ztsincldir}/ext/apc
%endif
%changelog
+* Mon Aug 27 2012 Remi Collet <remi at fedoraproject.org> - 3.1.12-2
+- add patches from upstream
+- delete tests which fail because of missing dom extension
+
* Thu Aug 16 2012 Remi Collet <remi at fedoraproject.org> - 3.1.12-1
- Version 3.1.12 (beta) - API 3.1.0 (stable)
- spec cleanups
More information about the scm-commits
mailing list