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

glen glen at pld-linux.org
Mon Jan 29 10:08:35 CET 2018


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

    trigger to relocate configs

 apache.spec | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
---
diff --git a/apache.spec b/apache.spec
index 1010296..b9e9565 100644
--- a/apache.spec
+++ b/apache.spec
@@ -2997,6 +2997,45 @@ 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.12-3.15
+# 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
+	# 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/ed9e6b2216e9b701461ecb12e9c5fadce8c92abb



More information about the pld-cvs-commit mailing list