SPECS: fcron.spec - use %service, cosmetics

glen glen at pld-linux.org
Tue Feb 28 00:11:35 CET 2006


Author: glen                         Date: Mon Feb 27 23:11:35 2006 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- use %service, cosmetics

---- Files affected:
SPECS:
   fcron.spec (1.33 -> 1.34) 

---- Diffs:

================================================================
Index: SPECS/fcron.spec
diff -u SPECS/fcron.spec:1.33 SPECS/fcron.spec:1.34
--- SPECS/fcron.spec:1.33	Mon Jan 23 13:56:52 2006
+++ SPECS/fcron.spec	Tue Feb 28 00:11:29 2006
@@ -19,11 +19,11 @@
 Patch0:		%{name}-mail_output_only_if_there_is_output.patch
 Patch1:		%{name}-configure.patch
 URL:		http://fcron.free.fr/
-BuildRequires:	automake
 BuildRequires:	autoconf
+BuildRequires:	automake
 BuildRequires:	libselinux-devel
 BuildRequires:	pam-devel
-BuildRequires:	rpmbuild(macros) >= 1.202
+BuildRequires:	rpmbuild(macros) >= 1.268
 Requires(post):	fileutils
 Requires(post,preun):	/sbin/chkconfig
 Requires(postun):	/usr/sbin/groupdel
@@ -34,8 +34,8 @@
 Requires:	/bin/run-parts
 Requires:	psmisc >= 20.1
 Requires:	rc-scripts
-Provides:	crontabs >= 1.7
 Provides:	crondaemon
+Provides:	crontabs >= 1.7
 Provides:	group(crontab)
 Obsoletes:	crontabs
 Obsoletes:	hc-cron
@@ -104,7 +104,7 @@
 	GROUPNAME=$(id -g)
 
 #fix premission for rpmbuild
-chmod +rw $RPM_BUILD_ROOT/usr/*bin/*
+chmod +rw $RPM_BUILD_ROOT%{_prefix}/*bin/*
 
 ln -sf %{_bindir}/fcrontab $RPM_BUILD_ROOT%{_bindir}/crontab
 mv -f $RPM_BUILD_ROOT%{_sbindir}/fcron $RPM_BUILD_ROOT%{_sbindir}/crond
@@ -166,11 +166,7 @@
 fi
 
 /sbin/chkconfig --add crond
-if [ -f /var/lock/subsys/crond ]; then
-	/etc/rc.d/init.d/crond restart >&2
-else
-	echo "Run \"/etc/rc.d/init.d/crond start\" to start cron daemon."
-fi
+%service crond restart "cron daemon"
 
 umask 027
 touch /var/log/cron
@@ -179,24 +175,22 @@
 
 %preun
 if [ "$1" = "0" ]; then
-	if [ -f /var/lock/subsys/crond ]; then
-		/etc/rc.d/init.d/crond stop >&2
-	fi
+	%service crond stop
 	/sbin/chkconfig --del crond
 
-rm -f /var/spool/cron/systab*
+	rm -f /var/spool/cron/systab*
 
-FIND=`find /var/spool/cron -name \*.orig`
-for FILE in $FIND; do
-	BASENAME=`basename $FILE`
-	USER="`echo "$BASENAME"| sed 's/.orig//'`"
-	mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
-	chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
-	chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
-done
-rm -f /var/spool/cron/rm\.*
-rm -f /var/spool/cron/fcrontab.sig
-rm -f /var/spool/cron/new\.*
+	FIND=`find /var/spool/cron -name '*.orig'`
+	for FILE in $FIND; do
+		BASENAME=`basename $FILE`
+		USER="${BASENAME%.orig}"
+		mv -f $FILE /var/spool/cron/$USER >/dev/null 2>&1
+		chown $USER:crontab /var/spool/cron/$USER >/dev/null 2>&1
+		chmod 600 /var/spool/cron/$USER >/dev/null 2>&1
+	done
+	rm -f /var/spool/cron/rm\.*
+	rm -f /var/spool/cron/fcrontab.sig
+	rm -f /var/spool/cron/new\.*
 fi
 
 %postun
@@ -242,8 +236,7 @@
 /sbin/chkconfig --add crond
 
 %triggerpostun -- hc-cron <= 0.14-12
-for i in `/bin/ls /var/spool/cron 2>/dev/null`
-do
+for i in `/bin/ls /var/spool/cron 2>/dev/null`; do
 	chown ${i} /var/spool/cron/${i} 2>/dev/null || :
 done
 /bin/chmod 660 /var/log/cron
@@ -284,6 +277,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.34  2006/02/27 23:11:29  glen
+- use %service, cosmetics
+
 Revision 1.33  2006/01/23 12:56:52  arekm
 - rel 2; force sendmail path
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/fcron.spec?r1=1.33&r2=1.34&f=u



More information about the pld-cvs-commit mailing list