Sophie

Sophie

distrib > Mandriva > 7.2 > i586 > media > main-src > by-pkgid > 00806e5f4252e1411865b142b6da4713 > files > 3

anacron-2.3-3mdk.src.rpm

%define version 2.3
%define name anacron
%define release 3mdk
%define prefix %{_prefix}

Name: %{name}
Summary: A cron-like program that doesn't go by time
Version: %{version}
Release: %{release}
Copyright: GPL
Group: System/Servers
Source: ftp://ftp.debian.org/debian/dists/woody/main/source/admin/%{name}-%{version}.orig.tar.bz2
Source1: anacrontab.bz2
Source2: anacron.init.bz2
Requires: /bin/sh
Prereq: /sbin/chkconfig
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot

%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

%build
make CFLAGS="$RPM_OPT_FLAGS"

%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

#%preun
#chkconfig --del anacron

%preun
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 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.