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

glen glen at pld-linux.org
Sat May 2 21:42:53 CEST 2015


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

    trigger to relocate configs

 apache.spec | 34 +++++++++++++++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)
---
diff --git a/apache.spec b/apache.spec
index 088e5c2..f97f58f 100644
--- a/apache.spec
+++ b/apache.spec
@@ -33,7 +33,7 @@ Summary(ru.UTF-8):	Самый популярный веб-сервер
 Summary(tr.UTF-8):	Lider WWW tarayıcı
 Name:		apache
 Version:	2.4.12
-Release:	3.9
+Release:	3.26
 License:	Apache v2.0
 Group:		Networking/Daemons/HTTP
 Source0:	http://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2
@@ -2964,6 +2964,38 @@ 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 '
================================================================

---- gitweb:

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



More information about the pld-cvs-commit mailing list