%define version 2.3 %define name anacron %define release 11mdk %define prefix %{_prefix} Name: %{name} Summary: A cron-like program that doesn't go by time Version: %{version} Release: %{release} License: GPL URL: http://sourceforge.net/projects/anacron/ Group: System/Servers Source: http://download.sourceforge.net/anacron/%{name}-%{version}.tar.bz2 Source1: anacrontab.bz2 Source2: anacron.init.bz2 Requires: /bin/sh #Requires: /usr/sbin/sendmail Prereq: /sbin/chkconfig BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Patch0: %{name}-remove_sendmail_complain.patch.bz2 %description Anacron (like `anac(h)ronistic') is a periodic command scheduler. It executes commands at intervals specified in days. Unlike cron, it does not assume that the system is running continuously. It can therefore be used to control the execution of daily, weekly and monthly jobs (or anything with a period of n days), on systems that don't run 24 hours a day. When installed and configured properly, Anacron will make sure that the commands are run at the specified intervals as closely as machine-uptime permits. This package is pre-configured to execute the daily jobs of the Mandrake system. You should install this program if your system isn't powered on 24 hours a day to make sure the maintenance jobs of other Mandrake packages are executed each day. %prep %setup -q %patch0 -p1 -b .sendmail %build %serverbuild #make CFLAGS="$RPM_OPT_FLAGS" %make %install mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} mkdir -p $RPM_BUILD_ROOT%{_sbindir} mkdir -p $RPM_BUILD_ROOT%{_mandir}/man5 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8 mkdir -p $RPM_BUILD_ROOT/var/spool/anacron/ cp anacron $RPM_BUILD_ROOT%{_sbindir} cp anacron.8 $RPM_BUILD_ROOT%{_mandir}/man8/ cp anacrontab.5 $RPM_BUILD_ROOT%{_mandir}/man5/ bzcat %{SOURCE1} > $RPM_BUILD_ROOT%{_sysconfdir}/anacrontab for i in cron.daily cron.weekly cron.monthly;do mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/$i/ cat << EOF > $RPM_BUILD_ROOT%{_sysconfdir}/$i/0anacron #!/bin/sh # # anacron's cron script # # This script updates anacron time stamps. It is called through run-parts # either by anacron itself or by cron. # # The script is called "0anacron" to assure that it will be executed # _before_ all other scripts. anacron -u $i EOF chmod +x $RPM_BUILD_ROOT%{_sysconfdir}/$i/0anacron done mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/ bzcat %{SOURCE2} > $RPM_BUILD_ROOT%{_sysconfdir}/rc.d/init.d/%{name} %clean rm -rf $RPM_BUILD_ROOT %post #/sbin/chkconfig --add anacron %_post_service anacron #%preun #chkconfig --del anacron %preun %_preun_service anacron #if [ "$1" = "0" ]; then # service anacron stop >/dev/null 2>&1 # /sbin/chkconfig --del anacron #fi %postun if [ "$1" -ge "1" ]; then service anacron condrestart >/dev/null 2>&1 fi %files %defattr(-,root,root,0755) %doc COPYING ChangeLog README TODO %config(noreplace) %{_sysconfdir}/anacrontab %dir /var/spool/anacron/ %config(noreplace) %attr(755,root,root) %{_sysconfdir}/rc.d/init.d/%{name} %{_mandir}/man5/* %{_mandir}/man8/* %{_sbindir}/anacron %config(noreplace) %{_sysconfdir}/cron.daily/0anacron %config(noreplace) %{_sysconfdir}/cron.monthly/0anacron %config(noreplace) %{_sysconfdir}/cron.weekly/0anacron %changelog * Tue Dec 4 2001 Warly <warly@mandrakesoft.com> 2.3-11mdk - rpmlint fixes * Fri Sep 7 2001 Renaud Chaillat <rchaillat@mandrakesoft.com> 2.3-10mdk - removed requirement on /usr/sbin/sendmail - added a patch to remove the logged complain when sendmail is missing * Fri Aug 31 2001 Renaud Chaillat <rchaillat@mandrakesoft.com> 2.3-9mdk - added a requirement on /usr/sbin/sendmail * Tue Jun 12 2001 Chmouel Boudjnah <chmouel@mandrakesoft.com> 2.3-8mdk - Add fake reload entry. - don't start anacron when we are out of battery on a laptop. * Tue Apr 10 2001 Renaud Chaillat <rchaillat@mandrakesoft.com> 2.3-7mdk - init script improvement thanks to Andrej Borsenkow * Thu Mar 29 2001 Renaud Chaillat <rchaillat@mandrakesoft.com> 2.3-6mdk - recompiled without omit-frame-pointer and ease upgrades (new macros) * Thu Jan 18 2001 Geoffrey Lee <snailtalk@mandrakesoft.com> 2.3-5mdk - don't depend on the debian source url, use teh one from sourceforge. * Mon Nov 06 2000 Daouda Lo <daouda@mandrakesoft.com> 2.3-4mdk - rebuild against new compiler. * Tue Sep 12 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 2.3-3mdk - added use of subsys in initscript * Thu Sep 7 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 2.3-2mdk - changed source (taken from debian instead of sourceforge) - added Prereq - changed init script (took redhat one) - changed preun and added postun to stop and restart service properly - added config(noreplace) on default tasks and init script * Thu Aug 24 2000 Renaud Chaillat <rchaillat@mandrakesoft.com> 2.3-1mdk - new version - chkconfig in post install and preuninstall - slight improvements (noreplace, url) - improved init.d script * Fri Jul 21 2000 Guillaume Cottenceau <gc@mandrakesoft.com> 2.1-6mdk - BM - macroqwekrvhuqwjrncasdfkl;kl;vbwerkl;vbzations * Mon Jul 10 2000 Thierry Vignaud <tvignaud@mandrakesoft.com> 2.1-5mdk - use spec-helper & new macros - add a %%install section (...) : now spec-helper will work on anacron rpm. * Fri Apr 14 2000 David BAUDENS <baudens@mandrakesoft.com> 2.1-4mdk - Fix Description and Summary - Use %%{_tmppath} for BuildRoot * Sat Mar 25 2000 Daouda Lo <daouda@mandrakesoft.com> 2.1-3mdk - fix group * Wed Dec 29 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - Remove cron.hourly check (unusefull). * Wed Nov 10 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - 2.1 from debian. - Fix typo in initscripts. * Thu Jul 22 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - Fix wrong entries in anacrontab. - Add a /etc/rc.d/rc.sysinit/ script * Tue Apr 27 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - Fix bug with /var/spool/anacron/ * Sat Apr 10 1999 Chmouel Boudjnah <chmouel@mandrakesoft.com> - First version mainly inspired from the Debian package.