summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-07-04 16:36:36 +0200
committerRemi Collet <fedora@famillecollet.com>2013-07-04 16:36:36 +0200
commit5029abd55a7d2a0c395ebc11567e491f2bb303d2 (patch)
treebdd693ba74f7841e53dc92f799287631e16a3b3d
parent4718c9f5ab65c78d18101f3c9190f1bd07854d5d (diff)
php-pecl-igbinary: build with apcu (worl in progress)
-rw-r--r--igbinary-apcu.patch72
-rw-r--r--igbinary-php54.patch12
-rw-r--r--php-pecl-igbinary.spec50
3 files changed, 106 insertions, 28 deletions
diff --git a/igbinary-apcu.patch b/igbinary-apcu.patch
new file mode 100644
index 0000000..03dede7
--- /dev/null
+++ b/igbinary-apcu.patch
@@ -0,0 +1,72 @@
+--- igbinary-c35d48f3d14794373b2ef89a6d79020bb7418d7f/config.m4 2012-07-23 21:20:49.000000000 +0200
++++ igbinary-1.1.2/config.m4 2013-07-04 16:23:00.030580798 +0200
+@@ -20,10 +20,15 @@
+ AC_CHECK_HEADERS([stddef.h],, AC_MSG_ERROR([stddef.h not exists]))
+ AC_CHECK_HEADERS([stdint.h],, AC_MSG_ERROR([stdint.h not exists]))
+
+- AC_MSG_CHECKING([for apc includes])
+- if test -f "$phpincludedir/ext/apc/apc_serializer.h"; then
+- apc_inc_path="$phpincludedir"
+- AC_MSG_RESULT([$apc_inc_path])
++ AC_MSG_CHECKING([for APC/APCU includes])
++ if test -f "$phpincludedir/ext/apcu/apc_api.h"; then
++ apc_inc_path="$phpincludedir"
++ AC_MSG_RESULT([APCU in $apc_inc_path])
++ AC_DEFINE(HAVE_APC_SUPPORT,1,[Whether to enable apc support])
++ AC_DEFINE(HAVE_APCU_SUPPORT,1,[Whether to enable apc support via apcu])
++ elif test -f "$phpincludedir/ext/apc/apc_serializer.h"; then
++ apc_inc_path="$phpincludedir"
++ AC_MSG_RESULT([APC in $apc_inc_path])
+ AC_DEFINE(HAVE_APC_SUPPORT,1,[Whether to enable apc support])
+ elif test -f "${srcdir}/apc_serializer.h"; then
+ AC_MSG_RESULT([apc_serializer.h bundled])
+--- igbinary-c35d48f3d14794373b2ef89a6d79020bb7418d7f/igbinary.c 2012-07-23 21:20:49.000000000 +0200
++++ igbinary-1.1.2/igbinary.c 2013-07-04 16:24:11.774806737 +0200
+@@ -28,6 +28,9 @@
+
+ #include "ext/standard/php_incomplete_class.h"
+
++#ifdef HAVE_APCU_SUPPORT
++# include "ext/apcu/apc_api.h"
++#else
+ #ifdef HAVE_APC_SUPPORT
+ # if USE_BUNDLED_APC
+ # include "apc_serializer.h"
+@@ -35,6 +38,7 @@
+ # include "ext/apc/apc_serializer.h"
+ # endif
+ #endif /* HAVE_APC_SUPPORT */
++#endif /* HAVE_APCU_SUPPORT */
+ #include "php_igbinary.h"
+
+ #include "igbinary.h"
+@@ -242,9 +246,13 @@
+ #ifdef HAVE_PHP_SESSION
+ ZEND_MOD_REQUIRED("session")
+ #endif
++#ifdef HAVE_APCU_SUPPORT
++ ZEND_MOD_REQUIRED("apcu")
++#else
+ #ifdef HAVE_APC_SUPPORT
+ ZEND_MOD_OPTIONAL("apc")
+ #endif
++#endif
+ {NULL, NULL, NULL}
+ };
+ #endif
+@@ -339,11 +347,15 @@
+ php_info_print_table_start();
+ php_info_print_table_row(2, "igbinary support", "enabled");
+ php_info_print_table_row(2, "igbinary version", IGBINARY_VERSION);
++#ifdef HAVE_APCU_SUPPORT
++ php_info_print_table_row(2, "igbinary APCU serializer ABI", "yes");
++#else
+ #ifdef HAVE_APC_SUPPORT
+ php_info_print_table_row(2, "igbinary APC serializer ABI", APC_SERIALIZER_ABI);
+ #else
+ php_info_print_table_row(2, "igbinary APC serializer ABI", "no");
+ #endif
++#endif
+ #if HAVE_PHP_SESSION
+ php_info_print_table_row(2, "igbinary session support", "yes");
+ #else
diff --git a/igbinary-php54.patch b/igbinary-php54.patch
deleted file mode 100644
index 5c5e16b..0000000
--- a/igbinary-php54.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up tests/igbinary_024.phpt.old tests/igbinary_024.phpt
---- tests/igbinary_024.phpt.old 2011-11-14 18:47:29.800802812 +0100
-+++ tests/igbinary_024.phpt 2011-11-14 18:47:39.017832456 +0100
-@@ -81,7 +81,7 @@ $o3 = new Obj3(0, 1, 4);
- test('objectrecarr', $o3, false);
-
- $o4 = new Obj4(100);
--$o4->set(&$o4);
-+$o4->set($o4);
- test('objectselfrec', $o4, true);
-
- /*
diff --git a/php-pecl-igbinary.spec b/php-pecl-igbinary.spec
index 054dfe1..6999456 100644
--- a/php-pecl-igbinary.spec
+++ b/php-pecl-igbinary.spec
@@ -18,7 +18,7 @@ Summary: Replacement for the standard PHP serializer
Name: php-pecl-igbinary
Version: 1.1.2
%if 0%{?short:1}
-Release: 0.6.git%{short}%{?dist}
+Release: 0.6.git%{short}%{?dist}
Source0: https://github.com/%{extname}/%{extname}/archive/%{commit}/%{extname}-%{version}-%{short}.tar.gz
%else
Release: 2%{?dist}
@@ -32,21 +32,23 @@ Group: System Environment/Libraries
URL: http://pecl.php.net/package/igbinary
-# https://bugs.php.net/60298
-Patch0: igbinary-php54.patch
-
# https://github.com/krakjoe/apcu/issues/21
-Patch1: igbinary-apcu.patch
+Patch0: igbinary-apcu.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n)
-BuildRequires: php-pecl-apc-devel >= 3.1.7
BuildRequires: php-pear
BuildRequires: php-devel >= 5.2.0
+# we cannot make this conditional
+# but php-pecl-apcu-devel provides php-pecl-apc-devel
+BuildRequires: php-pecl-apc-devel >= 3.1.7
Requires(post): %{__pecl}
Requires(postun): %{__pecl}
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
+%if "%{php_version}" > "5.5"
+Requires: php-pecl-apcu%{?_isa}
+%endif
Obsoletes: php-%{extname} <= 1.1.1
Provides: php-%{extname} = %{version}
@@ -98,9 +100,9 @@ mv igbinary-%{commit} %{extname}-%{version}
sed -e '/release/s/-dev/dev/' -i package.xml
cd %{extname}-%{version}
-%patch0 -p0 -b .php54
+
%if "%{php_version}" > "5.5"
-%patch1 -p1 -b .apcu
+%patch0 -p1 -b .apcu
%endif
%else
@@ -148,7 +150,7 @@ make %{?_smp_mflags}
%install
rm -rf %{buildroot}
# for short circuit
-rm -f %{extname}*/modules/apc*so
+rm -f %{extname}*/modules/apc.so
make install -C %{extname}-%{version} \
INSTALL_ROOT=%{buildroot}
@@ -165,22 +167,34 @@ install -D -m 644 %{extname}.ini %{buildroot}%{php_ztsinidir}/%{extname}.ini
%check
cd %{extname}-%{version}
+# APC required for test 045
+%if "%{php_version}" > "5.5"
+ln -s %{php_extdir}/apcu.so modules/apc.so
+%else
+ln -s %{php_extdir}/apc.so modules/apc.so
+%endif
+
# simple module load test
-# (without APC to ensure than can run without)
%{__php} --no-php-ini \
--define extension_dir=modules \
+ --define extension=apc.so \
--define extension=%{extname}.so \
--modules | grep %{extname}
-# APC required for test 045
+NO_INTERACTION=1 REPORT_EXIT_STATUS=0 \
+make test
+
+cd ../%{extname}-%{version}-zts
%if "%{php_version}" > "5.5"
-ln -s %{php_extdir}/apcu.so modules/
+ln -s %{php_ztsextdir}/apcu.so modules/apc.so
%else
-ln -s %{php_extdir}/apc.so modules/
+ln -s %{php_ztsextdir}/apc.so modules/apc.so
%endif
-
-NO_INTERACTION=1 REPORT_EXIT_STATUS=0 \
-make test
+%{__ztsphp} --no-php-ini \
+ --define extension_dir=modules \
+ --define extension=apc.so \
+ --define extension=%{extname}.so \
+ --modules | grep %{extname}
%clean
@@ -219,6 +233,10 @@ fi
%changelog
+* Thu Jul 4 2013 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.6.git3b8ab7e
+- latest snapshot
+- rebuild with APCu
+
* Fri Nov 30 2012 Remi Collet <remi@fedoraproject.org> - 1.1.2-0.3.git3b8ab7e
- cleanups