-Summary: A cron-like program that can run jobs lost during downtime.
-Summary(pl): Wersja crona z mo¿liwo¶ci± uruchamiania zapomnianych procesów.
+Summary: A cron-like program that can run jobs lost during downtime
+Summary(pl.UTF-8): Wersja crona z możliwością uruchamiania zapomnianych procesów
+Summary(pt_BR.UTF-8): Auxiliar do cron para máquinas que não ficam ligadas o tempo todo
Name: anacron
-Version: 2.1
-Release: 6
+Version: 2.3
+Release: 27
License: GPL
-Group: System Environment/Base
-Source0: %{name}-%{version}.tar.bz2
-Source1: anacrontab
-Source2: anacron.init
-Requires: /bin/sh
-Prereq: /sbin/chkconfig
+Group: Daemons
+Source0: http://dl.sourceforge.net/anacron/%{name}-%{version}.tar.gz
+# Source0-md5: 865cc1dfe1ed75c470d3e6de13763f03
+Source1: %{name}tab
+Source2: %{name}.init
+Patch0: %{name}-SIGTERM.patch
+Patch1: %{name}-sendmail.patch
+Patch2: %{name}-content-type.patch
+Patch3: %{name}-mailto.patch
+Patch4: %{name}-noconst.patch
+URL: http://anacron.sourceforge.net/
+BuildRequires: rpmbuild(macros) >= 1.268
+Requires(post,preun): /sbin/chkconfig
+Requires: /usr/lib/sendmail
+Requires: rc-scripts
+Suggests: crondaemon
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%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 Red Hat
-Linux 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 Red Hat Linux
-packages are executed each day.
-
-%description -l pl
-cron to standardowy unixowy program, okresowo uruchamiaj±cy zadane przez
-u¿ytkowników programy. anacron jest wersj± crona umo¿liwiaj±c± uruchamianie
-procesów które normalnie by siê nie wykona³y z powodu wy³±czenia maszyny.
-Jest to doskona³e rozwi±zanie dla komputerów domowych które nie s± w³±czone
-24h na dobê. Uwaga - anacron nie zastêpuje crona a jedynie go wspomaga! Nie
-ma mo¿liwo¶ci uruchamiania procesów np co godzinê
+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 PLD
+Linux 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
+PLD Linux packages are executed each day.
+
+%description -l pl.UTF-8
+Anacron (od ,,anac(h)ronistic'') zajmuje się okresowym wykonywaniem
+poleceń. Wykonuje je w odstępach będących wielokrotnością dni. W
+przeciwieństwie do crona nie zakłada, że system działa 24 godziny na
+dobę. Dzięki temu może być używany do wykonywania codziennych,
+cotygodniowych i comiesięcznych (lub innych powtarzających się co ileś
+dni) zadań w systemach, które nie są włączone non-stop. Zainstalowany
+i poprawnie skonfigurowany Anacron zapewni wykonywanie zleconych zadań
+tak blisko wyznaczonych terminów, jak tylko możliwe.
+
+Ten pakiet został wstępnie skonfigurowany do działania w systemie PLD
+Linux. Powinieneś zainstalować ten program na systemach, które nie są
+włączone non-stop aby zapewnić uruchamianie różnych zadań
+utrzymujących system we właściwych odstępach czasu.
+
+%description -l pt_BR.UTF-8
+Anacron é uma agenda para marcar a execução de comandos em horários
+programados. Ao contrário do cron, o anacron não requer que o sistema
+esteja rodando continuamente, podendo ser executado em sistemas que
+não estão ligados 24 horas por dia.
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
%build
-make CFLAGS="$RPM_OPT_FLAGS"
+%{__make} \
+ CC="%{__cc}" \
+ CFLAGS="%{rpmcflags}"
%install
-install -d $RPM_BUILD_ROOT/{etc/,usr/sbin/,usr/share/man/man5,usr/share/man/man8/}
-install -d $RPM_BUILD_ROOT/var/spool/anacron/
+rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT{%{_sysconfdir},%{_sbindir},%{_mandir}/man{5,8}} \
+ $RPM_BUILD_ROOT/{var/spool/anacron,etc/rc.d/init.d}
-#
install anacron $RPM_BUILD_ROOT%{_sbindir}
install anacron.8 $RPM_BUILD_ROOT%{_mandir}/man8/
install anacrontab.5 $RPM_BUILD_ROOT%{_mandir}/man5/
-install %SOURCE1 $RPM_BUILD_ROOT%{_sysconfdir}
+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 -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/$i/
+for i in cron.daily cron.weekly cron.monthly; do
+install -d $RPM_BUILD_ROOT%{_sysconfdir}/$i/
cat << EOF > $RPM_BUILD_ROOT%{_sysconfdir}/$i/0anacron
#!/bin/sh
#
EOF
done
-strip $RPM_BUILD_ROOT/%{_sbindir}/anacron
-
-install -d $RPM_BUILD_ROOT/etc/rc.d/init.d/
-install $RPM_SOURCE_DIR/anacron.init $RPM_BUILD_ROOT/etc/rc.d/init.d/anacron
+%clean
+rm -rf $RPM_BUILD_ROOT
%post
/sbin/chkconfig --add anacron
+%service anacron restart "Anacron daemon"
%preun
-/sbin/chkconfig --del anacron
-
-%clean
-rm -rf $RPM_BUILD_ROOT
+if [ "$1" = "0" ];then
+ %service anacron stop
+ /sbin/chkconfig --del anacron
+fi
%files
%defattr(644,root,root,755)
-%doc COPYING NEWS README
+%doc ChangeLog README TODO
+%attr(755,root,root) %{_sbindir}/anacron
+%attr(754,root,root) /etc/rc.d/init.d/*
%config %{_sysconfdir}/anacrontab
%dir /var/spool/anacron/
-%{_mandir}/man5/*
-%{_mandir}/man8/*
-%defattr(755,root,root,755)
-%config /etc/rc.d/init.d/*
-%attr(755,root,root) %{_sbindir}/anacron
-%config %{_sysconfdir}/cron.daily/0anacron
-%config %{_sysconfdir}/cron.monthly/0anacron
-%config %{_sysconfdir}/cron.weekly/0anacron
+%attr(755,root,root) /etc/cron.daily/0anacron
+%attr(755,root,root) %{_sysconfdir}/cron.monthly/0anacron
+%attr(755,root,root) %{_sysconfdir}/cron.weekly/0anacron
+%{_mandir}/man[58]/*