SPECS: proftpd.spec - optimize triggers to use only one sed invoca...

glen glen at pld-linux.org
Mon Aug 8 16:22:49 CEST 2005


Author: glen                         Date: Mon Aug  8 14:22:49 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- optimize triggers to use only one sed invocation
- add missing Requires(triggerpostun) for sed 4.0

---- Files affected:
SPECS:
   proftpd.spec (1.206 -> 1.207) 

---- Diffs:

================================================================
Index: SPECS/proftpd.spec
diff -u SPECS/proftpd.spec:1.206 SPECS/proftpd.spec:1.207
--- SPECS/proftpd.spec:1.206	Mon Aug  8 15:55:38 2005
+++ SPECS/proftpd.spec	Mon Aug  8 16:22:43 2005
@@ -124,6 +124,7 @@
 Group:		Daemons
 PreReq:		%{name}-common = %{epoch}:%{version}-%{release}
 PreReq:		rc-inetd
+Requires(triggerpostun):	sed >= 4.0
 Requires(post):	fileutils
 Requires(post):	grep
 Requires(post):	sed
@@ -156,6 +157,7 @@
 Group:		Daemons
 PreReq:		%{name}-common = %{epoch}:%{version}-%{release}
 PreReq:		rc-scripts
+Requires(triggerpostun):	sed >= 4.0
 Requires(post,preun):	/sbin/chkconfig
 Requires(post):	fileutils
 Requires(post):	grep
@@ -319,37 +321,37 @@
 
 %triggerpostun inetd -- %{name}-inetd <= 1.2.10-1
 echo "Changing deprecated config options"
-cp /etc/ftpd/proftpd.conf /etc/ftpd/proftpd.conf.backup
-sed -i -e 's/AuthPAMAuthoritative\b/AuthPAM/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TCPDServiceName/TCPServiceName/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsRsaCertFile/TLSRSACertificateFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsRsaKeyFile/TLSRSACertificateKeyFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsDsaCertFile/TLSDSACertificateFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsDsaKeyFile/TLSDSACertificateKeyFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsCrlFile/TLSCARevocationFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsDhParamFile/TLSDHParamFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsCipherList/TLSCipherSuite/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsCertsOk/TLSVerifyClient/' /etc/ftpd/proftpd.conf
-grep -v UseTCPD /etc/ftpd/proftpd.conf > /etc/ftpd/proftpd.conf.tmp
-mv -f /etc/ftpd/proftpd.conf.tmp /etc/ftpd/proftpd.conf
-chmod 640 /etc/ftpd/proftpd.conf
+cp -f /etc/ftpd/proftpd.conf{,.rpmsave}
+sed -i -e '
+	s/AuthPAMAuthoritative\b/AuthPAM/
+	s/TCPDServiceName/TCPServiceName/
+	s/TlsRsaCertFile/TLSRSACertificateFile/
+	s/TlsRsaKeyFile/TLSRSACertificateKeyFile/
+	s/TlsDsaCertFile/TLSDSACertificateFile/
+	s/TlsDsaKeyFile/TLSDSACertificateKeyFile/
+	s/TlsCrlFile/TLSCARevocationFile/
+	s/TlsDhParamFile/TLSDHParamFile/
+	s/TlsCipherList/TLSCipherSuite/
+	s/TlsCertsOk/TLSVerifyClient/
+	/UseTCPD/d
+' /etc/ftpd/proftpd.conf
 
 %triggerpostun standalone -- %{name}-standalone <= 1.2.10-1
 echo "Changing deprecated config options"
-cp /etc/ftpd/proftpd.conf /etc/ftpd/proftpd.conf.backup
-sed -i -e 's/AuthPAMAuthoritative\b/AuthPAM/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TCPDServiceName/TCPServiceName/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsRsaCertFile/TLSRSACertificateFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsRsaKeyFile/TLSRSACertificateKeyFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsDsaCertFile/TLSDSACertificateFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsDsaKeyFile/TLSDSACertificateKeyFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsCrlFile/TLSCARevocationFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsDhParamFile/TLSDHParamFile/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsCipherList/TLSCipherSuite/' /etc/ftpd/proftpd.conf
-sed -i -e 's/TlsCertsOk/TLSVerifyClient/' /etc/ftpd/proftpd.conf
-grep -v UseTCPD /etc/ftpd/proftpd.conf > /etc/ftpd/proftpd.conf.tmp
-mv -f /etc/ftpd/proftpd.conf.tmp /etc/ftpd/proftpd.conf
-chmod 640 /etc/ftpd/proftpd.conf
+cp -f /etc/ftpd/proftpd.conf{,.rpmsave}
+sed -i -e '
+	s/AuthPAMAuthoritative\b/AuthPAM/
+	s/TCPDServiceName/TCPServiceName/
+	s/TlsRsaCertFile/TLSRSACertificateFile/
+	s/TlsRsaKeyFile/TLSRSACertificateKeyFile/
+	s/TlsDsaCertFile/TLSDSACertificateFile/
+	s/TlsDsaKeyFile/TLSDSACertificateKeyFile/
+	s/TlsCrlFile/TLSCARevocationFile/
+	s/TlsDhParamFile/TLSDHParamFile/
+	s/TlsCipherList/TLSCipherSuite/
+	s/TlsCertsOk/TLSVerifyClient/
+	/UseTCPD/d
+' /etc/ftpd/proftpd.conf
 
 %files common
 %defattr(644,root,root,755)
@@ -402,6 +404,10 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.207  2005/08/08 14:22:43  glen
+- optimize triggers to use only one sed invocation
+- add missing Requires(triggerpostun) for sed 4.0
+
 Revision 1.206  2005/08/08 13:55:38  hawk
 - handle TLS options in triggers
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/proftpd.spec?r1=1.206&r2=1.207&f=u




More information about the pld-cvs-commit mailing list