[php-pecl-apc/f18] - update to 3.1.15dev with new directive 'enable_opcode_cache' (enabled) which allow to cache only

Remi Collet remi at fedoraproject.org
Wed Apr 17 14:13:42 UTC 2013


commit 38711ac1932ad78b1ccab6c0d967f0e63333cad0
Author: Remi Collet <remi at fedoraproject.org>
Date:   Wed Apr 17 16:13:34 2013 +0200

    - update to 3.1.15dev with new directive 'enable_opcode_cache' (enabled)
      which allow to cache only user data and use another opcode cache
    - switch most configuration to upstream default

 .gitignore        |    2 +
 apc.ini           |   91 +++++++++++++++++++++++++++++----------------
 php-pecl-apc.spec |  106 ++++++++++++++++++++++++++++------------------------
 sources           |    2 +-
 4 files changed, 119 insertions(+), 82 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index f60e482..4918e5f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+clog
 *spec~
 package*xml
 /APC-3.1.10.tgz
@@ -5,3 +6,4 @@ package*xml
 /APC-3.1.12.tgz
 /APC-3.1.13.tgz
 /APC-3.1.14.tgz
+/APC-3.1.15-dev.tgz
diff --git a/apc.ini b/apc.ini
index 9827664..9827dc2 100644
--- a/apc.ini
+++ b/apc.ini
@@ -4,68 +4,95 @@ extension = apc.so
 ; Options for the APC module version >= 3.1.3
 ; See http://www.php.net/manual/en/apc.configuration.php
 
+
+; This can be set to enable the APC opcode cache
+; 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. 
-apc.enabled=1
-; The number of shared memory segments to allocate for the compiler cache. 
-apc.shm_segments=1
+;apc.enabled=1
+
 ; The size of each shared memory segment, with M/G suffixe
 apc.shm_size=64M
+
+; The shared memory size reserved for strings, with M/G suffixe
+apc.shm_strings_buffer=8M
+
 ; 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;
-apc.num_files_hint=1024
+;apc.num_files_hint=1000
+
 ; Just like num_files_hint, a "hint" about the number of distinct user cache
 ; variables to store.  Set to zero or omit if you are not sure;
-apc.user_entries_hint=4096
+;apc.user_entries_hint=4096
+
 ; The number of seconds a cache entry is allowed to idle in a slot in case this
 ; cache entry slot is needed by another entry.
-apc.ttl=7200
+;apc.ttl=0
+
 ; use the SAPI request start time for TTL
-apc.use_request_time=1
+;apc.use_request_time=1
+
 ; The number of seconds a user cache entry is allowed to idle in a slot in case
 ; this cache entry slot is needed by another entry.
-apc.user_ttl=7200
+;apc.user_ttl=0
+
 ; The number of seconds that a cache entry may remain on the garbage-collection list. 
-apc.gc_ttl=3600
+;apc.gc_ttl=3600
+
 ; On by default, but can be set to off and used in conjunction with positive
 ; apc.filters so that files are only cached if matched by a positive filter.
-apc.cache_by_default=1
+;apc.cache_by_default=1
+
 ; A comma-separated list of POSIX extended regular expressions.
-apc.filters
+;apc.filters=
+
 ; The mktemp-style file_mask to pass to the mmap module 
 apc.mmap_file_mask=/tmp/apc.XXXXXX
+
+
 ; This file_update_protection setting puts a delay on caching brand new files.
-apc.file_update_protection=2
+;apc.file_update_protection=2
+
 ; Setting this enables APC for the CLI version of PHP (Mostly for testing and debugging).
-apc.enable_cli=0
+;apc.enable_cli=0
+
 ; Prevents large files from being cached
-apc.max_file_size=1M
+;apc.max_file_size=1M
+
 ; Whether to stat the main script file and the fullpath includes.
-apc.stat=1
+;apc.stat=1
+
 ; Vertification with ctime will avoid problems caused by programs such as svn or rsync by making 
 ; sure inodes have not changed since the last stat. APC will normally only check mtime.
-apc.stat_ctime=0
-; Whether to canonicalize paths in stat=0 mode or fall back to stat behaviour
-apc.canonicalize=0
+;apc.stat_ctime=0
+
+; If on, then relative paths are canonicalized in no-stat mode.
+; If set, then files included via stream wrappers can not be cached
+; as realpath() does not support stream wrappers.
+;apc.canonicalize=1
+
 ; With write_lock enabled, only one process at a time will try to compile an 
 ; uncached script while the other processes will run uncached
-apc.write_lock=1
+;apc.write_lock=1
+
 ; Logs any scripts that were automatically excluded from being cached due to early/late binding issues.
