SPECS: php4.spec - merged from DEVEL: - enable config-file-scan-...

glen glen at pld-linux.org
Wed Jul 20 12:05:30 CEST 2005


Author: glen                         Date: Wed Jul 20 10:05:30 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- merged from DEVEL:
  - enable config-file-scan-dir, use conf.d for php-scan dir
  - use %service macro to restart webserver (optionally disable-able)
  - FIXED php-SAPI.ini reading for apache2 (trigger included). it NEVER worked!
  - removed obsolete TODO, TODO corrections

---- Files affected:
SPECS:
   php4.spec (1.453 -> 1.454) 

---- Diffs:

================================================================
Index: SPECS/php4.spec
diff -u SPECS/php4.spec:1.453 SPECS/php4.spec:1.454
--- SPECS/php4.spec:1.453	Wed Jul 13 13:28:19 2005
+++ SPECS/php4.spec	Wed Jul 20 12:05:25 2005
@@ -3,11 +3,6 @@
 # TODO:
 # - make additional headers added by mail patch configurable
 # - /var/run/php group not owned
-# TODO both apx build:
-# - what to do with main package?
-# - Obsoletes apache-mod_php and phpfi are whose? apache2 apache1 module? both? neither?
-# - how to ensure proper sapi upgrade? (look apache1-mod_php4 preable)
-# - should the apache-mod_php4 provide php{,4} package?
 #
 # Conditional build:
 %bcond_with	db3		# use db3 packages instead of db (4.x) for Berkeley DB support
@@ -76,7 +71,7 @@
 Summary(uk):	PHP ÷ĹŇÓŚ§ 4 - ÍĎ×Á ĐŇĹĐŇĎĂĹÓŐ×ÁÎÎŃ HTML-ĆÁĘĚŚ×, ×ÉËĎÎŐ×ÁÎÁ ÎÁ ÓĹŇ×ĹŇŚ
 Name:		php4
 Version:	4.4.0
-Release:	2%{?with_hardening:hardened}
+Release:	2.23%{?with_hardening:hardened}
 Epoch:		3
 Group:		Libraries
 License:	PHP
@@ -190,7 +185,7 @@
 BuildRequires:	readline-devel
 %{?with_recode:BuildRequires:	recode-devel >= 3.5d-3}
 BuildRequires:	rpm-php-pearprov >= 4.0.2-100
-BuildRequires:	rpmbuild(macros) >= 1.213
+BuildRequires:	rpmbuild(macros) >= 1.230
 %{?with_xslt:BuildRequires:	sablotron-devel >= 0.96}
 BuildRequires:	sed >= 4.0
 BuildRequires:	t1lib-devel
@@ -1704,6 +1699,7 @@
 	--cache-file=config.cache \
 	%{?with_zts:--enable-experimental-zts} \
 	--with-config-file-path=%{_sysconfdir} \
+	--with-config-file-scan-dir=%{_sysconfdir}/conf.d \
 	--with-exec-dir=%{_bindir} \
 	--%{!?debug:dis}%{?debug:en}able-debug \
 	--enable-shared \
@@ -1890,9 +1886,11 @@
 %{?with_java:install ext/java/php_java.jar $RPM_BUILD_ROOT%{extensionsdir}}
 
 install php.ini	$RPM_BUILD_ROOT%{_sysconfdir}/php.ini
-for i in %{SOURCE5} %{SOURCE6} %{SOURCE7} %{SOURCE8}; do
-	install $i $RPM_BUILD_ROOT%{_sysconfdir}/$(basename $i|sed -e "s at php4@php at g")
-done
+install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
+install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi.ini
+install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache.ini
+install %{SOURCE7} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache2handler.ini
+install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
 
 install %{SOURCE2} php.gif $RPM_BUILD_ROOT/home/services/httpd/icons
 install %{SOURCE2} php.gif $RPM_BUILD_ROOT/home/services/apache/icons
@@ -1903,333 +1901,311 @@
 
 cp -f Zend/LICENSE{,.Zend}
 
