- use %service
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 2 Apr 2006 14:19:27 +0000 (14:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    anacron.spec -> 1.37

anacron.spec

index eabc0f0..61761ec 100644 (file)
@@ -9,7 +9,7 @@ Version:        2.3
 Release:       24
 License:       GPL
 Group:         Daemons
-Source0:       http://dl.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
+Source0:       http://dl.sourceforge.net/anacron/%{name}-%{version}.tar.gz
 # Source0-md5: 865cc1dfe1ed75c470d3e6de13763f03
 Source1:       %{name}tab
 Source2:       %{name}.init
@@ -19,9 +19,10 @@ Patch2:              %{name}-content-type.patch
 Patch3:                %{name}-mailto.patch
 Patch4:                %{name}-noconst.patch
 URL:           http://anacron.sourceforge.net/
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires:      /sbin/chkconfig
 Requires:      /usr/lib/sendmail
 Provides:      crondaemon
-Prereq:                /sbin/chkconfig
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -84,7 +85,7 @@ install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}
 install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
 
 for i in cron.daily cron.weekly cron.monthly; do
-install  -d $RPM_BUILD_ROOT%{_sysconfdir}/$i/
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/$i/
 cat << EOF > $RPM_BUILD_ROOT%{_sysconfdir}/$i/0anacron
 #!/bin/sh
 #
@@ -106,18 +107,11 @@ rm -rf $RPM_BUILD_ROOT
 
 %post
 /sbin/chkconfig --add anacron
-
-if [ -f /var/lock/subsys/anacron ]; then
-       /etc/rc.d/init.d/anacron restart >&2
-else
-       echo "Run \"/etc/rc.d/init.d/anacron start\" to start Anacron daemon."
-fi
+%service anacron restart "Anacron daemon"
 
 %preun
 if [ "$1" = "0" ];then
-       if [ -f /var/lock/subsys/anacron ]; then
-               /etc/rc.d/init.d/anacron stop >&2
-       fi
+       %service anacron stop
        /sbin/chkconfig --del anacron
 fi
 
This page took 0.037351 seconds and 4 git commands to generate.