-apc.report_autofilter=0
+;apc.report_autofilter=0
+
 ; RFC1867 File Upload Progress hook handler
-apc.rfc1867=0
-apc.rfc1867_prefix =upload_
-apc.rfc1867_name=APC_UPLOAD_PROGRESS
-apc.rfc1867_freq=0
-apc.rfc1867_ttl=3600
-; Optimize include_once and require_once calls and avoid the expensive system calls used.
-apc.include_once_override=0
-apc.lazy_classes=0
-apc.lazy_functions=0
+;apc.rfc1867=0
+;apc.rfc1867_prefix =upload_
+;apc.rfc1867_name=APC_UPLOAD_PROGRESS
+;apc.rfc1867_freq=0
+;apc.rfc1867_ttl=3600
+
 ; Enables APC handling of signals, such as SIGSEGV, that write core files when signaled. 
 ; APC will attempt to unmap the shared memory segment in order to exclude it from the core file
-apc.coredump_unmap=0
+;apc.coredump_unmap=0
+
 ; Records a md5 hash of files. 
-apc.file_md5=0
+;apc.file_md5=0
+
 ; not documented
-apc.preload_path
+;apc.preload_path=
 
diff --git a/php-pecl-apc.spec b/php-pecl-apc.spec
index ba9260c..0da8f50 100644
--- a/php-pecl-apc.spec
+++ b/php-pecl-apc.spec
@@ -1,25 +1,26 @@
-%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
+%{!?php_inidir:  %{expand: %%global php_inidir  %{_sysconfdir}/php.d}}
+%{!?php_incldir: %{expand: %%global php_incldir %{_includedir}/php}}
+%{!?__php:       %{expand: %%global __php       %{_bindir}/php}}
+%{!?__pecl:      %{expand: %%global __pecl      %{_bindir}/pecl}}
 
 %global pecl_name APC
+%global svnrev    329913
+%global with_zts  0%{?__ztsphp:1}
 
 Summary:       APC caches and optimizes PHP intermediate code
 Name:          php-pecl-apc
-Version:       3.1.14
-Release:       1%{?dist}
+Version:       3.1.15
+Release:       0.3.svn%{svnrev}%{?dist}
 License:       PHP
 Group:         Development/Languages
 URL:           http://pecl.php.net/package/APC
-Source0:       http://pecl.php.net/get/APC-%{version}.tgz
+# svn export -r  329913 http://svn.php.net/repository/pecl/apc/trunk APC-3.1.15
+# tar czf APC-3.1.15-dev.tgz APC-3.1.15
+Source0:       http://pecl.php.net/get/APC-%{version}%{?svnrev:-dev}.tgz
 Source1:       apc.ini
 Source2:       apc-panel.conf
 Source3:       apc.conf.php
 
-# Upstream patches from SVN
-# http://svn.php.net/viewvc?view=revision&revision=328955
-# http://svn.php.net/viewvc?view=revision&revision=328956
-# http://svn.php.net/viewvc?view=revision&revision=328957
-Patch0:        apc-svn.patch
-
 BuildRequires: php-devel
 BuildRequires: php-pear
 BuildRequires: httpd-devel
@@ -32,9 +33,6 @@ Requires(postun): %{__pecl}
 Requires:      php(zend-abi) = %{php_zend_api}
 Requires:      php(api) = %{php_core_api}
 
-Conflicts:     php-mmcache
-Conflicts:     php-eaccelerator
-Conflicts:     php-xcache
 Provides:      php-apc = %{version}
 Provides:      php-apc%{?_isa} = %{version}
 Provides:      php-pecl(%{pecl_name}) = %{version}
@@ -75,28 +73,41 @@ configuration, available on http://localhost/apc-panel/
 
 
 %prep
-%setup -q -c -T
-tar xif %{SOURCE0}
+%setup -q -c
+%if 0%{?svnrev}
+sed -e "/release/s/%{version}/%{version}dev/" \
+    -e "/date/s/2013-??-??/2013-03-25/" \
+    APC-%{version}/package.xml >package.xml
+%endif
 
 cd APC-%{version}
-%patch0 -p0 -b .php55
 
-%if 0%{?__isa_bits}
-# port number to allow 32/64 build at same time
-port=$(expr %{__isa_bits} + 8900)
-sed -e "/PHP_CLI_SERVER_PORT/s/8964/$port/" \
-    -i tests/server_test.inc
+%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
 
 # Sanity check, really often broken
 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}.
+if test "x${extver}" != "x%{version}%{?svnrev:-dev}"; then
+   : Error: Upstream extension version is ${extver}, expecting %{version}%{?svnrev:-dev}..
    exit 1
 fi
 cd ..
 
