diff options
-rw-r--r-- | php-eaccelerator-cache.patch | 5 | ||||
-rw-r--r-- | php-eaccelerator-config.patch | 14 | ||||
-rw-r--r-- | php-eaccelerator-dev.spec | 94 | ||||
-rw-r--r-- | php-eaccelerator.httpd | 24 |
4 files changed, 88 insertions, 49 deletions
diff --git a/php-eaccelerator-cache.patch b/php-eaccelerator-cache.patch index c0358a8..18de83d 100644 --- a/php-eaccelerator-cache.patch +++ b/php-eaccelerator-cache.patch @@ -1,5 +1,5 @@ --- eaccelerator.c.cache 2012-09-09 11:49:26.000000000 +0200 -+++ eaccelerator.c 2012-09-09 13:07:04.000000000 +0200 ++++ eaccelerator.c 2012-09-09 15:44:28.000000000 +0200 @@ -1521,13 +1521,13 @@ ZEND_INI_ENTRY1("eaccelerator.shm_ttl", "0", PHP_INI_SYSTEM, eaccelerator_OnUpdateLong, &ea_shm_ttl) ZEND_INI_ENTRY1("eaccelerator.shm_prune_period", "0", PHP_INI_SYSTEM, eaccelerator_OnUpdateLong, &ea_shm_prune_period) @@ -7,7 +7,8 @@ -STD_PHP_INI_ENTRY("eaccelerator.log_file", "", PHP_INI_SYSTEM, OnUpdateString, ea_log_file, zend_eaccelerator_globals, eaccelerator_globals) +STD_PHP_INI_ENTRY("eaccelerator.log_file", "", PHP_INI_SYSTEM|PHP_INI_PERDIR, OnUpdateString, ea_log_file, zend_eaccelerator_globals, eaccelerator_globals) STD_PHP_INI_ENTRY("eaccelerator.check_mtime", "1", PHP_INI_SYSTEM, OnUpdateBool, check_mtime_enabled, zend_eaccelerator_globals, eaccelerator_globals) - ZEND_INI_ENTRY1("eaccelerator.shm_only", "0", PHP_INI_SYSTEM, eaccelerator_OnUpdateBool, &ea_scripts_shm_only) +-ZEND_INI_ENTRY1("eaccelerator.shm_only", "0", PHP_INI_SYSTEM, eaccelerator_OnUpdateBool, &ea_scripts_shm_only) ++ZEND_INI_ENTRY1("eaccelerator.shm_only", "0", PHP_INI_SYSTEM|PHP_INI_PERDIR, eaccelerator_OnUpdateBool, &ea_scripts_shm_only) #ifdef WITH_EACCELERATOR_INFO STD_PHP_INI_ENTRY("eaccelerator.allowed_admin_path", "", PHP_INI_SYSTEM, OnUpdateString, allowed_admin_path, zend_eaccelerator_globals, eaccelerator_globals) #endif diff --git a/php-eaccelerator-config.patch b/php-eaccelerator-config.patch index d0578c8..36afeaa 100644 --- a/php-eaccelerator-config.patch +++ b/php-eaccelerator-config.patch @@ -1,5 +1,5 @@ --- eaccelerator.ini.upstream 2012-09-09 12:38:47.000000000 +0200 -+++ eaccelerator.ini 2012-09-09 12:39:55.000000000 +0200 ++++ eaccelerator.ini 2012-09-09 16:20:49.000000000 +0200 @@ -12,13 +12,8 @@ ; You must uncomment one (and only one) line from the following to load @@ -25,3 +25,15 @@ ; A string that's prepended to all keys. This allows two applications that use the ; same key names to run on the same host by setting this in .htaccess or in the main +@@ -79,9 +74,9 @@ + ; Enables or disables caching of compiled scripts on disk. It has no effect + ; on session data and content caching. + ; Default value is "0" that means - use disk and shared memory for caching. +-eaccelerator.shm_only = "0" ++eaccelerator.shm_only = "1" + + ; The script paths that are allowed to get admin information and do admin + ; controls +-eaccelerator.allowed_admin_path = "" ++eaccelerator.allowed_admin_path = "/usr/share/eaccelerator" + diff --git a/php-eaccelerator-dev.spec b/php-eaccelerator-dev.spec index 24e2c8a..113e06d 100644 --- a/php-eaccelerator-dev.spec +++ b/php-eaccelerator-dev.spec @@ -4,21 +4,23 @@ %global apache 48 %global gitver 42067ac %global cache %{_var}/cache/php-eaccelerator +%global extname eaccelerator -Summary: PHP accelerator, optimizer, encoder and dynamic content cacher +Summary: PHP accelerator, optimizer and dynamic content cacher Name: php-eaccelerator Version: 1.0 -Release: 0.2.git%{gitver}%{?dist} +Release: 0.3.git%{gitver}%{?dist} Epoch: 1 # The eaccelerator module itself is GPLv2+ # The PHP control panel is under the Zend license (control.php and dasm.php) -License: GPLv2+ and Zend +License: GPLv2+ and PHP Group: Development/Languages URL: http://eaccelerator.net/ # github.com/eaccelerator/eaccelerator/tarvall/42067ac7e2d55caa5d060580489f5043357ffbe2 Source0: eaccelerator-eaccelerator-%{gitver}.tar.gz Source1: %{name}.cron +Source2: %{name}.httpd # Fix packaging directory path Patch0: %{name}-config.patch @@ -36,7 +38,7 @@ Requires: php-common%{?_isa} = %{php_version} # Required by our cleanup cron job Requires: tmpwatch -Conflicts: php-mmcache, php-pecl-apc, php-xcache +Conflicts: php-pecl-apc, php-xcache # Other third party repo stuff Obsoletes: php53-eaccelerator @@ -68,16 +70,23 @@ Turck MMCache was created by Dmitry Stogov and much of the eAccelerator code is still based on his work. +%package httpd +Summary: Configuration file for eAccelerator and Apache +Requires(pre): httpd +Requires: php%{?_isa} +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} + +%description httpd +This package provides Apache configuration for eAccelerator: +- enable disk cache +- enable control panel on http://localhost/eaccelerator + + %prep %setup -q -c cp %{SOURCE1} . - -cat >httpd.conf <<EOF -# Redirect cache and log when used from httpd + mod_php -php_value eaccelerator.cache_dir "%{cache}" -php_value eaccelerator.log_file "%{_var}/log/httpd/eaccelerator_log" -EOF +cp %{SOURCE2} . # prepare duplicated build tree mv eaccelerator-eaccelerator-%{gitver} nts @@ -87,14 +96,14 @@ cd nts %patch0 -p0 -b .upstream # Change extension path in the example config sed -e 's|@EXTDIR@/|%{php_extdir}/|' \ - -i eaccelerator.ini + -i %{extname}.ini %patch1 -p0 -b .cache cd ../zts %patch0 -p0 -b .upstream # Change extension path in the example config sed -e 's|@EXTDIR@/|%{php_ztsextdir}/|' \ - -i eaccelerator.ini + -i %{extname}.ini %patch1 -p0 -b .cache @@ -129,19 +138,22 @@ make -C zts install INSTALL_ROOT=%{buildroot} mkdir -p %{buildroot}%{cache}/%{apache} # Drop in the bit of configuration -install -D -m 0644 nts/eaccelerator.ini \ - %{buildroot}%{php_inidir}/eaccelerator.ini -install -D -m 0644 zts/eaccelerator.ini \ - %{buildroot}%{php_ztsinidir}/eaccelerator.ini +install -D -m 0644 nts/%{extname}.ini \ + %{buildroot}%{php_inidir}/%{extname}.ini +install -D -m 0644 zts/%{extname}.ini \ + %{buildroot}%{php_ztsinidir}/%{extname}.ini # Cache removal cron job -install -D -m 0755 -p php-eaccelerator.cron \ +install -D -m 0755 -p %{name}.cron \ %{buildroot}%{_sysconfdir}/cron.daily/%{name} # Apache configuration file -install -D -m 0644 -p httpd.conf \ +install -D -m 0644 -p %{name}.httpd \ %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf +# Control panel +install -d -m 0755 %{buildroot}/%{_datadir}/%{extname} +install -p -m 0644 nts/control.php %{buildroot}/%{_datadir}/%{extname}/index.php %clean rm -rf %{buildroot} @@ -153,36 +165,21 @@ if [ $1 -eq 0 ]; then rm -rf %{cache}/* &>/dev/null || : fi -%post -# We don't want to require "httpd" in case PHP is used with some other web -# server or without any, but we do want the owner of this directory to default -# to apache for a working "out of the box" experience on the most common setup. -# -# We can't store numeric ownerships in %%files and have it work, so "fix" here, -# but only change the ownership if it's the current user (which is root), which -# allows users to manually change ownership and not have it change back. -if [ ! -d %{cache}/%{apache} ] -then - # Create the ghost'ed directory with default ownership and mode - mkdir -p %{cache}/%{apache} - chown %{apache}:%{apache} %{cache}/%{apache} - chmod 0750 %{cache} -fi - +%post httpd # Please remember to empty your eAccelerator disk cache # when upgrading, otherwise things will break! -rm -rf %{cache}/*/* &>/dev/null || : +rm -rf %{cache}/%{apache}/* &>/dev/null || : %check # Check if the built extensions can be loaded %{__php} -n \ - -d zend_extension=%{buildroot}%{php_extdir}/eaccelerator.so \ - -m | grep eAccelerator + -d zend_extension=%{buildroot}%{php_extdir}/%{extname}.so \ + -m | grep -i %{extname} %{__ztsphp} -n \ - -d zend_extension=%{buildroot}%{php_ztsextdir}/eaccelerator.so \ - -m | grep eAccelerator + -d zend_extension=%{buildroot}%{php_ztsextdir}/%{extname}.so \ + -m | grep -i %{extname} %files @@ -190,17 +187,22 @@ rm -rf %{cache}/*/* &>/dev/null || : %doc nts/{AUTHORS,ChangeLog,COPYING,NEWS,README} %doc nts/*.php %{_sysconfdir}/cron.daily/%{name} -%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf -%config(noreplace) %{php_inidir}/eaccelerator.ini -%config(noreplace) %{php_ztsinidir}/eaccelerator.ini -%{php_extdir}/eaccelerator.so -%{php_ztsextdir}/eaccelerator.so -# We need this hack, as otherwise rpm resets ownership upon package upgrade +%config(noreplace) %{php_inidir}/%{extname}.ini +%config(noreplace) %{php_ztsinidir}/%{extname}.ini +%{php_extdir}/%{extname}.so +%{php_ztsextdir}/%{extname}.so %dir %{cache} -%ghost %{cache}/%{apache} +%{_datadir}/%{extname} + +%files httpd +%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf +%attr(750,apache,apache) %dir %{cache}/%{apache} %changelog +* Sun Sep 9 2012 Remi Collet <remi@fedoraproject.org> - 1:1.0-0.3.git42067ac +- create httpd subpackage + * Sun Sep 9 2012 Remi Collet <remi@fedoraproject.org> - 1:1.0-0.2.git42067ac - try to improve cache management diff --git a/php-eaccelerator.httpd b/php-eaccelerator.httpd new file mode 100644 index 0000000..6c84a8e --- /dev/null +++ b/php-eaccelerator.httpd @@ -0,0 +1,24 @@ +# eAccelerator - PHP accelerator, optimizer, encoder and dynamic content cacher + +# Apache specific options - enable cache disk +php_value eaccelerator.shm_only "0" +php_value eaccelerator.cache_dir "/var/cache/php-eaccelerator" +php_value eaccelerator.log_file "/var/log/httpd/eaccelerator_log" + +# Configure control panel +Alias /eaccelerator /usr/share/eaccelerator + +<Directory /usr/share/eaccelerator> + <IfModule mod_authz_core.c> + # Apache 2.4 + Require local + </IfModule> + <IfModule !mod_authz_core.c> + # Apache 2.2 + Order Deny,Allow + Deny from All + Allow from 127.0.0.1 + Allow from ::1 + </IfModule> +</Directory> + |