diff --git a/templates/anacron/files/00anacron.daily b/templates/anacron/files/00anacron.daily new file mode 100644 index 00000000000..c1f4d4086da --- /dev/null +++ b/templates/anacron/files/00anacron.daily @@ -0,0 +1,5 @@ +#!/bin/sh +# +# Update anacron time stamps. + +anacron -u cron.daily diff --git a/templates/anacron/files/00anacron.monthly b/templates/anacron/files/00anacron.monthly new file mode 100644 index 00000000000..f6fe44e7c17 --- /dev/null +++ b/templates/anacron/files/00anacron.monthly @@ -0,0 +1,5 @@ +#!/bin/sh +# +# Update anacron time stamps. + +anacron -u cron.monthly diff --git a/templates/anacron/files/00anacron.weekly b/templates/anacron/files/00anacron.weekly new file mode 100644 index 00000000000..95d6d3a6496 --- /dev/null +++ b/templates/anacron/files/00anacron.weekly @@ -0,0 +1,5 @@ +#!/bin/sh +# +# Update anacron time stamps. + +anacron -u cron.weekly diff --git a/templates/anacron/files/anacrond.rc b/templates/anacron/files/anacrond.rc new file mode 100644 index 00000000000..6bda21116ee --- /dev/null +++ b/templates/anacron/files/anacrond.rc @@ -0,0 +1,15 @@ +#!/sbin/runscript +# + +depend() +{ + use logger + need clock hostname +} + +start() +{ + ebegin "Starting anacron" + /usr/sbin/anacron -s >> /var/log/cron 2>&1 + eend $? +} diff --git a/templates/anacron/files/anacrontab b/templates/anacron/files/anacrontab new file mode 100644 index 00000000000..a9edaeb84ed --- /dev/null +++ b/templates/anacron/files/anacrontab @@ -0,0 +1,7 @@ +# /etc/anacrontab example +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +# format: period delay job-identifier command +1 5 cron.daily run-parts /etc/cron.daily +7 10 cron.weekly run-parts /etc/cron.weekly +30 15 cron.monthly run-parts /etc/cron.monthly diff --git a/templates/anacron/template b/templates/anacron/template new file mode 100644 index 00000000000..6da87aa3070 --- /dev/null +++ b/templates/anacron/template @@ -0,0 +1,43 @@ +# Template file for 'anacron' +pkgname=anacron +version=2.3 +distfiles="${SOURCEFORGE_SITE}/$pkgname/$pkgname-$version.tar.gz" +build_style=gnu_makefile +make_install_args="PREFIX=$XBPS_DESTDIR/$pkgname-$version + MANDIR=$XBPS_DESTDIR/$pkgname-$version/usr/share/man" +short_desc="cron-like program that doesn't go by time" +maintainer="Juan RP " +checksum=5ceee6f22cd089bdaf1c0841200dbe5726babaf9e2c432bb17c1fc95da5ca99f +long_desc=" + Anacron 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." + +openrc_services="anacrond default" + +Add_dependency full glibc +Add_dependency full bash +Add_dependency full run-parts + +pre_configure() +{ + sed -i 's/const int isleap;/int isleap;/' $wrksrc/gregor.c +} + +post_install() +{ + install -d ${DESTDIR}/etc/cron.daily ${DESTDIR}/etc/cron.weekly \ + ${DESTDIR}/etc/cron.monthly ${DESTDIR}/etc/init.d + install -m755 ${FILESDIR}/00anacron.daily \ + ${DESTDIR}/etc/cron.daily/00anacron + install -m755 ${FILESDIR}/00anacron.weekly \ + ${DESTDIR}/etc/cron.weekly/00anacron + install -m755 ${FILESDIR}/00anacron.monthly \ + ${DESTDIR}/etc/cron.monthly/00anacron + install -m644 ${FILESDIR}/anacrontab ${DESTDIR}/etc + install -m755 ${FILESDIR}/anacrond.rc ${DESTDIR}/etc/init.d/anacrond +}