summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apc-defaulton.patch25
-rw-r--r--apc-svn.patch56
-rw-r--r--apc.ini5
-rw-r--r--php-pecl-apc.spec97
4 files changed, 73 insertions, 110 deletions
diff --git a/apc-defaulton.patch b/apc-defaulton.patch
new file mode 100644
index 0000000..9c45738
--- /dev/null
+++ b/apc-defaulton.patch
@@ -0,0 +1,25 @@
+From 518c35e15f7034a26e63beb4e049b6576013014d Mon Sep 17 00:00:00 2001
+From: Xinchen Hui <laruence@php.net>
+Date: Sun, 10 Mar 2013 15:58:26 +0000
+Subject: [PATCH 1/8] default on
+
+---
+ php_apc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/php_apc.c b/php_apc.c
+index 1a6fdcf..6d18914 100644
+--- a/php_apc.c
++++ b/php_apc.c
+@@ -279,7 +279,7 @@ STD_PHP_INI_BOOLEAN("apc.use_request_time", "1", PHP_INI_ALL, OnUpdateBool, use_
+ STD_PHP_INI_BOOLEAN("apc.lazy_functions", "0", PHP_INI_SYSTEM, OnUpdateBool, lazy_functions, zend_apc_globals, apc_globals)
+ STD_PHP_INI_BOOLEAN("apc.lazy_classes", "0", PHP_INI_SYSTEM, OnUpdateBool, lazy_classes, zend_apc_globals, apc_globals)
+ STD_PHP_INI_ENTRY("apc.serializer", "default", PHP_INI_SYSTEM, OnUpdateStringUnempty, serializer_name, zend_apc_globals, apc_globals)
+-STD_PHP_INI_BOOLEAN("apc.enable_opcode_cache", "0", PHP_INI_SYSTEM, OnUpdateBool, enable_opcode_cache, zend_apc_globals, apc_globals)
++STD_PHP_INI_BOOLEAN("apc.enable_opcode_cache", "1", PHP_INI_SYSTEM, OnUpdateBool, enable_opcode_cache, zend_apc_globals, apc_globals)
+ PHP_INI_END()
+
+ /* }}} */
+--
+1.8.4.2
+
diff --git a/apc-svn.patch b/apc-svn.patch
deleted file mode 100644
index 14547e2..0000000
--- a/apc-svn.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-Index: apc_compile.c
-===================================================================
---- apc_compile.c (révision 328824)
-+++ apc_compile.c (copie de travail)
-@@ -2469,9 +2469,11 @@
- dst->alias_len = src->alias_len;
- }
-
-+#ifndef ZEND_ENGINE_2_5
- if (src->function) {
- CHECK(dst->function = my_copy_function(NULL, src->function, ctxt TSRMLS_CC));
- }
-+#endif
-
- APC_COPY_TRAIT_METHOD(dst->trait_method, src->trait_method);
-
-@@ -2506,9 +2508,11 @@
- }
- memcpy(dst, src, sizeof(zend_trait_precedence));
-
-+#ifndef ZEND_ENGINE_2_5
- if (src->function) {
- CHECK(dst->function = my_copy_function(NULL, src->function, ctxt TSRMLS_CC));
- }
-+#endif
-
- if (src->exclude_from_classes && *src->exclude_from_classes) {
- int i = 0, num_classes = 0;
-Index: tests/apc54_error_010.phpt
-===================================================================
---- tests/apc54_error_010.phpt (révision 328955)
-+++ tests/apc54_error_010.phpt (copie de travail)
-@@ -23,8 +23,8 @@
- }
-
- class bar {
-- use foo, c { c::test insteadof foo, b; }
-- use foo, c { c::test insteadof foo, b; }
-+ use foo, c { c::test insteadof foo; }
-+ use foo, c { c::test insteadof foo; }
- }
-
- \$x = new bar;
-Index: tests/apc54_error_010_2.phpt
-===================================================================
---- tests/apc54_error_010_2.phpt (révision 328955)
-+++ tests/apc54_error_010_2.phpt (copie de travail)
-@@ -23,7 +23,7 @@
- }
-
- class bar {
-- use foo, c { c::test insteadof foo, b; }
-+ use foo, c { c::test insteadof foo; }
- }
-
- \$x = new bar;
diff --git a/apc.ini b/apc.ini
index 9827dc2..eb84112 100644
--- a/apc.ini
+++ b/apc.ini
@@ -6,7 +6,7 @@ extension = apc.so
; This can be set to enable the APC opcode cache
-; Don't set this option if another opcode cache is enabled
+; WARNING: don't set this option if another opcode cache is enabled
apc.enable_opcode_cache=0
; This can be set to 0 to disable APC.
@@ -16,7 +16,8 @@ apc.enable_opcode_cache=0
apc.shm_size=64M
; The shared memory size reserved for strings, with M/G suffixe
-apc.shm_strings_buffer=8M
+; WARNING: only enable this buffer if you don't use Zend Opcache
+apc.shm_strings_buffer=0
; A "hint" about the number of distinct source files that will be included or
; requested on your web server. Set to zero or omit if you are not sure;
diff --git a/php-pecl-apc.spec b/php-pecl-apc.spec
index 4887322..00b7e96 100644
--- a/php-pecl-apc.spec
+++ b/php-pecl-apc.spec
@@ -1,23 +1,37 @@
+# spec file for php-pecl-apc
+#
+# Copyright (c) 2009-2014 Remi Collet
+# Copyright (c) 2008 Tim Jackson
+# Copyright (c) 2006-2007 Chris Chabot
+# License: MIT
+# http://opensource.org/licenses/MIT
+#
+# Please, preserve the changelog entries
+#
%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
%global pecl_name APC
-%global svnrev 329913
+%global gitdat 20130912
+%global gitrev 6a90406
Summary: APC caches and optimizes PHP intermediate code
Name: php-pecl-apc
Version: 3.1.15
-Release: 0.3.svn%{svnrev}%{?dist}.1
+Release: 0.4.%{gitdat}%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP
Group: Development/Languages
URL: http://pecl.php.net/package/APC
-# svn export -r 329913 http://svn.php.net/repository/pecl/apc/trunk APC-3.1.15
+# git clone https://git.php.net/repository/pecl/caching/apc.git APC-3.1.15
+# (cd APC-3.1.15; git checkout 6a90406; rm -rf .git tests/symfony)
# tar czf APC-3.1.15-dev.tgz APC-3.1.15
-Source0: http://pecl.php.net/get/APC-%{version}%{?svnrev:-dev}.tgz
+Source0: http://pecl.php.net/get/APC-%{version}%{?gitdat:-dev}.tgz
Source1: apc.ini
Source2: apc-panel.conf
Source3: apc.conf.php
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+Patch0: apc-defaulton.patch
+
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: php-devel
BuildRequires: php-pear
BuildRequires: httpd-devel
@@ -71,7 +85,9 @@ Group: Applications/Internet
BuildArch: noarch
%endif
Requires: %{name} = %{version}-%{release}
-Requires: mod_php, httpd, php-gd
+Requires: mod_php
+Requires: php-gd
+Requires: httpd
%description -n apc-panel
This package provides the APC control panel, with Apache
@@ -80,32 +96,22 @@ configuration, available on http://localhost/apc-panel/
%prep
%setup -q -c
-%if 0%{?svnrev}
+%if 0%{?gitdat}
sed -e "/release/s/%{version}/%{version}dev/" \
- -e "/date/s/2013-??-??/2013-03-25/" \
+ -e "/date/s/2013-??-??/2013-09-12/" \
APC-%{version}/package.xml >package.xml
+grep date package.xml | head -n 1
%endif
cd APC-%{version}
-%if "%{php_version}" > "5.5"
-# With PHP > 5.5, disable
-sed -e '/apc.enable_opcode_cache/s/1/0/' \
- -i php_apc.c
-sed -e '/apc.enable_opcode_cache/s/1/0/' \
- %{SOURCE1} > ../apc.ini
-%else
-# With PHP < 5.4, enable
-sed -e '/apc.enable_opcode_cache/s/0/1/' \
- -i php_apc.c
-sed -e '/apc.enable_opcode_cache/s/0/1/' \
- %{SOURCE1} > ../apc.ini
-%endif
+# opcode cache disabled by default (revert)
+%patch0 -p1 -R
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_APC_VERSION/{s/.* "//;s/".*$//;p}' php_apc.h)
-if test "x${extver}" != "x%{version}%{?svnrev:-dev}"; then
- : Error: Upstream extension version is ${extver}, expecting %{version}%{?svnrev:-dev}..
+if test "x${extver}" != "x%{version}%{?gitdat:-dev}"; then
+ : Error: Upstream extension version is ${extver}, expecting %{version}%{?gitdat:-dev}..
exit 1
fi
cd ..
@@ -135,11 +141,11 @@ rm -rf %{buildroot}
# Install the NTS stuff
make install -C APC-%{version} INSTALL_ROOT=%{buildroot}
-install -D -m 644 apc.ini %{buildroot}%{php_inidir}/apc.ini
+install -D -m 644 %{SOURCE1} %{buildroot}%{php_inidir}/apc.ini
# Install the ZTS stuff
make install -C APC-%{version}-zts INSTALL_ROOT=%{buildroot}
-install -D -m 644 apc.ini %{buildroot}%{php_ztsinidir}/apc.ini
+install -D -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/apc.ini
# Install the package XML file
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
@@ -158,33 +164,15 @@ install -D -m 644 -p %{SOURCE3} \
%check
-%ifarch x86_64
-cd %{pecl_name}-%{version}
-ln -sf %{php_extdir}/dom.so modules/
-
-TEST_PHP_EXECUTABLE=%{_bindir}/php \
-TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=dom.so -d extension=apc.so" \
-NO_INTERACTION=1 \
-REPORT_EXIT_STATUS=0 \
-%{_bindir}/php -n run-tests.php
-
-cd ../%{pecl_name}-%{version}-zts
-ln -sf %{php_ztsextdir}/dom.so modules/
-
-TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=dom.so -d extension=apc.so" \
-NO_INTERACTION=1 \
-REPORT_EXIT_STATUS=0 \
-%{__ztsphp} -n run-tests.php
-%else
: minimal load test
%{__php} -n \
- -d extension_dir=%{pecl_name}-%{version}/modules \
- -d extension=apc.so -m | grep apc
-%{__ztsphp} -n \
- -d extension_dir=%{pecl_name}-%{version}-zts/modules \
- -d extension=apc.so -m | grep apc
-%endif
+ -d extension=%{buildroot}%{php_extdir}/apc.so \
+ -m | grep apc
+
+%{__ztsphp} -n \
+ -d extension=%{buildroot}%{php_ztsextdir}/apc.so \
+ -m | grep apc
+
%post
@@ -227,6 +215,11 @@ rm -rf %{buildroot}
%changelog
+* Fri Feb 14 2014 Remi Collet <remi@fedoraproject.org> - 3.1.15-0.4.20140912
+- upstream has switched from SVN to GIT
+- update to latest git snapshot
+- disable shm_strings_buffer in provided configuration
+
* Wed Apr 17 2013 Remi Collet <remi@fedoraproject.org> - 3.1.15-0.3.svn329913
- update to latest snapshot
- switch most configuration to upstream default
@@ -307,10 +300,10 @@ rm -rf %{buildroot}
- pull changes from SVN revision 316786
- build against php 5.4
-* Sat Sep 16 2011 Remi Collet <Fedora@FamilleCollet.com> - 3.1.9-3
+* Fri Sep 16 2011 Remi Collet <Fedora@FamilleCollet.com> - 3.1.9-3
- rebuild using latest php version and macro
-* Tue Aug 24 2011 Remi Collet <Fedora@FamilleCollet.com> - 3.1.9-2
+* Wed Aug 24 2011 Remi Collet <Fedora@FamilleCollet.com> - 3.1.9-2
- build zts extension
* Sun May 15 2011 Remi Collet <Fedora@FamilleCollet.com> - 3.1.9-1