# $Id$ PNAME="cronie" PVER="1.5.2" PBUILD="r2" PCAT="sys-apps" DESCRIPTION="A periodical command scheduler." HOMEPAGE="https://github.com/cronie-crond/cronie" DEPEND=">= virtual/glibc >= virtual/editor >= virtual/mta >= sys-libs/pam-1.1 >= virtual/debianutils >= sys-apps/pm-utils-1.4" SDEPEND=">= sys-dev/autoconf-5 >= sys-dev/automake-4" PROVIDE="virtual/cron" SRCFILE="${PNAME}-${PVER}.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PNAME}-${PVER}" sminclude mtools systemd SRC_URI=( https://github.com/cronie-crond/${PNAME}/archive/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/cronie.deny mirror://${PNAME}/crontab mirror://${PNAME}/crontabs.4 mirror://${PNAME}/cronie.pam mirror://${PNAME}/cronie.service ) UP2DATE="updatecmd https://github.com/cronie-crond/cronie/releases | highesttarball gz" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # create configure mautoreconf || die # log to syslog by default sed -i 's:^\(CRONDARGS=\).*:\1"-s":' crond.sysconfig || die } src_compile() { cd ${SRCDIR} mconfigure \ --localstatedir=/var \ --enable-anacron \ --enable-pie \ --with-pam \ --with-inotify \ --without-audit \ --without-selinux \ || die mmake || die } src_install() { cd ${SRCDIR} mmake DESTDIR=${BINDIR} install || die mchmod 4755 /usr/bin/crontab || die # general needed cron-files (dcron vcron etc, uses this also) mkeepdir /etc/cron.d || die mkeepdir /etc/cron.hourly || die mkeepdir /etc/cron.daily || die mkeepdir /etc/cron.weekly || die mkeepdir /etc/cron.monthly || die mkeepdir /var/spool/cron || die # cronie needed directories mkeepdir /var/spool/anacron || die # install etc minstallfile -s cronie.deny /etc/cron.deny || die minstallconf ${SRCDIR}/crond.sysconfig cronie || die minstallfile contrib/anacrontab /etc/anacrontab || die minstallfile contrib/0hourly /etc/cron.d/0hourly || die minstallexec contrib/0anacron /etc/cron.hourly/0anacron || die minstallfile -s crontab /etc/crontab || die minstallman ${SOURCEDIR}/${PNAME}/crontabs.4 || die # systemd unit minstallunit cronie.service || die # pam related minstallpam cronie.pam crond || die minstalldocs AUTHORS ChangeLog COPYING NEWS README || die } preinstall() { if [[ ! -z $(magequery -n fcron) ]] then echo -e ${COLRED} echo -e "Error: sys-apps/fcron is installed!!" echo -e "fcron cannot be installed side-by-side with cronie." echo -e "Please uninstall sys-apps/fcron first!" echo -e ${COLDEFAULT} die "sys-apps/fcron found!" fi } postinstall() { mstartunit cronie.service echo echo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: " echo "crontab /etc/crontab" echo echo "To run cronie at system boot please run: " echo "systemctl enable cronie.service" echo echo "!!! That will replace root's current crontab !!!" echo } postremove() { mstopunit cronie.service }