SPECS: php4.spec - minimising apache restarts to 1 on whole php* u...

glen glen at pld-linux.org
Fri Aug 12 22:13:19 CEST 2005


Author: glen                         Date: Fri Aug 12 20:13:19 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- minimising apache restarts to 1 on whole php* upgrade

---- Files affected:
SPECS:
   php4.spec (1.463 -> 1.464) 

---- Diffs:

================================================================
Index: SPECS/php4.spec
diff -u SPECS/php4.spec:1.463 SPECS/php4.spec:1.464
--- SPECS/php4.spec:1.463	Fri Aug 12 20:57:00 2005
+++ SPECS/php4.spec	Fri Aug 12 22:13:13 2005
@@ -74,7 +74,7 @@
 Summary(uk):	PHP ÷ĹŇÓŚ§ 4 - ÍĎ×Á ĐŇĹĐŇĎĂĹÓŐ×ÁÎÎŃ HTML-ĆÁĘĚŚ×, ×ÉËĎÎŐ×ÁÎÁ ÎÁ ÓĹŇ×ĹŇŚ
 Name:		php4
 Version:	4.4.0
-Release:	4.1%{?with_hardening:hardened}
+Release:	4.34%{?with_hardening:hardened}
 Epoch:		3
 Group:		Libraries
 License:	PHP
@@ -121,7 +121,7 @@
 Patch28:	%{name}-sybase-fix.patch
 Patch29:	%{name}-lib64.patch
 Patch30:	%{name}-mnogosearch-fix.patch
-Patch31:	%{name}-stupidapache_version.patch 
+Patch31:	%{name}-stupidapache_version.patch
 Patch32:	%{name}-gd_imagerotate_enable.patch
 Patch33:	%{name}-uint32_t.patch
 Patch34:	%{name}-install_gd_headers.patch
@@ -1902,8 +1902,22 @@
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+# minimizing apache restarts logics:
+#
+# 1. we restart webserver after extension install only:
+# 1.1 if it's first install (post: $1 = 1)
+# 1.2 or uninstall of extension (postun: $1 == 0)
+# 2. the upgrades are handled by common package:
+# 2.1 webserver is restarted only if common package was upgraded (postun: $1 = 1)
+#
+# note that this creates "delay" when webserver is restarted, ie the
+# actual restart is done by *previous* version of php-common package
+# (the one being just postun'ed).
+
 %post -n apache1-mod_php4
-%service apache restart
+if [ "$1" = "1" ]; then
+	%service apache restart
+fi
 
 %postun -n apache1-mod_php4
 if [ "$1" = "0" ]; then
@@ -1911,15 +1925,35 @@
 fi
 
 %post -n apache-mod_php4
-%service httpd restart
+if [ "$1" = "1" ]; then
+	%service httpd restart
+fi
 
 %postun -n apache-mod_php4
 if [ "$1" = "0" ]; then
 	%service -q httpd restart
 fi
 
+# so tired of typing... so decided to create macros
+# macro called at extension post scriptlet
+%define	extension_post \
+if [ "$1" = "1" ]; then \
+	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart \
+	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart \
+fi
+
+# macro called at extension postun scriptlet
+%define	extension_postun \
+if [ "$1" = "0" ]; then \
+	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart \
+	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart \
+fi
+
 %post	common -p /sbin/ldconfig
-%postun	common -p /sbin/ldconfig
+%postun	common
+/sbin/ldconfig
+# extension_post here is all correct.
+%extension_post
 
 %if %{with apache2}
 %triggerpostun -- php4 < 3:4.3.11-4.16
