From 2b1d9607f6d89404d4c48ac04059480d75bb1b1f Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 9 Sep 2012 16:32:47 +0200 Subject: php-eaccelerator: create 'httpd' sub package for Apache config --- php-eaccelerator-dev.spec | 94 ++++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 46 deletions(-) (limited to 'php-eaccelerator-dev.spec') 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 </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 - 1:1.0-0.3.git42067ac +- create httpd subpackage + * Sun Sep 9 2012 Remi Collet - 1:1.0-0.2.git42067ac - try to improve cache management -- cgit