# $Id$ PNAME="fcron" PVER="3.0.6" PBUILD="r3" PCATEGORIE="sys-apps" STATE="unstable" DESCRIPTION="A periodical command scheduler which aims at replacing Vixie Cron." HOMEPAGE="http://fcron.free.fr/" DEPEND=">= virtual/glibc >= virtual/editor >= virtual/mta >= sys-libs/pam-1.1" SDEPEND=">= sys-dev/autoconf-5 >= sys-dev/automake-4" PROVIDE="virtual/cron" SRCFILE="${PNAME}-${PVER}.src.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}-${PVER}" sminclude mtools mbuild RC_CVS_REV=1.2 SRC_URI=( ftp://ftp.seul.org/pub/${PNAME}/${SRCFILE} http://fcron.free.fr/archives/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/run-crons-0.3 mirror://${PNAME}/fcron.allow mirror://${PNAME}/fcron.deny mirror://${PNAME}/fcron.conf-2.9.5.1 mirror://${PNAME}/crontab mirror://${PNAME}/fcron.rc-${RC_CVS_REV} mirror://${PNAME}/fcron.pam mirror://${PNAME}/fcrontab.pam mirror://${PNAME}/fcron.service ) UP2DATE="updatecmd ftp://ftp.seul.org/pub/${PNAME} | lasttarball gz | sed s/.src//" src_compile() { cd ${SRCDIR} # using systemwide editor as default, but fallback to nano mconfigure \ --with-username=cron \ --with-groupname=cron \ --with-piddir=/var/run \ --with-etcdir=/etc/fcron \ --with-spooldir=/var/spool/cron \ --with-fifodir=/var/run \ --with-fcrondyn=yes \ --with-editor=${EDITOR:=/usr/bin/nano} \ --with-sendmail=/usr/sbin/sendmail \ --with-pam=yes \ --with-selinux=no \ || die mmake || die } src_install() { cd ${SRCDIR} # this is needed to keep the correct rights for /var minstalldir /var || die # this is needed to keep the correct rights for /etc minstalldir /etc || die # general needed cron-files (dcron vcron etc, uses this also) minstalldir /usr/sbin || die minstallexec -s run-crons-0.3 /usr/sbin/run-crons || die 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 mkeepdir /var/spool/cron/lastrun || die # fcron needed directories minstalldir /etc/fcron || die minstalldir /usr/sbin || die mkeepdir /var/spool/cron/fcrontabs || die # install fcron bins minstallexec fcron /usr/sbin || die minstallexec fcrontab || die minstallexec fcrondyn || die minstallexec fcronsighup /usr/bin || die mlink fcrontab /usr/bin/crontab || die # install etc minstallfile -s fcron.allow /etc/fcron || die minstallfile -s fcron.deny /etc/fcron || die minstallfile -s fcron.conf-2.9.5.1 /etc/fcron/fcron.conf || die minstalletc crontab || die # sysv init script minstallrc fcron.rc-${RC_CVS_REV} fcron || die # systemd unit minstallunit fcron.service || die # pam related minstallpam fcron.pam fcron || die minstallpam fcrontab.pam fcrontab || die # now fix all permissions # # fix owner (run it before suid bits are set, or they wil be reseted) mchown root:cron /var/spool/cron || die mchown cron:cron /var/spool/cron/fcrontabs || die mchown cron:cron /usr/bin/fcrontab || die mchown cron:cron /usr/bin/fcrondyn || die mchown root:cron /usr/bin/fcronsighup || die mchown root:cron /etc/fcron/fcron.allow || die mchown root:cron /etc/fcron/fcron.deny || die mchown root:cron /etc/fcron/fcron.conf || die # # directories mchmod 0750 /etc/cron.d || die mchmod 0750 /etc/cron.hourly || die mchmod 0750 /etc/cron.daily || die mchmod 0750 /etc/cron.weekly || die mchmod 0750 /etc/cron.monthly || die mchmod 0750 /var/spool/cron || die mchmod 0750 /var/spool/cron/lastrun || die mchmod 0770 /var/spool/cron/fcrontabs || die # # files mchmod 0755 /usr/sbin/fcron || die mchmod 6755 /usr/bin/fcrontab || die mchmod 6755 /usr/bin/fcrondyn || die mchmod 6755 /usr/bin/fcronsighup || die mchmod 0640 /etc/fcron/fcron.allow || die mchmod 0640 /etc/fcron/fcron.deny || die mchmod 0640 /etc/fcron/fcron.conf || die # temporary disabled, enable it as soon as docbook gets into the tree # # man pages # minstallman doc/man/*.1 || die # minstallman doc/man/*.3 || die # minstallman doc/man/*.5 || die # minstallman doc/man/*.8 || die minstalldocs MANIFEST README VERSION || die } postinstall() { # needed to run fcron touch ${MROOT}/var/log/wtmp mstartservice fcron mstartunit fcron.service echo echo "Each user who uses fcron should be added to the cron group" echo "in /etc/group and also be added in /etc/fcron/fcron.allow" echo echo "To activate /etc/cron.{hourly|daily|weekly|montly} please run: " echo "crontab /etc/crontab" echo echo "To run fcron at system boot please run: " echo "rc-config add fcron" echo echo "!!! That will replace root's current crontab !!!" echo } postremove() { mstopservice fcron mstopunit fcron.service }