packages: apache/apache.spec - triggers to ease upgrade to 2.4 (handles sim...

adamg adamg at pld-linux.org
Sun Feb 26 16:17:42 CET 2012


Author: adamg                        Date: Sun Feb 26 15:17:42 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- triggers to ease upgrade to 2.4 (handles simple configuration properly)

---- Files affected:
packages/apache:
   apache.spec (1.662 -> 1.663) 

---- Diffs:

================================================================
Index: packages/apache/apache.spec
diff -u packages/apache/apache.spec:1.662 packages/apache/apache.spec:1.663
--- packages/apache/apache.spec:1.662	Sun Feb 26 14:33:35 2012
+++ packages/apache/apache.spec	Sun Feb 26 16:17:37 2012
@@ -2412,6 +2412,16 @@
 	install -d /etc/httpd
 	ln -s conf.d /etc/httpd/httpd.conf
 fi
+if [ -f /etc/sysconfig/httpd ]; then
+        MPM=$(grep HTTPD_MPM /etc/sysconfig/httpd |sed 's,HTTPD_MPM=,,;s,",,g')
+        if [ -n $MPM ]; then
+                echo "LoadModule mpm_${MPM}_module                modules/mod_mpm_${MPM}.so" > /etc/httpd/conf.d/10_mpm.conf.rpmnew
+                cat /etc/httpd/conf.d/10_mpm.conf >> /etc/httpd/conf.d/10_mpm.conf.rpmnew
+                mv /etc/httpd/conf.d/10_mpm.conf.rpmnew /etc/httpd/conf.d/10_mpm.conf
+                sed -i -e 's,HTTPD_MPM.*,,g' /etc/sysconfig/httpd
+        fi
+fi
+
 exit 0
 
 %post base
@@ -2527,6 +2537,18 @@
 fi
 %systemd_trigger httpd.service
 
+%triggerpostun base -- %{name} < 2.4.0
+cp -f /etc/httpd/apache.conf{,.rpmsave}
+sed -i -e '
+	/^DefaultType.*/s,.*,,
+	/^Include /s,^Include ,IncludeOptional ,
+	/^NameVirtualHost.*/s,.*,,
+	/^User/s,^,LoadModule unixd_module modules/mod_unixd.so\n,
+' /etc/httpd/apache.conf
+sed -i -e '
+	s,^LockFile /var/run/httpd/accept.lock,Mutex file:/var/run/httpd/,g
+' /etc/httpd/conf.d/10_mpm.conf
+
 %triggerpostun mod_ssl -- %{name}-mod_ssl < 1:2.2.0-3.1
 cp -f /etc/httpd/conf.d/40_mod_ssl.conf{,.rpmsave}
 sed -i -e '
@@ -2534,6 +2556,13 @@
 	s,/var/cache/apache,/var/cache/httpd,g
 ' /etc/httpd/conf.d/40_mod_ssl.conf
 
+%triggerpostun mod_ssl -- %{name}-mod_ssl < 1:2.4.0
+cp -f /etc/httpd/conf.d/40_mod_ssl.conf{,.rpmsave}
+sed -i -e '
+	/^SSLMutex/s,^,#,
+	/^NameVirtualHost.*/s,.*,,
+' /etc/httpd/conf.d/40_mod_ssl.conf
+
 %posttrans base
 # restore lock which we disabled in pretrans
 mv -f /var/lock/subsys/httpd{.disabled,} 2>/dev/null
@@ -3306,6 +3335,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.663  2012/02/26 15:17:37  adamg
+- triggers to ease upgrade to 2.4 (handles simple configuration properly)
+
 Revision 1.662  2012/02/26 13:33:35  adamg
 - peruser mpm dropped almost 3 years ago
 - event mpm no longer experimental, no need to bcond it
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/apache/apache.spec?r1=1.662&r2=1.663&f=u



More information about the pld-cvs-commit mailing list