+# Generate stub .ini files for each subpackage
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
+for so in modules/*.so; do
+	mod=$(basename $so .so)
+	cat > $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/${mod}.ini <<EOF
+; Enable ${mod} extension module
+extension=${mod}.so
+EOF
+done
+
+# Not in all SAPI, so don't need the .ini fragments.
+rm -f $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/{ncurses,pcntl,readline}.ini
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post -n apache1-mod_php4
-if [ -f /var/lock/subsys/apache ]; then
-	/etc/rc.d/init.d/apache restart 1>&2
-fi
+%service apache restart
 
 %postun -n apache1-mod_php4
 if [ "$1" = "0" ]; then
-	if [ -f /var/lock/subsys/apache ]; then
-		/etc/rc.d/init.d/apache restart 1>&2
-	fi
+	%service -q apache restart
 fi
 
 %post -n apache-mod_php4
-if [ -f /var/lock/subsys/httpd ]; then
-	/etc/rc.d/init.d/httpd restart 1>&2
-fi
+%service httpd restart
 
 %postun -n apache-mod_php4
 if [ "$1" = "0" ]; then
-	if [ -f /var/lock/subsys/httpd ]; then
-		/etc/rc.d/init.d/httpd restart 1>&2
-	fi
+	%service -q httpd restart
 fi
 
 %post	common -p /sbin/ldconfig
 %postun	common -p /sbin/ldconfig
 
+%if %{with apache2}
+%triggerpostun -n apache-mod_php4 -- apache-mod_php4 < 3:4.4.0-2.16, php4 < 3:4.3.11-4.16
+# for fixed php-SAPI.ini, the poor php-apache.ini was never read for apache2
+if [ -f %{_sysconfdir}/php-apache.ini.rpmsave ]; then
+	cp -f %{_sysconfdir}/php-apache2handler.ini{,.rpmnew}
+	mv -f %{_sysconfdir}/php-apache.ini.rpmsave %{_sysconfdir}/php-apache2handler.ini
+fi
+%endif
+
 %post bcmath
-%{_sbindir}/php4-module-install install bcmath %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun bcmath
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove bcmath %{_sysconfdir}/php.ini
-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
 
 %post bzip2
-%{_sbindir}/php4-module-install install bz2 %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun bzip2
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove bz2 %{_sysconfdir}/php.ini
-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
 
 %post calendar
-%{_sbindir}/php4-module-install install calendar %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun calendar
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove calendar %{_sysconfdir}/php.ini
-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
 
 %post cpdf
-%{_sbindir}/php4-module-install install cpdf %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun cpdf
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove cpdf %{_sysconfdir}/php.ini
-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
 
 %post crack
-%{_sbindir}/php4-module-install install crack %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun crack
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove crack %{_sysconfdir}/php.ini
-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
 
 %post ctype
-%{_sbindir}/php4-module-install install ctype %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun ctype
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ctype %{_sysconfdir}/php.ini
-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
 
 %post curl
-%{_sbindir}/php4-module-install install curl %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun curl
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove curl %{_sysconfdir}/php.ini
-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
 
 %post db
-%{_sbindir}/php4-module-install install db %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun db
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove db %{_sysconfdir}/php.ini
-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
 
 %post dba
-%{_sbindir}/php4-module-install install dba %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun dba
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove dba %{_sysconfdir}/php.ini
-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
 
 %post dbase
-%{_sbindir}/php4-module-install install dbase %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun dbase
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove dbase %{_sysconfdir}/php.ini
-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
 
 %post dbx
-%{_sbindir}/php4-module-install install dbx %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun dbx
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove dbx %{_sysconfdir}/php.ini
-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
 
 %post dio
-%{_sbindir}/php4-module-install install dio %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun dio
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove dio %{_sysconfdir}/php.ini
-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
 
 %post domxml
-%{_sbindir}/php4-module-install install domxml %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun domxml
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove domxml %{_sysconfdir}/php.ini
-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
 
 %post exif
-%{_sbindir}/php4-module-install install exif %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun exif
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove exif %{_sysconfdir}/php.ini
-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
 
 %post fdf
-%{_sbindir}/php4-module-install install fdf %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun fdf
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove fdf %{_sysconfdir}/php.ini
-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
 
 %post filepro
-%{_sbindir}/php4-module-install install filepro %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun filepro
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove filepro %{_sysconfdir}/php.ini
-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
 
 %post fribidi
-%{_sbindir}/php4-module-install install fribidi %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun fribidi
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove fribidi %{_sysconfdir}/php.ini
-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
 
 %post ftp
-%{_sbindir}/php4-module-install install ftp %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun ftp
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ftp %{_sysconfdir}/php.ini
-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
 
 %post gd
-%{_sbindir}/php4-module-install install gd %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun gd
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove gd %{_sysconfdir}/php.ini
-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
 
 %post gettext
-%{_sbindir}/php4-module-install install gettext %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun gettext
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove gettext %{_sysconfdir}/php.ini
-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
 
 %post gmp
-%{_sbindir}/php4-module-install install gmp %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun gmp
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove gmp %{_sysconfdir}/php.ini
-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
 
 %post hyperwave
-%{_sbindir}/php4-module-install install hyperwave %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun hyperwave
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove hyperwave %{_sysconfdir}/php.ini
-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
 
 %post iconv
-%{_sbindir}/php4-module-install install iconv %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun iconv
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove iconv %{_sysconfdir}/php.ini
-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
 
 %post imap
-%{_sbindir}/php4-module-install install imap %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun imap
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove imap %{_sysconfdir}/php.ini
-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
 
 %post interbase
-%{_sbindir}/php4-module-install install interbase %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun interbase
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove interbase %{_sysconfdir}/php.ini
-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
 
 %post java
-%{_sbindir}/php4-module-install install java %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun java
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove java %{_sysconfdir}/php.ini
-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
 
 %post ldap
-%{_sbindir}/php4-module-install install ldap %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun ldap
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ldap %{_sysconfdir}/php.ini
-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
 
 %post mbstring
-%{_sbindir}/php4-module-install install mbstring %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun mbstring
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mbstring %{_sysconfdir}/php.ini
-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
 
 %post mcal
-%{_sbindir}/php4-module-install install mcal %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun mcal
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mcal %{_sysconfdir}/php.ini
-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
 
 %post mcrypt
-%{_sbindir}/php4-module-install install mcrypt %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun mcrypt
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mcrypt %{_sysconfdir}/php.ini
-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
 
 %post mhash
-%{_sbindir}/php4-module-install install mhash %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun mhash
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mhash %{_sysconfdir}/php.ini
-fi
+%triggerun mhash -- %{name}-mhash < 3:4.4.0-2.1
+[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mhash %{_sysconfdir}/php.ini
 
 %post mime_magic
-%{_sbindir}/php4-module-install install mime_magic %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun mime_magic
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mime_magic %{_sysconfdir}/php.ini
-fi
+%triggerun mime_magic -- %{name}-mime_magic < 3:4.4.0-2.1
+[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mime_magic %{_sysconfdir}/php.ini
 
 %post ming
-%{_sbindir}/php4-module-install install ming %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun ming
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ming %{_sysconfdir}/php.ini
-fi
+%triggerun ming -- %{name}-ming < 3:4.4.0-2.1
+[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ming %{_sysconfdir}/php.ini
 
 %post mnogosearch
-%{_sbindir}/php4-module-install install mnogosearch %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun mnogosearch
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mnogosearch %{_sysconfdir}/php.ini
-fi
+%triggerun mnogosearch -- %{name}-mnogosearch < 3:4.4.0-2.1
+[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mnogosearch %{_sysconfdir}/php.ini
 
 %post msession
-%{_sbindir}/php4-module-install install msession %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun msession
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove msession %{_sysconfdir}/php.ini
-fi
+%triggerun msession -- %{name}-msession < 3:4.4.0-2.1
+[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove msession %{_sysconfdir}/php.ini
 
 %post mssql
-%{_sbindir}/php4-module-install install mssql %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun mssql
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mssql %{_sysconfdir}/php.ini
-fi
+%triggerun mssql -- %{name}-mssql < 3:4.4.0-2.1
+[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mssql %{_sysconfdir}/php.ini
 
 %post mysql
-%{_sbindir}/php4-module-install install mysql %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun mysql
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mysql %{_sysconfdir}/php.ini
-fi
+%triggerun mysql -- %{name}-mysql < 3:4.4.0-2.1
+[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove mysql %{_sysconfdir}/php.ini
 
 %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
@@ -2237,7 +2213,7 @@
 	%{_sbindir}/php4-module-install install ncurses %{_sysconfdir}/php-cli.ini
 fi
 
-%preun ncurses
+%preun ncurses 
 if [ "$1" = "0" ]; then
 	if [ -f %{_sysconfdir}/php-cgi.ini ]; then
 		[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove ncurses %{_sysconfdir}/php-cgi.ini
@@ -2248,54 +2224,50 @@
 fi
 
 %post oci8
-%{_sbindir}/php4-module-install install oci8 %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun oci8
-if [ "$1" = "0" ]; then
-	[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove oci8 %{_sysconfdir}/php.ini
-fi
+%triggerun oci8 -- %{name}-oci8 < 3:4.4.0-2.1
+[ ! -x %{_sbindir}/php4-module-install ] || %{_sbindir}/php4-module-install remove oci8 %{_sysconfdir}/php.ini
 
 %post odbc
-%{_sbindir}/php4-module-install install odbc %{_sysconfdir}/php.ini
+[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service apache restart
+[ ! -f /etc/httpd/httpd.conf/??_mod_php4.conf ] || %service httpd restart
 
-%preun odbc
<<Diff was trimmed, longer than 597 lines>>

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




More information about the pld-cvs-commit mailing list