-%if 0%{?__ztsphp:1}
+# Fix the charset of NOTICE
+iconv -f iso-8859-1 -t utf8 APC-%{version}/NOTICE >NOTICE
+
+%if %{with_zts}
 # duplicate for ZTS build
 cp -pr APC-%{version} APC-%{version}-zts
 %endif
@@ -108,7 +119,7 @@ cd APC-%{version}
 %configure --enable-apc-mmap --with-php-config=%{_bindir}/php-config
 make %{?_smp_mflags}
 
-%if 0%{?__ztsphp:1}
+%if %{with_zts}
 cd ../APC-%{version}-zts
 %{_bindir}/zts-phpize
 %configure --enable-apc-mmap --with-php-config=%{_bindir}/zts-php-config
@@ -118,21 +129,14 @@ make %{?_smp_mflags}
 
 %install
 # Install the NTS stuff
-pushd APC-%{version}
-make install INSTALL_ROOT=%{buildroot}
+make install -C APC-%{version} INSTALL_ROOT=%{buildroot}
 
-# Fix the charset of NOTICE
-iconv -f iso-8859-1 -t utf8 NOTICE >NOTICE.utf8
-mv NOTICE.utf8 NOTICE
-popd
-install -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/php.d/apc.ini
+install -D -m 644 apc.ini %{buildroot}%{php_inidir}/apc.ini
 
+%if %{with_zts}
 # Install the ZTS stuff
-%if 0%{?__ztsphp:1}
-pushd APC-%{version}-zts
-make install INSTALL_ROOT=%{buildroot}
-popd
-install -D -m 644 %{SOURCE1} %{buildroot}%{php_ztsinidir}/apc.ini
+make install -C APC-%{version}-zts INSTALL_ROOT=%{buildroot}
+install -D -m 644 apc.ini %{buildroot}%{php_ztsinidir}/apc.ini
 %endif
 
 # Install the package XML file
@@ -159,25 +163,25 @@ 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=1 \
+REPORT_EXIT_STATUS=0 \
 %{_bindir}/php -n run-tests.php
 
-%if 0%{?__ztsphp:1}
+%if %{with_zts}
 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=1 \
+REPORT_EXIT_STATUS=0 \
 %{__ztsphp} -n run-tests.php
 %endif
 %else
 : minimal load test
-%{_bindir}/php -n \
+%{__php} -n \
    -d extension_dir=%{pecl_name}-%{version}/modules \
    -d extension=apc.so -m | grep apc
-%if 0%{?__ztsphp:1}
+%if %{with_zts}
 %{__ztsphp}    -n \
    -d extension_dir=%{pecl_name}-%{version}-zts/modules \
    -d extension=apc.so -m | grep apc
@@ -196,22 +200,21 @@ fi
 
 
 %files
-%doc APC-%{version}/TECHNOTES.txt APC-%{version}/CHANGELOG APC-%{version}/LICENSE
-%doc APC-%{version}/NOTICE        APC-%{version}/TODO      APC-%{version}/apc.php
-%doc APC-%{version}/INSTALL
-%config(noreplace) %{_sysconfdir}/php.d/apc.ini
+%doc APC-%{version}/{TECHNOTES.txt,CHANGELOG,LICENSE,INSTALL,TODO,apc.php}
+%doc NOTICE
+%config(noreplace) %{php_inidir}/apc.ini
 %{php_extdir}/apc.so
 %{pecl_xmldir}/%{name}.xml
 
-%if 0%{?__ztsphp:1}
+%if %{with_zts}
 %{php_ztsextdir}/apc.so
 %config(noreplace) %{php_ztsinidir}/apc.ini
 %endif
 
 %files devel
-%{_includedir}/php/ext/apc
+%{php_incldir}/ext/apc
 
-%if 0%{?__ztsphp:1}
+%if %{with_zts}
 %{php_ztsincldir}/ext/apc
 %endif
 
@@ -224,6 +227,11 @@ fi
 
 
 %changelog
+* Wed Apr 17 2013 Remi Collet <remi at fedoraproject.org> - 3.1.15-0.3.svn329913
+- update to 3.1.15dev with new directive 'enable_opcode_cache' (enabled)
+  which allow to cache only user data and use another opcode cache
+- switch most configuration to upstream default
+
 * Thu Jan  3 2013 Remi Collet <remi at fedoraproject.org> - 3.1.14-1
 - Version 3.1.14 (beta) - API 3.1.0 (stable)
 
diff --git a/sources b/sources
index 775aa14..c0cb9f7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-39d4a97e4d305b29d7aae13ba5f1804a  APC-3.1.14.tgz
+cab4cbbd120d4a9a34f594e71754494a  APC-3.1.15-dev.tgz


More information about the scm-commits mailing list