@@ -1937,914 +1971,651 @@
 %endif
 
 %post bcmath
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun bcmath
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun bcmath -- %{name}-bcmath < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove bcmath %{_sysconfdir}/php.ini
+%extension_postun
 
 %post bzip2
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun bzip2
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun bzip2 -- %{name}-bzip2 < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove bz2 %{_sysconfdir}/php.ini
+%extension_postun
 
 %post calendar
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun calendar
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun calendar -- %{name}-calendar < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove calendar %{_sysconfdir}/php.ini
+%extension_postun
 
 %post cpdf
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun cpdf
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun cpdf -- %{name}-cpdf < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove cpdf %{_sysconfdir}/php.ini
+%extension_postun
 
 %post crack
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun crack
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun crack -- %{name}-crack < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove crack %{_sysconfdir}/php.ini
+%extension_postun
 
 %post ctype
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun ctype
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun ctype -- %{name}-ctype < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ctype %{_sysconfdir}/php.ini
+%extension_postun
 
 %post curl
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun curl
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun curl -- %{name}-curl < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove curl %{_sysconfdir}/php.ini
+%extension_postun
 
 %post db
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun db
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun db -- %{name}-db < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove db %{_sysconfdir}/php.ini
+%extension_postun
 
 %post dba
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun dba
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun dba -- %{name}-dba < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove dba %{_sysconfdir}/php.ini
+%extension_postun
 
 %post dbase
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun dbase
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun dbase -- %{name}-dbase < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove dbase %{_sysconfdir}/php.ini
+%extension_postun
 
 %post dbx
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun dbx
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun dbx -- %{name}-dbx < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove dbx %{_sysconfdir}/php.ini
+%extension_postun
 
 %post dio
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun dio
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun dio -- %{name}-dio < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove dio %{_sysconfdir}/php.ini
+%extension_postun
 
 %post domxml
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun domxml
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun domxml -- %{name}-domxml < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove domxml %{_sysconfdir}/php.ini
+%extension_postun
 
 %post exif
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun exif
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun exif -- %{name}-exif < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove exif %{_sysconfdir}/php.ini
+%extension_postun
 
 %post fdf
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun fdf
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun fdf -- %{name}-fdf < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove fdf %{_sysconfdir}/php.ini
+%extension_postun
 
 %post filepro
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun filepro
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun filepro -- %{name}-filepro < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove filepro %{_sysconfdir}/php.ini
+%extension_postun
 
 %post fribidi
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun fribidi
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun fribidi -- %{name}-fribidi < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove fribidi %{_sysconfdir}/php.ini
+%extension_postun
 
 %post ftp
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun ftp
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun ftp -- %{name}-ftp < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ftp %{_sysconfdir}/php.ini
+%extension_postun
 
 %post gd
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun gd
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun gd -- %{name}-gd < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove gd %{_sysconfdir}/php.ini
+%extension_postun
 
 %post gettext
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun gettext
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun gettext -- %{name}-gettext < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove gettext %{_sysconfdir}/php.ini
+%extension_postun
 
 %post gmp
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun gmp
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun gmp -- %{name}-gmp < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove gmp %{_sysconfdir}/php.ini
+%extension_postun
 
 %post hyperwave
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun hyperwave
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun hyperwave -- %{name}-hyperwave < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove hyperwave %{_sysconfdir}/php.ini
+%extension_postun
 
 %post iconv
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun iconv
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun iconv -- %{name}-iconv < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove iconv %{_sysconfdir}/php.ini
+%extension_postun
 
 %post imap
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun imap
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun imap -- %{name}-imap < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove imap %{_sysconfdir}/php.ini
+%extension_postun
 
 %post interbase
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun interbase
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun interbase -- %{name}-interbase < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove interbase %{_sysconfdir}/php.ini
+%extension_postun
 
 %post java
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun java
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun java -- %{name}-java < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove java %{_sysconfdir}/php.ini
+%extension_postun
 
 %post ldap
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun ldap
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun ldap -- %{name}-ldap < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ldap %{_sysconfdir}/php.ini
+%extension_postun
 
 %post mbstring
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun mbstring
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun mbstring -- %{name}-mbstring < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mbstring %{_sysconfdir}/php.ini
+%extension_postun
 
 %post mcal
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun mcal
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun mcal -- %{name}-mcal < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mcal %{_sysconfdir}/php.ini
+%extension_postun
 
 %post mcrypt
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun mcrypt
-if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
-fi
-
-%triggerun mcrypt -- %{name}-mcrypt < 3:4.4.0-2.1
-[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mcrypt %{_sysconfdir}/php.ini
+%extension_postun
 
 %post mhash
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+%extension_post
 
 %postun mhash
+%extension_postun
+
+%post mime_magic
+%extension_post
+
+%postun mime_magic
+%extension_postun
+
+%post ming
+%extension_post
+
+%postun ming
+%extension_postun
+
+%post mnogosearch
+%extension_post
+
+%postun mnogosearch
+%extension_postun
+
+%post msession
+%extension_post
+
+%postun msession
+%extension_postun
+
+%post mssql
+%extension_post
+
+%postun mssql
+%extension_postun
+
+%post mysql
+%extension_post
+
+%postun mysql
+%extension_postun
+
+%post ncurses
+# NOTE: only for cli/cgi
+if [ -f %{_sysconfdir}/php-cgi.ini ]; then
+	%{_sbindir}/php4-module-install install ncurses %{_sysconfdir}/php-cgi.ini
+fi
+if [ -f %{_sysconfdir}/php-cli.ini ]; then
+	%{_sbindir}/php4-module-install install ncurses %{_sysconfdir}/php-cli.ini
+fi
+
+%preun ncurses
 if [ "$1" = "0" ]; then
-	[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
-	[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
+	if [ -f %{_sysconfdir}/php-cgi.ini ]; then
+		[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ncurses %{_sysconfdir}/php-cgi.ini
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/php4.spec?r1=1.463&r2=1.464&f=u




More information about the pld-cvs-commit mailing list