SPECS: netmrg.spec - added trigger for upgrade (omg, this is awful) - compl...

gotar gotar at pld-linux.org
Tue Sep 23 21:52:59 CEST 2008


Author: gotar                        Date: Tue Sep 23 19:52:59 2008 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- added trigger for upgrade (omg, this is awful)
- complemented previous commit log

---- Files affected:
SPECS:
   netmrg.spec (1.22 -> 1.23) 

---- Diffs:

================================================================
Index: SPECS/netmrg.spec
diff -u SPECS/netmrg.spec:1.22 SPECS/netmrg.spec:1.23
--- SPECS/netmrg.spec:1.22	Tue Sep 23 21:08:19 2008
+++ SPECS/netmrg.spec	Tue Sep 23 21:52:54 2008
@@ -101,6 +101,37 @@
 %triggerun -- apache < 2.2.0, apache-base
 %webapp_unregister httpd %{_webapp}
 
+%triggerpostun -- netmrg < 0.20
+# rescue app config from old location (with old paths, but good MySQL password)
+if [ -f /etc/netmrg.xml.rpmsave ]; then
+	mv -f %{_sysconfdir}/netmrg.xml{,.rpmnew}
+	mv -f /etc/netmrg.xml.rpmsave %{_sysconfdir}/netmrg.xml
+fi
+
+# 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
+	httpd_reload=1
+fi
+
+# migrate from httpd (apache2) config dir
+if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then
+	mv -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+	mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf
+	httpd_reload=1
+fi
+if [ -f /etc/httpd/httpd.conf/99_%{name}.conf ]; then
+	mv -f %{_sysconfdir}/httpd.conf{,.rpmnew}
+	mv -f /etc/httpd/httpd.conf/99_%{name}.conf %{_sysconfdir}/httpd.conf
+fi
+
+if [ -d /etc/httpd/webapps.d ]; then
+	/usr/sbin/webapp register httpd %{_webapp}
+	httpd_reload=1
+fi
+
+[ -n "$httpd_reload" ] && %service -q httpd reload
+
 %post
 %service crond restart
 
@@ -141,7 +172,14 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.23  2008/09/23 19:52:54  gotar
+- added trigger for upgrade (omg, this is awful)
+- complemented previous commit log
+
 Revision 1.22  2008/09/23 19:08:19  gotar
+- upgraded to 0.20,
+- added missing BRs and TODOs, use %%banner
+- better /var/*/** permissions
 - repackaged files (FHS compliance, PLD policy)
 - switched to webapps
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SPECS/netmrg.spec?r1=1.22&r2=1.23&f=u



More information about the pld-cvs-commit mailing list