SPECS (DEVEL): horde.spec - use apache config triggers

glen glen at pld-linux.org
Sun Jul 31 12:40:50 CEST 2005


Author: glen                         Date: Sun Jul 31 10:40:50 2005 GMT
Module: SPECS                         Tag: DEVEL
---- Log message:
- use apache config triggers

---- Files affected:
SPECS:
   horde.spec (1.95.2.5 -> 1.95.2.6) 

---- Diffs:

================================================================
Index: SPECS/horde.spec
diff -u SPECS/horde.spec:1.95.2.5 SPECS/horde.spec:1.95.2.6
--- SPECS/horde.spec:1.95.2.5	Sun Jul 31 12:29:13 2005
+++ SPECS/horde.spec	Sun Jul 31 12:40:45 2005
@@ -16,7 +16,7 @@
 Name:		horde
 Version:	3.0.5
 %define	_rc	rc2
-Release:	0.%{_rc}.1
+Release:	0.%{_rc}.2
 License:	LGPL
 Vendor:		The Horde Project
 Group:		Applications/WWW
@@ -29,7 +29,7 @@
 Patch3:		%{name}-blank-admins.patch
 Patch4:		%{name}-config-xml.patch
 URL:		http://www.horde.org/
-BuildRequires:	rpmbuild(macros) >= 1.177
+BuildRequires:	rpmbuild(macros) >= 1.226
 BuildRequires:	rpm-php-pearprov >= 4.0.2-98
 Requires(triggerpostun):	grep
 Requires(triggerpostun):	sed >= 4.0
@@ -61,8 +61,6 @@
 %define		hordedir	/usr/share/horde
 %define		_sysconfdir	/etc/horde.org
 %define		_appdir		%{hordedir}
-%define		_apache1dir	/etc/apache
-%define		_apache2dir	/etc/httpd
 %define		schemadir	/usr/share/openldap/schema
 
 %description
@@ -164,21 +162,6 @@
 	install /dev/null -o root -g http -m660 %{_sysconfdir}/%{name}/conf.php.bak
 fi
 
-# apache1
-if [ -d %{_apache1dir}/conf.d ]; then
-	ln -sf %{_sysconfdir}/apache-%{name}.conf %{_apache1dir}/conf.d/99_%{name}.conf
-	if [ -f /var/lock/subsys/apache ]; then
-		/etc/rc.d/init.d/apache restart 1>&2
-	fi
-fi
-# apache2
-if [ -d %{_apache2dir}/httpd.conf ]; then
-	ln -sf %{_sysconfdir}/apache-%{name}.conf %{_apache2dir}/httpd.conf/99_%{name}.conf
-	if [ -f /var/lock/subsys/httpd ]; then
-		/etc/rc.d/init.d/httpd restart 1>&2
-	fi
-fi
-
 if [ "$1" = 1 ]; then
 %banner %{name} -e <<EOF
 
@@ -197,31 +180,13 @@
 To configure your openldap server to use horde schema, install
 openldap-schema-horde package.
 
-NOTE: You don't need SQL database if You use LDAP for authorization.
+NOTE: You don't need SQL database for Auhtorization if You use LDAP for authorization.
 
 EOF
 # '
 
 fi
 
-%postun
-if [ "$1" = "0" ]; then
-	# apache1
-	if [ -d %{_apache1dir}/conf.d ]; then
-		rm -f %{_apache1dir}/conf.d/99_%{name}.conf
-		if [ -f /var/lock/subsys/apache ]; then
-			/etc/rc.d/init.d/apache restart 1>&2
-		fi
-	fi
-	# apache2
-	if [ -d %{_apache2dir}/httpd.conf ]; then
-		rm -f %{_apache2dir}/httpd.conf/99_%{name}.conf
-		if [ -f /var/lock/subsys/httpd ]; then
-			/etc/rc.d/init.d/httpd restart 1>&2
-		fi
-	fi
-fi
-
 %post -n openldap-schema-horde
 if ! grep -q %{schemadir}/horde.schema /etc/openldap/slapd.conf; then
 	sed -i -e '
@@ -249,6 +214,18 @@
 	fi
 fi
 
+%triggerin -- apache1 >= 1.3.33-2
+%apache_config_install -v 1 -c %{_sysconfdir}/apache-%{name}.conf
+
+%triggerun -- apache1 >= 1.3.33-2
+%apache_config_uninstall -v 1
+
+%triggerin -- apache >= 2.0.0
+%apache_config_install -v 2 -c %{_sysconfdir}/apache-%{name}.conf
+
+%triggerun -- apache >= 2.0.0
+%apache_config_uninstall -v 2
+
 %triggerpostun -- horde <= 2.2.7-2
 for i in horde.php html.php lang.php mime_drivers.php mime_mapping.php motd.php prefs.php registry.php; do
 	if [ -f /home/services/httpd/html/horde/config/$i.rpmsave ]; then
@@ -272,14 +249,14 @@
 	fi
 fi
 
-if [ -f %{_apache1dir}/horde.conf.rpmsave ]; then
+if [ -f /etc/apache/horde.conf.rpmsave ]; then
 	cp -f %{_sysconfdir}/apache-%{name}.conf{,.rpmnew}
-	mv -f %{_apache1dir}/horde.conf.rpmsave %{_sysconfdir}/apache-%{name}.conf
+	mv -f /etc/apache/horde.conf.rpmsave %{_sysconfdir}/apache-%{name}.conf
 fi
 
-if [ -f %{_apache2dir}/horde.conf.rpmsave ]; then
+if [ -f /etc/httpd/horde.conf.rpmsave ]; then
 	cp -f %{_sysconfdir}/apache-%{name}.conf{,.rpmnew}
-	mv -f %{_apache2dir}/horde.conf.rpmsave %{_sysconfdir}/apache-%{name}.conf
+	mv -f /etc/httpd/horde.conf.rpmsave %{_sysconfdir}/apache-%{name}.conf
 fi
 
 # unified location
@@ -289,11 +266,11 @@
 fi
 
 if [ -f /var/lock/subsys/apache ]; then
-	/etc/rc.d/init.d/apache restart 1>&2
+	/etc/rc.d/init.d/apache reload 1>&2
 fi
 
 if [ -f /var/lock/subsys/httpd ]; then
-	/etc/rc.d/init.d/httpd restart 1>&2
+	/etc/rc.d/init.d/httpd reload 1>&2
 fi
 
 %files
@@ -334,6 +311,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.95.2.6  2005/07/31 10:40:45  glen
+- use apache config triggers
+
 Revision 1.95.2.5  2005/07/31 10:29:13  glen
 - patch conf.xml, rather sed-ing
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/horde.spec?r1=1.95.2.5&r2=1.95.2.6&f=u




More information about the pld-cvs-commit mailing list