SPECS: template-webapp.spec - and triggers evolve... more complicated

glen glen at pld-linux.org
Wed Dec 7 23:03:24 CET 2005


Author: glen                         Date: Wed Dec  7 22:03:24 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- and triggers evolve... more complicated

---- Files affected:
SPECS:
   template-webapp.spec (1.32 -> 1.33) 

---- Diffs:

================================================================
Index: SPECS/template-webapp.spec
diff -u SPECS/template-webapp.spec:1.32 SPECS/template-webapp.spec:1.33
--- SPECS/template-webapp.spec:1.32	Mon Dec  5 12:30:41 2005
+++ SPECS/template-webapp.spec	Wed Dec  7 23:03:18 2005
@@ -85,6 +85,7 @@
 # nuke very-old config location (this mostly for Ra)
 if [ -f /etc/httpd/httpd.conf ]; then
 	sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf
+	/usr/sbin/webapp register httpd %{_webapp}
 	httpd_reload=1
 fi
 
@@ -92,6 +93,7 @@
 if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
 	cp -f %{_sysconfdir}/httpd.conf{,.rpmnew}
 	mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
+	/usr/sbin/webapp register httpd %{_webapp}
 	httpd_reload=1
 fi
 
@@ -123,30 +125,28 @@
 	rm -f /etc/apache-%{name}.conf.rpmsave
 fi
 
-# place new config location, as trigger puts config only on first install, do it here.
-# apache1
-if [ -d /etc/apache/webapps.d ]; then
-	/usr/sbin/webapp register apache %{_webapp}
-	apache_reload=1
-fi
-# apache2
-if [ -d /etc/httpd/webapps.d ]; then
-	/usr/sbin/webapp register httpd %{_webapp}
-	httpd_reload=1
-fi
-# or if we're migrating from %apache_install macros we can depend on symlinks in conf.d/http.conf dirs
-# place new config location, as trigger puts config only on first install, do it here.
-# apache1
-if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
-	rm -f /etc/apache/conf.d/99_%{name}.conf
-	/usr/sbin/webapp register apache %{_webapp}
-	apache_reload=1
-fi
-# apache2
-if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
-	rm -f /etc/httpd/httpd.conf/99_%{name}.conf
-	/usr/sbin/webapp register httpd %{_webapp}
-	httpd_reload=1
+# migrating from earlier apache-config?
+if [ -L /etc/apache/conf.d/99_%{name}.conf ] || [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
+	if [ -L /etc/apache/conf.d/99_%{name}.conf ]; then
+		rm -f /etc/apache/conf.d/99_%{name}.conf
+		/usr/sbin/webapp register apache %{_webapp}
+		apache_reload=1
+	fi
+	if [ -L /etc/httpd/httpd.conf/99_%{name}.conf ]; then
+		rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+		/usr/sbin/webapp register httpd %{_webapp}
+		httpd_reload=1
+	fi
+else
+	# no earlier registration. assume migration from Ra
+	if [ -d /etc/apache/webapps.d ]; then
+		/usr/sbin/webapp register apache %{_webapp}
+		apache_reload=1
+	fi
+	if [ -d /etc/httpd/webapps.d ]; then
+		/usr/sbin/webapp register httpd %{_webapp}
+		httpd_reload=1
+	fi
 fi
 
 if [ "$httpd_reload" ]; then
@@ -178,6 +178,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.33  2005/12/07 22:03:18  glen
+- and triggers evolve... more complicated
+
 Revision 1.32  2005/12/05 11:30:41  glen
 - make template for common cases where sysconfdir is in webapps
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/template-webapp.spec?r1=1.32&r2=1.33&f=u




More information about the pld-cvs-commit mailing list