SPECS: proftpd.spec - optimize, increase readability, unify trigge...

glen glen at pld-linux.org
Mon Aug 8 16:31:02 CEST 2005


Author: glen                         Date: Mon Aug  8 14:31:02 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- optimize, increase readability, unify triggers/post scriptlets

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

---- Diffs:

================================================================
Index: SPECS/proftpd.spec
diff -u SPECS/proftpd.spec:1.207 SPECS/proftpd.spec:1.208
--- SPECS/proftpd.spec:1.207	Mon Aug  8 16:22:43 2005
+++ SPECS/proftpd.spec	Mon Aug  8 16:30:57 2005
@@ -124,10 +124,10 @@
 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
+Requires(post):	sed >= 4.0
+Requires(triggerpostun):	sed >= 4.0
 Provides:	proftpd = %{epoch}:%{version}-%{release}
 Provides:	ftpserver
 Obsoletes:	proftpd-standalone
@@ -157,11 +157,11 @@
 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
-Requires(post):	sed
+Requires(post):	sed >= 4.0
+Requires(triggerpostun):	sed >= 4.0
 Provides:	proftpd = %{epoch}:%{version}-%{release}
 Provides:	ftpserver
 Obsoletes:	proftpd-inetd
@@ -275,17 +275,15 @@
 %post common
 umask 027
 touch /var/log/xferlog
-awk 'BEGIN { FS = ":" }; { if(($3 < 500)&&($1 != "ftp")) print $1; }' < /etc/passwd >> %{_sysconfdir}/ftpusers.default
+awk -F: '{ if (($3 < 500) && ($1 != "ftp")) print $1; }' < /etc/passwd >> %{_sysconfdir}/ftpusers.default
 if [ ! -f %{_sysconfdir}/ftpusers ]; then
 	cp -f %{_sysconfdir}/ftpusers.default %{_sysconfdir}/ftpusers
 fi
 
 %post inetd
-umask 027
 if grep -iEqs "^ServerType[[:space:]]+standalone" %{_sysconfdir}/proftpd.conf ; then
-	cp -a %{_sysconfdir}/proftpd.conf %{_sysconfdir}/proftpd.conf.rpmorig
-	sed -e "s/^ServerType[[:space:]]\+standalone/ServerType			inetd/g" \
-		%{_sysconfdir}/proftpd.conf.rpmorig >%{_sysconfdir}/proftpd.conf
+	cp -f %{_sysconfdir}/proftpd.conf{,.rpmorig}
+	sed -i -e 's/^ServerType[[:space:]]\+standalone/ServerType			inetd/g' %{_sysconfdir}/proftpd.conf
 fi
 if [ -f /var/lock/subsys/rc-inetd ]; then
 	/etc/rc.d/init.d/rc-inetd reload 1>&2
@@ -294,16 +292,15 @@
 fi
 
 %postun inetd
-if [ "$1" = "0" -a -f /var/lock/subsys/rc-inetd ]; then
+if [ "$1" = "0" ] && [ -f /var/lock/subsys/rc-inetd ]; then
 	/etc/rc.d/init.d/rc-inetd reload 1>&2
 fi
 
 %post standalone
 /sbin/chkconfig --add proftpd
 if grep -iEqs "^ServerType[[:space:]]+inetd" %{_sysconfdir}/proftpd.conf ; then
-	cp -a %{_sysconfdir}/proftpd.conf %{_sysconfdir}/proftpd.conf.rpmorig
-	sed -e "s/^ServerType[[:space:]]\+inetd/ServerType			standalone/g" \
-		%{_sysconfdir}/proftpd.conf.rpmorig >%{_sysconfdir}/proftpd.conf
+	cp -f %{_sysconfdir}/proftpd.conf{,.rpmorig}
+	sed -i -e 's/^ServerType[[:space:]]\+inetd/ServerType			standalone/g' %{_sysconfdir}/proftpd.conf
 fi
 if [ -f /var/lock/subsys/proftpd ]; then
 	/etc/rc.d/init.d/proftpd restart 1>&2
@@ -321,7 +318,7 @@
 
 %triggerpostun inetd -- %{name}-inetd <= 1.2.10-1
 echo "Changing deprecated config options"
-cp -f /etc/ftpd/proftpd.conf{,.rpmsave}
+cp -f /etc/ftpd/proftpd.conf{,.rpmorig}
 sed -i -e '
 	s/AuthPAMAuthoritative\b/AuthPAM/
 	s/TCPDServiceName/TCPServiceName/
@@ -338,7 +335,7 @@
 
 %triggerpostun standalone -- %{name}-standalone <= 1.2.10-1
 echo "Changing deprecated config options"
-cp -f /etc/ftpd/proftpd.conf{,.rpmsave}
+cp -f /etc/ftpd/proftpd.conf{,.rpmorig}
 sed -i -e '
 	s/AuthPAMAuthoritative\b/AuthPAM/
 	s/TCPDServiceName/TCPServiceName/
@@ -404,6 +401,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.208  2005/08/08 14:30:57  glen
+- optimize, increase readability, unify triggers/post scriptlets
+
 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
@@ -431,7 +431,7 @@
 - increase readability: use $MODULES var for --with-modules arg
 
 Revision 1.200  2005/03/29 08:38:12  marcus
-- addedd missing ":" in quota pgsql bcond
+- added missing ":" in quota pgsql bcond
 
 Revision 1.199  2005/03/17 20:04:46  glen
 - updated %description
================================================================

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




More information about the pld-cvs-commit mailing list