rpms/php-eaccelerator/devel php-eaccelerator.spec,1.40,1.41

Matthias Saou thias at fedoraproject.org
Wed Dec 24 14:45:22 UTC 2008


Author: thias

Update of /cvs/extras/rpms/php-eaccelerator/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22600

Modified Files:
	php-eaccelerator.spec 
Log Message:
Update default cache dir to be ghosted and take care of creating it and changing default ownership in the %%post scriplet (fixes #443407).



Index: php-eaccelerator.spec
===================================================================
RCS file: /cvs/extras/rpms/php-eaccelerator/devel/php-eaccelerator.spec,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- php-eaccelerator.spec	22 Dec 2008 18:43:18 -0000	1.40
+++ php-eaccelerator.spec	24 Dec 2008 14:44:52 -0000	1.41
@@ -1,13 +1,14 @@
-%global php_extdir  %(php-config --extension-dir 2>/dev/null || echo "undefined")
+%global php_extdir %(php-config --extension-dir 2>/dev/null || echo "undefined")
 
-# This is the apache userid, only used for sysvipc semaphores which is the
-# default on ppc since spinlock is not detected (not supported?)
-%define userid 48
+# This is the apache userid, used for sysvipc semaphores which is the default
+# on ppc since spinlock is not detected (not supported?)
+# We also use it for the default ownership of the cache directory
+%define apache 48
 
 Summary: PHP accelerator, optimizer, encoder and dynamic content cacher
 Name: php-eaccelerator
 Version: 0.9.5.3
-Release: 1%{?dist}
+Release: 2%{?dist}
 Epoch: 1
 # The eaccelerator module itself is GPLv2+
 # The PHP control panel is under the Zend license (control.php and dasm.php)
@@ -47,7 +48,7 @@
 phpize
 %configure \
 %ifnarch %{ix86} x86_64
-    --with-eaccelerator-userid="%{userid}" \
+    --with-eaccelerator-userid="%{apache}" \
 %endif
     --with-eaccelerator-shared-memory \
     --with-eaccelerator-sessions \
@@ -81,6 +82,22 @@
     %{__rm} -rf %{_var}/cache/php-eaccelerator/* &>/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.
+
+# Create the ghost'ed directory with default ownership and mode
+if [ ! -d %{_var}/cache/php-eaccelerator ]; then
+    %{__mkdir_p} %{_var}/cache/php-eaccelerator
+    %{__chown} %{apache}:%{apache} %{_var}/cache/php-eaccelerator
+    %{__chmod} 0750 %{_var}/cache/php-eaccelerator
+fi
+
 
 %files
 %defattr(-,root,root,-)
@@ -89,10 +106,17 @@
 %{_sysconfdir}/cron.daily/php-eaccelerator
 %config(noreplace) %{_sysconfdir}/php.d/eaccelerator.ini
 %{php_extdir}/eaccelerator.so
-%attr(0750,apache,apache) %{_var}/cache/php-eaccelerator/
+# We need this hack, as otherwise rpm resets ownership upon package upgrade
+#attr(0750,apache,apache) %{_var}/cache/php-eaccelerator/
+#attr(0750,root,root) %verify(not user group) %{_var}/cache/php-eaccelerator/
+%ghost %{_var}/cache/php-eaccelerator/
 
 
 %changelog
+* Wed Dec 24 2008 Matthias Saou <http://freshrpms.net/> 1:0.9.5.3-2
+- Update default cache dir to be ghosted and take care of creating it and
+  changing default ownership in the %%post scriplet (fixes #443407).
+
 * Mon Dec 22 2008 Matthias Saou <http://freshrpms.net/> 1:0.9.5.3-1
 - Update to 0.9.5.3.
 - Include daily cleanup cron job (#470460).




More information about the fedora-extras-commits mailing list