[packages/apache/feat/conf-modules: 18/18] trigger to relocate configs

glen glen at pld-linux.org
Tue Apr 30 15:24:57 CEST 2019


commit a07cd2341e34d079ba30b6c1459e793f62d78f73
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Sat May 2 22:41:46 2015 +0300

    trigger to relocate configs

 apache.spec | 48 +++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 45 insertions(+), 3 deletions(-)
---
diff --git a/apache.spec b/apache.spec
index f5f15ee..a600181 100644
--- a/apache.spec
+++ b/apache.spec
@@ -3065,9 +3065,9 @@ rm -rf $RPM_BUILD_ROOT
 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 -f /etc/httpd/conf.d/10_mpm.conf.rpmnew /etc/httpd/conf.d/10_mpm.conf
+		echo "LoadModule mpm_${MPM}_module	modules/mod_mpm_${MPM}.so" > /etc/httpd/conf.modules.d/00-mpm.conf.rpmnew
+		cat /etc/httpd/conf.modules.d/00-mpm.conf >> /etc/httpd/conf.modules.d/00-mpm.conf.rpmnew
+		mv -bf /etc/httpd/conf.modules.d/00-mpm.conf{.rpmnew,}
 		sed -i -e 's,HTTPD_MPM.*,,g' /etc/sysconfig/httpd
 	fi
 fi
@@ -3113,6 +3113,48 @@ sed -i -e '
 	s,^LockFile /var/run/httpd/accept.lock,Mutex file:/var/run/httpd/,g
 ' /etc/httpd/conf.d/10_mpm.conf
 
+%triggerpostun base -- %{name}-base < 2.4.39-2
+# skip *this* trigger on downgrade
+if [ $1 -le 1 ]; then
+	exit 0
+fi
+
+if ! grep -qi '^Include conf.modules.d/' %{_sysconfdir}/apache.conf; then
+	%{__sed} -i -e '/[Ii]nclude.*conf\.d/ i IncludeOptional conf.modules.d/*.conf' %{_sysconfdir}/apache.conf
+fi
+
+od=%{_sysconfdir}/conf.d
+nd=%{_sysconfdir}/conf.modules.d
+for of in $od/??_*.conf.rpmsave; do
+	# skip if glob did not expand
+	test -f "$of" || continue
+
+	# first check matching conf.d file
+	bn=${of##*/??_}
+	bn=${bn%.rpmsave}
+	nf=$od/$bn
+	if [ -f $nf ]; then
+		cp -f $nf{,.rpmnew}
+		mv -vf $of $nf
+		continue
+	fi
+
+	# then check matching conf.modules.d file
+	nf=$(echo $nd/??-$bn)
+	if [ -f $nf ]; then
+		cp -f $nf{,.rpmnew}
+		mv -vf $of $nf
+		continue
+	fi
+done
+
+%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 '
+	s,/var/run/apache,/var/run/httpd,g
+	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 '
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/apache.git/commitdiff/a07cd2341e34d079ba30b6c1459e793f62d78f73



More information about the pld-cvs-commit mailing list