diff --git a/sys-process/cronie/Manifest b/sys-process/cronie/Manifest new file mode 100644 index 0000000000..5b198abb6e --- /dev/null +++ b/sys-process/cronie/Manifest @@ -0,0 +1 @@ +DIST cronie-1.5.2.tar.gz 121604 BLAKE2B 4225439fd13a32bba3bd24f25d7dd405cdb123e666ebbf14574143af9d161867f82ea3fc479d81a884590faaa9c42e19c971285e01a19d6ac793b7deb7fc4775 SHA512 6455e234becc44e6568fa25fd72abfaa293cb0bc2d2f1d124e551c068ba01083192b21e82e941158c8c1f41cb6dad3851d665b9f3baa82fd49080f3f8619740b diff --git a/sys-process/cronie/cronie-1.5.2.ebuild b/sys-process/cronie/cronie-1.5.2.ebuild new file mode 100644 index 0000000000..236870db6e --- /dev/null +++ b/sys-process/cronie/cronie-1.5.2.ebuild @@ -0,0 +1,107 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools cron flag-o-matic pam systemd user + +DESCRIPTION="Cronie is a standard UNIX daemon cron based on the original vixie-cron" +HOMEPAGE="https://github.com/cronie-crond/cronie" +SRC_URI="https://github.com/cronie-crond/cronie/archive/${P}.tar.gz" + +LICENSE="ISC BSD BSD-2 GPL-2" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +IUSE="+anacron +inotify pam selinux" + +DEPEND="pam? ( virtual/pam ) + anacron? ( !sys-process/anacron + elibc_musl? ( sys-libs/obstack-standalone ) + )" +RDEPEND="${DEPEND} + sys-apps/debianutils" + +#cronie supports /etc/crontab +CRON_SYSTEM_CRONTAB="yes" + +S="${WORKDIR}/${PN}-${P}" + +PATCHES=( + "${FILESDIR}/cronie-systemd.patch" +) + +pkg_setup() { + enewgroup crontab +} + +src_prepare() { + default + eautoreconf +} + +src_configure() { + local myeconfargs=( + $(use_with inotify) + $(use_with pam) + $(use_with selinux) + $(use_enable anacron) + --enable-syscrontab + --with-daemon_username=cron + --with-daemon_groupname=cron + ) + + use elibc_musl && append-ldflags "-lobstack" + SPOOL_DIR="/var/spool/cron/crontabs" \ + ANACRON_SPOOL_DIR="/var/spool/anacron" \ + econf "${myeconfargs[@]}" +} + +src_install() { + emake install DESTDIR="${D}" + + docrondir -m 1730 -o root -g crontab + fowners root:crontab /usr/bin/crontab + fperms 2751 /usr/bin/crontab + + newconfd "${S}"/crond.sysconfig ${PN} + + insinto /etc + newins "${FILESDIR}/${PN}-crontab" crontab + newins "${FILESDIR}/${PN}-1.2-cron.deny" cron.deny + + insinto /etc/cron.d + doins contrib/0hourly + + newinitd "${FILESDIR}/${PN}-1.3-initd" ${PN} + newpamd "${FILESDIR}/${PN}-1.4.3-pamd" crond + + systemd_newunit contrib/cronie.systemd cronie.service + + if use anacron ; then + local anacrondir="/var/spool/anacron" + keepdir ${anacrondir} + fowners root:cron ${anacrondir} + fperms 0750 ${anacrondir} + + insinto /etc + doins contrib/anacrontab + + insinto /etc/cron.hourly + doins contrib/0anacron + fperms 0750 /etc/cron.hourly/0anacron + else + insinto /etc/cron.d + doins contrib/dailyjobs + fi + + einstalldocs +} + +pkg_postinst() { + cron_pkg_postinst + + if [[ -n "${REPLACING_VERSIONS}" ]] ; then + ewarn "You should restart ${PN} daemon or else you might experience segfaults" + ewarn "or ${PN} not working reliably anymore." + einfo "(see https://bugs.gentoo.org/557406 for details.)" + fi +} diff --git a/sys-process/cronie/files/cronie-1.2-cron.deny b/sys-process/cronie/files/cronie-1.2-cron.deny new file mode 100644 index 0000000000..f703d5846e --- /dev/null +++ b/sys-process/cronie/files/cronie-1.2-cron.deny @@ -0,0 +1,4 @@ +# If for any reason you have users in the 'cron' group who should not +# be allowed to run crontab, add them to this file (one username per +# line) + diff --git a/sys-process/cronie/files/cronie-1.3-initd b/sys-process/cronie/files/cronie-1.3-initd new file mode 100644 index 0000000000..bf9e38d64d --- /dev/null +++ b/sys-process/cronie/files/cronie-1.3-initd @@ -0,0 +1,13 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +command="/usr/sbin/crond" +command_args="${CRONDARGS}" +pidfile="/var/run/crond.pid" + +depend() { + use clock logger + need localmount + provide cron +} diff --git a/sys-process/cronie/files/cronie-1.4.3-pamd b/sys-process/cronie/files/cronie-1.4.3-pamd new file mode 100644 index 0000000000..e82be8d87f --- /dev/null +++ b/sys-process/cronie/files/cronie-1.4.3-pamd @@ -0,0 +1,9 @@ +# +# The PAM configuration file for the cron daemon +# +# +auth include system-auth +account required pam_access.so +account include system-auth +session required pam_loginuid.so +session include system-auth diff --git a/sys-process/cronie/files/cronie-crontab b/sys-process/cronie/files/cronie-crontab new file mode 100644 index 0000000000..275f06c603 --- /dev/null +++ b/sys-process/cronie/files/cronie-crontab @@ -0,0 +1,17 @@ +# Global variables +SHELL=/bin/bash +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +HOME=/ + +# For details see man 4 crontabs + +# Example of job definition: +# .---------------- minute (0 - 59) +# | .------------- hour (0 - 23) +# | | .---------- day of month (1 - 31) +# | | | .------- month (1 - 12) OR jan,feb,mar,apr ... +# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat +# | | | | | +# * * * * * user-name command to be executed + diff --git a/sys-process/cronie/files/cronie-systemd.patch b/sys-process/cronie/files/cronie-systemd.patch new file mode 100644 index 0000000000..81c1917378 --- /dev/null +++ b/sys-process/cronie/files/cronie-systemd.patch @@ -0,0 +1,30 @@ +From 11d255eb05ae9814c16cd443a7710d99492e16c1 Mon Sep 17 00:00:00 2001 +From: Mike Gilbert +Date: Mon, 13 Jul 2015 10:59:57 -0400 +Subject: [PATCH] Adjust systemd service unit for Gentoo + +--- + contrib/cronie.systemd | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/contrib/cronie.systemd b/contrib/cronie.systemd +index ad46899..7a6c1a9 100644 +--- a/contrib/cronie.systemd ++++ b/contrib/cronie.systemd +@@ -3,10 +3,11 @@ Description=Command Scheduler + After=auditd.service nss-user-lookup.target systemd-user-sessions.service time-sync.target ypbind.service + + [Service] +-EnvironmentFile=/etc/sysconfig/crond +-ExecStart=/usr/sbin/crond -n $CRONDARGS ++ExecStart=/usr/sbin/crond + ExecReload=/bin/kill -HUP $MAINPID + KillMode=process ++Type=forking ++PIDFile=/var/run/crond.pid + + [Install] + WantedBy=multi-user.target +-- +2.4.5 + diff --git a/sys-process/cronie/metadata.xml b/sys-process/cronie/metadata.xml new file mode 100644 index 0000000000..b25dd022b7 --- /dev/null +++ b/sys-process/cronie/metadata.xml @@ -0,0 +1,26 @@ + + + + + polynomial-c@gentoo.org + Lars Wendler + + + cron-bugs@gentoo.org + Gentoo Cron Project + + + Cronie contains the standard UNIX daemon crond that runs specified programs at + scheduled times and related tools. It is based on the original cron and + has security and configuration enhancements like the ability to use pam and + SELinux. + And why cronie? See http://www.urbandictionary.com/define.php?term=cronie + + + Install the periodic anacron command scheduler. + Enable inotify filesystem monitoring support. + + + cronie-crond/cronie + +