summaryrefslogtreecommitdiff
path: root/sys-process/fcron
diff options
context:
space:
mode:
Diffstat (limited to 'sys-process/fcron')
-rw-r--r--sys-process/fcron/Manifest15
-rw-r--r--sys-process/fcron/fcron-3.2.1-r1.ebuild255
-rw-r--r--sys-process/fcron/fcron-3.2.1-r2.ebuild257
-rw-r--r--sys-process/fcron/fcron-3.3.0_beta-r1.ebuild262
-rw-r--r--sys-process/fcron/files/crontab.226
-rw-r--r--sys-process/fcron/files/fcron-3.1.1-noreadline.patch14
-rw-r--r--sys-process/fcron/files/fcron-3.2.1-configure-fix-audit-parameter-check.patch30
-rw-r--r--sys-process/fcron/files/fcron.confd7
-rw-r--r--sys-process/fcron/files/fcron.init-r5100
-rw-r--r--sys-process/fcron/files/fcron.init.498
-rw-r--r--sys-process/fcron/files/fcrontab.24
-rw-r--r--sys-process/fcron/metadata.xml34
12 files changed, 1102 insertions, 0 deletions
diff --git a/sys-process/fcron/Manifest b/sys-process/fcron/Manifest
new file mode 100644
index 000000000000..2b7487cd167f
--- /dev/null
+++ b/sys-process/fcron/Manifest
@@ -0,0 +1,15 @@
+AUX crontab.2 1098 SHA256 c6d72d62aa951895ed80bbe8a857e42c366dd53ea1ca3caa08e9860c10858a8b SHA512 5e1a23ad70fb79275c8a29137284ccb13f1fbb4387ba61875065e003aafe03aeb1709819bf2803a70494f15c42a69883c9c5272219f625e7c5ff53c4459e5d42 WHIRLPOOL 535cb048a51c9241cbe987465fd4680aa91a623f508669e1cf413621e53a7a4a4f954f68920392a4656008f13938c0ea443a9e29af55f9162c9382fb6e0f89ff
+AUX fcron-3.1.1-noreadline.patch 716 SHA256 1c116e76b39895c4f86772011b7e386a529acf5b6e2385aed3e1b0a7421eecbf SHA512 152aaa299abd8ec546dc73ca7527d3162c14cec47cc670d82c7312f0fe64545a2c0c9ed82ae79ee4fe028ca009d37f6f4843e4c2ec6e6ee7cf7e8b97dc61ec71 WHIRLPOOL 4cb21ff9330cbdba72acf129c0c0075a2c063f57093965bad742801daca60d0a3ec522e895ac06ca68c3034667005623543e74775846d23f636e7810fa52a9b5
+AUX fcron-3.2.1-configure-fix-audit-parameter-check.patch 815 SHA256 e260aac334cc748d280e913400a7351d3714e9d7522cdd704732b7ea7c572147 SHA512 c2942a729d584dc72936695b19844951675a98c2783836e7ff3a8e4ea63fe470dc0dadedb83c9737b78978f2c8d4a4af62191ffb27e4ba6817ea4c70c9c2a8b8 WHIRLPOOL 9bd9fce658b1d15cba1f86fdcb8de27c35618a3c0309e90a71935b5f859ad2337285f127398a56e68531843b51bd86dca99a66f2f669f50ee09149ed8d49008e
+AUX fcron.confd 134 SHA256 cf64be3aed14f6649df3b8d2100e097baca4117d81e0a3b93c42f9a65082921c SHA512 58a66cd495fcb6a9b49f1d244357dfd61188a0c09d2c02a93c9250b8d77d9b89aff41d947e25fd4c1248f39b6a97f045e760b52cdf2f065145a8bfe74b7bf25e WHIRLPOOL f447fd79704e7846ec257587711e1a07a69f26a938332224994e6023ae50e6cff10914d47158247c07ca8598f0f2add0b2164c0008afef05d1bd9f3d4c031a93
+AUX fcron.init-r5 2633 SHA256 93c17785049634810c27a07eec7ed50ed2d533572c37d705f69d4b93ce479403 SHA512 bf53158d6326a742fc3af0cdf196f76a2930f61e58c8a7f4488d3a17aa18bdbd12a3258034f649ae9998627caec7c55bf4c392265525a8fa7c6614cc38f2d0e0 WHIRLPOOL 6267ca831a4671e874d1621fcca33295ad18534db3d2d4260bb8303195acab74d7e788328966655123cf3a0bd0e29c9ea5231156d7d350dc7c626694acf71094
+AUX fcron.init.4 2589 SHA256 e193623b14a421fba86f0f5f10d6ac95de02d27239b117050a1eeccabe08aa06 SHA512 6f5197e979333eabe6fbe7c3c44488db6e82067037d2de37b28c791467ecd27c3df7b4fda0b04f1d04929e7a643d76c42f5d0af64256b9dff7848ef892775e0d WHIRLPOOL 6df1db86f7c676bef48884d4d9794bd699bd5808edcaf404058952cbedd153e467fdf7d1d5cd8b8a56cef75cf093a458f8a0afd400be2369ff85985d5605aa3b
+AUX fcrontab.2 226 SHA256 7c57c8033cb78c0522ec79c88b7e88b953df9250eb9eeb714f6e9f7061733a4e SHA512 f0c74c2cd601750f7de8d9926278bd79026b236f2bda4033fe1961c48171b3aa3712bd8d8917f9c784bf0ce54ed09781572cb7e9397d9579a8ba6a114c1e5c2e WHIRLPOOL 083677d9f35d7c96b540a7691b72bfe5e52005371811f9a860a878af6f635792394a5feae81acd8f52d0364f53d04046a8b8067fe60d23e4c4837d5046d2af4b
+DIST fcron-3.2.1.src.tar.gz 601142 SHA256 6114d0a39a32853669c0c0ba0f96d92920e7cabca3ff1edf37d25750403e5f6a SHA512 ddfd3e3a297b843c924aacccffaa5c1c6b300497f39daa1cdb90dc4cf4bc757042b0b2c1f055c119c8128c64d830ee0e8757091610432f5ffcacca25d369e5cd WHIRLPOOL 39b44f88b09be40705ca5d1f421aa4bff6d9a00fbcb572b9012fb1dd65a24c3b1b746196e722bc544a6c0db062625d9981c60956a7fb7c34e6cb630202bd5a2b
+DIST fcron-3.3.0_beta.tar.gz 592481 SHA256 9aead33a0926e2eec123698c502114c6d67b483fe1ec232969fae6809b0bab60 SHA512 e5b76e23af774997d9ee1ef58d17009cea95d10b19a2d22b550b178a39bb7c439c055b440eb99c4286db6622901e5deb029318e4425e8cd098766452ffc15bc6 WHIRLPOOL ec814a8d23263539623ef6f3415313b80f22353c5ca72d556a537e4c46ca98818dbebf79966138c1de9e1f071478e782e01d9e3139fc9b75e981b3807e069a91
+EBUILD fcron-3.2.1-r1.ebuild 6952 SHA256 e2c709db6fdfb6b1d4e648635b6ed213d6004d1c5e8e12c167b3b002da74c6bb SHA512 79304f14e5cfad7741fd9cb467bd80da28f5bea49b019b849412f931a9edbdf2a54444bf534ef2a48e150def03ce1fea666ca4041cae5b645bc884513dd3d572 WHIRLPOOL 374e21b6123346d9918a102d93f10fb81d4bf0ad29a0fe49af77bfc823aa391fd6dc6b70d06aa0fd32ab535fa495926f6a30040336c6014e3412eb31941df0b9
+EBUILD fcron-3.2.1-r2.ebuild 7004 SHA256 179eb78dddeec98ced35838d0fad1c214f8ca11a64cb2133faedb1d481b362a2 SHA512 aa53fe077985dcc8bc9f86f06ba0897d4f46c1a9725f702a519e0dec4ddcd1d792ef8ce0cd1a38c56aa0a4453a76ba5c0e614766e001d4e09eb6afc8dde9b02b WHIRLPOOL 47d720a788fb71760ebf54ed4f3dcdbe1dcd3a15a6517a30914e3bf9dc7dc3a4d583980a71992f05a9ff058e5cc8042da25661138059bba451d28fa19ac9809c
+EBUILD fcron-3.3.0_beta-r1.ebuild 7023 SHA256 89434869bd5693cca5d778225cee88f7f1c7b4f448852610ce011903d8bff2f6 SHA512 8de93d73933bcbd232083d2a498f2d90e3c6c026a32566489cb7a8347e992170cf79dd65f373185eef71f3575194716e0b884233f138a8fc34cebbe47c5492db WHIRLPOOL 401bc18f7600517d4fa438b59c8e5997fef8f5db5fad35b64307fe8ce8f50ef35502646e0491b91282e059b6a04200520779c42cdeba6353bd76494f121c0431
+MISC ChangeLog 6268 SHA256 6a2fe8d899feefcfb8ca8a240186be4de485dc068661a9e7fe8f500bec8e33dc SHA512 ec64179d883d38aeb4782280827574a2de7ab6948d2be39f15e95e124d45bfa2d65a6a41f65ac2832a79c716ce424b9938441a47eaa6968c86bdee9b02b075c8 WHIRLPOOL 34c33d520fd71f5d45b7657daec18b20a8869f3710047d0b95d57ec92716b6a86a639f0dda645b56e044b4d86b5dde60d29691391955188c0aa5996c847d2c52
+MISC ChangeLog-2015 25652 SHA256 63ac3dad65cc0d7211853ba2248555e193f17b4dea770c48428b81874cf9da6f SHA512 35bf788f3e3d7a21a3d0a25cbd3ca1f1f861acff7146a4f3207895d924a78d1cdf2e64e049de30ec5f7065fbf2958b3cc8938407dcf1b5c9d97156cf14c735bb WHIRLPOOL 72a37a77efc9825aaac85436ed32622719cb48c1068343c68f204e3219ce42b46d6ee6db22d89fae4430e584a1a052e8a18de38d29a9e3d697fd3258c58b5fa8
+MISC metadata.xml 1207 SHA256 00cad944882d88cc0faf3c18bef4bdb2394787c5a7ba752e2add3736b0d238c6 SHA512 ebaa6621585af97981630fba9dfcb9821c7538c11a82b2240b05eaf08460ea2227a3b94aa88eb9e286cac6eb436c6d95ddaa3cf4bed4804c1759c37a0e171c35 WHIRLPOOL 99bbc801a5ef969cf17aec0cc993118436d65b72df17e98369345458b934fcae7c019f5078b306880aa06cbf9d5f91efbcb54b9791cc28e65d1d8ea860116383
diff --git a/sys-process/fcron/fcron-3.2.1-r1.ebuild b/sys-process/fcron/fcron-3.2.1-r1.ebuild
new file mode 100644
index 000000000000..810739795fae
--- /dev/null
+++ b/sys-process/fcron/fcron-3.2.1-r1.ebuild
@@ -0,0 +1,255 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+WANT_AUTOMAKE=none
+
+inherit cron pam flag-o-matic user autotools versionator systemd
+
+DESCRIPTION="A command scheduler with extended capabilities over cron and anacron"
+HOMEPAGE="http://fcron.free.fr/"
+SRC_URI="http://fcron.free.fr/archives/${P}.src.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd"
+IUSE="audit debug pam selinux l10n_fr +mta +system-crontab readline"
+
+DEPEND="audit? ( sys-process/audit )
+ pam? ( virtual/pam )
+ readline? ( sys-libs/readline:= )
+ selinux? ( sys-libs/libselinux )"
+
+RDEPEND="${DEPEND}
+ app-misc/editor-wrapper
+ mta? ( virtual/mta )
+ pam? ( sys-auth/pambase )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.1.1-noreadline.patch
+ "${FILESDIR}"/${PN}-3.2.1-configure-fix-audit-parameter-check.patch
+)
+
+pkg_setup() {
+ enewgroup fcron
+ enewuser fcron -1 -1 -1 fcron
+ rootuser=$(egetent passwd 0 | cut -d ':' -f 1)
+ [[ ${rootuser} ]] || rootuser=root
+ rootgroup=$(egetent group 0 | cut -d ':' -f 1)
+ [[ ${rootgroup} ]] || rootgroup=root
+}
+
+src_prepare() {
+ default
+
+ # respect LDFLAGS
+ sed -i "s:\(@LIBS@\):\$(LDFLAGS) \1:" Makefile.in || die "sed failed"
+
+ # Adjust fcrontab path
+ sed -i -e 's:/etc/fcrontab:/etc/fcron/fcrontab:' script/check_system_crontabs.sh || die
+
+ mv configure.in configure.ac || die
+
+ cp "${FILESDIR}"/crontab.2 "${WORKDIR}"/crontab || die
+
+ eautoconf
+}
+
+src_configure() {
+ # Don't try to pass --with-debug as it'll play with cflags as
+ # well, and run foreground which is a _very_ nasty idea for
+ # Gentoo.
+ use debug && append-cppflags -DDEBUG
+
+ # bindir is used just for calling fcronsighup
+ econf \
+ --with-cflags="${CFLAGS}" \
+ --bindir=/usr/libexec \
+ --sbindir=/usr/libexec \
+ $(use_with audit) \
+ $(use_with mta sendmail) \
+ $(use_with pam) \
+ $(use_with readline) \
+ $(use_with selinux) \
+ --sysconfdir=/etc/fcron \
+ --with-username=fcron \
+ --with-groupname=fcron \
+ --with-piddir=/run \
+ --with-spooldir=/var/spool/fcron \
+ --with-fifodir=/run \
+ --with-fcrondyn=yes \
+ --disable-checks \
+ --with-editor=/usr/libexec/editor \
+ --with-shell=/bin/sh \
+ --without-db2man \
+ --without-dsssl-dir \
+ --with-rootname=${rootuser} \
+ --with-rootgroup=${rootgroup} \
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+}
+
+src_compile() {
+ default
+
+ # bug #216460
+ sed -i \
+ -e 's:/usr/local/etc/fcron:/etc/fcron/fcron:g' \
+ -e 's:/usr/local/etc:/etc:g' \
+ -e 's:/usr/local/:/usr/:g' \
+ doc/*/*/*.{txt,1,5,8,html} \
+ || die "unable to fix documentation references"
+}
+
+src_install() {
+ keepdir /var/spool/fcron
+
+ exeinto /usr/libexec
+ doexe fcron fcronsighup
+
+ dobin fcrondyn fcrontab
+
+ insinto /etc/fcron
+ doins files/fcron.{allow,deny,conf}
+
+ if use system-crontab; then
+ dosym fcrontab /usr/bin/crontab
+
+ exeinto /usr/libexec
+ newexe script/check_system_crontabs.sh check_system_crontabs
+
+ insinto /etc/fcron
+ newins "${FILESDIR}"/fcrontab.2 fcrontab
+
+ fowners ${rootuser}:fcron /etc/fcron/fcrontab
+ fperms 0640 /etc/fcron/fcrontab
+
+ insinto /etc
+ newins "${FILESDIR}"/crontab.2 crontab
+ fi
+
+ fowners fcron:fcron \
+ /var/spool/fcron \
+ /usr/bin/fcron{dyn,tab}
+
+ # fcronsighup needs to be suid root, because it sends a HUP to the
+ # running fcron daemon, but only has to be called by the fcron group
+ # anyway
+ fowners ${rootuser}:fcron \
+ /usr/libexec/fcronsighup \
+ /etc/fcron/fcron.{allow,deny,conf} \
+ /etc/fcron
+
+ fperms 6770 /var/spool/fcron
+ fperms 6775 /usr/bin/fcron{dyn,tab}
+
+ fperms 4710 /usr/libexec/fcronsighup
+
+ fperms 0750 /etc/fcron
+ fperms 0640 /etc/fcron/fcron.{allow,deny,conf}
+
+ pamd_mimic system-services fcron auth account session
+ cat > "${T}"/fcrontab.pam <<- EOF
+ # Don't ask for the user's password; fcrontab will only allow to
+ # change user if running as root.
+ auth sufficient pam_permit.so
+
+ # Still use the system-auth stack for account and session as the
+ # sysadmin might have set up stuff properly, and also avoids
+ # sidestepping limits (since fcrontab will run \$EDITOR).
+ account include system-auth
+ session include system-auth
+ EOF
+ newpamd "${T}"/fcrontab.pam fcrontab
+
+ newinitd "${FILESDIR}"/fcron.init.4 fcron
+ systemd_newunit "${S}/script/fcron.init.systemd" fcron.service
+
+ local DOCS=( MANIFEST VERSION "${WORKDIR}/crontab")
+ DOCS+=( doc/en/txt/{readme,thanks,faq,todo,relnotes,changes}.txt )
+
+ local HTML_DOCS=( doc/en/HTML/. )
+
+ einstalldocs
+
+ newdoc files/fcron.conf fcron.conf.sample
+ doman doc/en/man/*.{1,5,8}
+
+ for lang in fr; do
+ use l10n_${lang} || continue
+
+ doman -i18n=${lang} doc/${lang}/man/*.{1,5,8}
+
+ docinto html/${lang}
+ dodoc -r doc/${lang}/HTML/.
+ done
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ # This is a new installation
+ elog "Make sure you execute"
+ elog ""
+ elog " # emerge --config ${CATEGORY}/${PN}"
+ elog ""
+ elog "to install the default systab on this system."
+ else
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least "3.2.1" ${v}; then
+ # This is an upgrade
+
+ elog "fcron's default systab was updated since your last installation."
+ elog "You can use"
+ elog ""
+ elog " # emerge --config ${CATEGORY}/${PN}"
+ elog ""
+ elog "to re-install systab (do not call this command before you"
+ elog "have merged your configuration files)."
+
+ # Show this elog only once
+ break
+ fi
+ done
+ fi
+
+ if ! use system-crontab; then
+ echo ""
+ ewarn "Remember that fcron will *not* use /etc/cron.d in this configuration"
+ ewarn "due to USE=-system-crontab!"
+ echo ""
+ fi
+}
+
+pkg_config() {
+ if [[ $(fcrontab -l -u systab 2>/dev/null) ]]; then
+ eerror "We're not going to make any change to your systab as long as"
+ eerror "it contains data; please clear it before proceeding."
+ eerror "You can do that with"
+ eerror ""
+ eerror " # fcrontab -u systab -r"
+ eerror ""
+ eerror "However you are advised to do this by hand to review existing"
+ eerror "systab just in case."
+ return 1
+ fi
+
+ if use system-crontab; then
+ elog "This is going to set up fcron to execute check_system_crontabs."
+ elog "In this configuration, /etc/crontab and /etc/cron.d are respected."
+ elog "Per default fcron will check for modifications every 10 minutes."
+ /usr/libexec/check_system_crontabs -v -i -f
+ else
+ elog "This is going to set up fcron to set up a default systab that"
+ elog "executes /etc/cron.{hourly,daily,weekly,monthly} but will ignore"
+ elog "/etc/crontab and /etc/cron.d."
+ fcrontab -u systab - <<- EOF
+ !serial(true)
+ 00 * * * * /bin/rm -f /var/spool/cron/lastrun/cron.hourly
+ 00 00 * * * /bin/rm -f /var/spool/cron/lastrun/cron.daily
+ 00 00 * * 6 /bin/rm -f /var/spool/cron/lastrun/cron.weekly
+ 00 00 1 * * /bin/rm -f /var/spool/cron/lastrun/cron.monthly
+ */10 * * * * /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons
+ !serial(false)
+ EOF
+ fi
+}
diff --git a/sys-process/fcron/fcron-3.2.1-r2.ebuild b/sys-process/fcron/fcron-3.2.1-r2.ebuild
new file mode 100644
index 000000000000..604e9afb710b
--- /dev/null
+++ b/sys-process/fcron/fcron-3.2.1-r2.ebuild
@@ -0,0 +1,257 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+WANT_AUTOMAKE=none
+
+inherit cron pam flag-o-matic user autotools versionator systemd
+
+DESCRIPTION="A command scheduler with extended capabilities over cron and anacron"
+HOMEPAGE="http://fcron.free.fr/"
+SRC_URI="http://fcron.free.fr/archives/${P}.src.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd"
+IUSE="audit debug pam selinux l10n_fr +mta +system-crontab readline"
+
+DEPEND="audit? ( sys-process/audit )
+ pam? ( virtual/pam )
+ readline? ( sys-libs/readline:= )
+ selinux? ( sys-libs/libselinux )"
+
+RDEPEND="${DEPEND}
+ app-misc/editor-wrapper
+ mta? ( virtual/mta )
+ pam? ( sys-auth/pambase )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.1.1-noreadline.patch
+ "${FILESDIR}"/${PN}-3.2.1-configure-fix-audit-parameter-check.patch
+)
+
+pkg_setup() {
+ enewgroup fcron
+ enewuser fcron -1 -1 -1 fcron
+ rootuser=$(egetent passwd 0 | cut -d ':' -f 1)
+ [[ ${rootuser} ]] || rootuser=root
+ rootgroup=$(egetent group 0 | cut -d ':' -f 1)
+ [[ ${rootgroup} ]] || rootgroup=root
+}
+
+src_prepare() {
+ default
+
+ # respect LDFLAGS
+ sed -i "s:\(@LIBS@\):\$(LDFLAGS) \1:" Makefile.in || die "sed failed"
+
+ # Adjust fcrontab path
+ sed -i -e 's:/etc/fcrontab:/etc/fcron/fcrontab:' script/check_system_crontabs.sh || die
+
+ mv configure.in configure.ac || die
+
+ cp "${FILESDIR}"/crontab.2 "${WORKDIR}"/crontab || die
+
+ eautoconf
+}
+
+src_configure() {
+ # Don't try to pass --with-debug as it'll play with cflags as
+ # well, and run foreground which is a _very_ nasty idea for
+ # Gentoo.
+ use debug && append-cppflags -DDEBUG
+
+ # bindir is used just for calling fcronsighup
+ econf \
+ --with-cflags="${CFLAGS}" \
+ --bindir=/usr/libexec \
+ --sbindir=/usr/libexec \
+ $(use_with audit) \
+ $(use_with mta sendmail) \
+ $(use_with pam) \
+ $(use_with readline) \
+ $(use_with selinux) \
+ --sysconfdir=/etc/fcron \
+ --with-username=fcron \
+ --with-groupname=fcron \
+ --with-piddir=/run \
+ --with-spooldir=/var/spool/fcron \
+ --with-fifodir=/run \
+ --with-fcrondyn=yes \
+ --disable-checks \
+ --with-editor=/usr/libexec/editor \
+ --with-shell=/bin/sh \
+ --without-db2man \
+ --without-dsssl-dir \
+ --with-rootname=${rootuser} \
+ --with-rootgroup=${rootgroup} \
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+}
+
+src_compile() {
+ default
+
+ # bug #216460
+ sed -i \
+ -e 's:/usr/local/etc/fcron:/etc/fcron/fcron:g' \
+ -e 's:/usr/local/etc:/etc:g' \
+ -e 's:/usr/local/:/usr/:g' \
+ doc/*/*/*.{txt,1,5,8,html} \
+ || die "unable to fix documentation references"
+}
+
+src_install() {
+ keepdir /var/spool/fcron
+
+ exeinto /usr/libexec
+ doexe fcron fcronsighup
+
+ dobin fcrondyn fcrontab
+
+ insinto /etc/fcron
+ doins files/fcron.{allow,deny,conf}
+
+ if use system-crontab; then
+ dosym fcrontab /usr/bin/crontab
+
+ exeinto /usr/libexec
+ newexe script/check_system_crontabs.sh check_system_crontabs
+
+ insinto /etc/fcron
+ newins "${FILESDIR}"/fcrontab.2 fcrontab
+
+ fowners ${rootuser}:fcron /etc/fcron/fcrontab
+ fperms 0640 /etc/fcron/fcrontab
+
+ insinto /etc
+ newins "${FILESDIR}"/crontab.2 crontab
+ fi
+
+ fowners fcron:fcron \
+ /var/spool/fcron \
+ /usr/bin/fcron{dyn,tab}
+
+ # fcronsighup needs to be suid root, because it sends a HUP to the
+ # running fcron daemon, but only has to be called by the fcron group
+ # anyway
+ fowners ${rootuser}:fcron \
+ /usr/libexec/fcronsighup \
+ /etc/fcron/fcron.{allow,deny,conf} \
+ /etc/fcron
+
+ fperms 6770 /var/spool/fcron
+ fperms 6775 /usr/bin/fcron{dyn,tab}
+
+ fperms 4710 /usr/libexec/fcronsighup
+
+ fperms 0750 /etc/fcron
+ fperms 0640 /etc/fcron/fcron.{allow,deny,conf}
+
+ pamd_mimic system-services fcron auth account session
+ cat > "${T}"/fcrontab.pam <<- EOF
+ # Don't ask for the user's password; fcrontab will only allow to
+ # change user if running as root.
+ auth sufficient pam_permit.so
+
+ # Still use the system-auth stack for account and session as the
+ # sysadmin might have set up stuff properly, and also avoids
+ # sidestepping limits (since fcrontab will run \$EDITOR).
+ account include system-auth
+ session include system-auth
+ EOF
+ newpamd "${T}"/fcrontab.pam fcrontab
+
+ newinitd "${FILESDIR}"/fcron.init-r5 fcron
+ systemd_newunit "${S}/script/fcron.init.systemd" fcron.service
+
+ newconfd "${FILESDIR}"/fcron.confd fcron
+
+ local DOCS=( MANIFEST VERSION "${WORKDIR}/crontab")
+ DOCS+=( doc/en/txt/{readme,thanks,faq,todo,relnotes,changes}.txt )
+
+ local HTML_DOCS=( doc/en/HTML/. )
+
+ einstalldocs
+
+ newdoc files/fcron.conf fcron.conf.sample
+ doman doc/en/man/*.{1,5,8}
+
+ for lang in fr; do
+ use l10n_${lang} || continue
+
+ doman -i18n=${lang} doc/${lang}/man/*.{1,5,8}
+
+ docinto html/${lang}
+ dodoc -r doc/${lang}/HTML/.
+ done
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ # This is a new installation
+ elog "Make sure you execute"
+ elog ""
+ elog " # emerge --config ${CATEGORY}/${PN}"
+ elog ""
+ elog "to install the default systab on this system."
+ else
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least "3.2.1" ${v}; then
+ # This is an upgrade
+
+ elog "fcron's default systab was updated since your last installation."
+ elog "You can use"
+ elog ""
+ elog " # emerge --config ${CATEGORY}/${PN}"
+ elog ""
+ elog "to re-install systab (do not call this command before you"
+ elog "have merged your configuration files)."
+
+ # Show this elog only once
+ break
+ fi
+ done
+ fi
+
+ if ! use system-crontab; then
+ echo ""
+ ewarn "Remember that fcron will *not* use /etc/cron.d in this configuration"
+ ewarn "due to USE=-system-crontab!"
+ echo ""
+ fi
+}
+
+pkg_config() {
+ if [[ $(fcrontab -l -u systab 2>/dev/null) ]]; then
+ eerror "We're not going to make any change to your systab as long as"
+ eerror "it contains data; please clear it before proceeding."
+ eerror "You can do that with"
+ eerror ""
+ eerror " # fcrontab -u systab -r"
+ eerror ""
+ eerror "However you are advised to do this by hand to review existing"
+ eerror "systab just in case."
+ return 1
+ fi
+
+ if use system-crontab; then
+ elog "This is going to set up fcron to execute check_system_crontabs."
+ elog "In this configuration, /etc/crontab and /etc/cron.d are respected."
+ elog "Per default fcron will check for modifications every 10 minutes."
+ /usr/libexec/check_system_crontabs -v -i -f
+ else
+ elog "This is going to set up fcron to set up a default systab that"
+ elog "executes /etc/cron.{hourly,daily,weekly,monthly} but will ignore"
+ elog "/etc/crontab and /etc/cron.d."
+ fcrontab -u systab - <<- EOF
+ !serial(true)
+ 00 * * * * /bin/rm -f /var/spool/cron/lastrun/cron.hourly
+ 00 00 * * * /bin/rm -f /var/spool/cron/lastrun/cron.daily
+ 00 00 * * 6 /bin/rm -f /var/spool/cron/lastrun/cron.weekly
+ 00 00 1 * * /bin/rm -f /var/spool/cron/lastrun/cron.monthly
+ */10 * * * * /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons
+ !serial(false)
+ EOF
+ fi
+}
diff --git a/sys-process/fcron/fcron-3.3.0_beta-r1.ebuild b/sys-process/fcron/fcron-3.3.0_beta-r1.ebuild
new file mode 100644
index 000000000000..10f03c92f516
--- /dev/null
+++ b/sys-process/fcron/fcron-3.3.0_beta-r1.ebuild
@@ -0,0 +1,262 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+WANT_AUTOMAKE=none
+
+inherit cron pam flag-o-matic user autotools versionator systemd
+
+MY_PV=${PV/_beta/}
+MY_P=${PN}-${MY_PV}
+
+DESCRIPTION="A command scheduler with extended capabilities over cron and anacron"
+HOMEPAGE="http://fcron.free.fr/"
+SRC_URI="http://fcron.free.fr/archives/${MY_P}.src.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS=""
+IUSE="audit debug pam selinux l10n_fr +mta +system-crontab readline"
+
+DEPEND="audit? ( sys-process/audit )
+ pam? ( virtual/pam )
+ readline? ( sys-libs/readline:= )
+ selinux? ( sys-libs/libselinux )"
+
+RDEPEND="${DEPEND}
+ app-misc/editor-wrapper
+ mta? ( virtual/mta )
+ pam? ( sys-auth/pambase )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.1.1-noreadline.patch
+ "${FILESDIR}"/${PN}-3.2.1-configure-fix-audit-parameter-check.patch
+)
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ enewgroup fcron
+ enewuser fcron -1 -1 -1 fcron
+ rootuser=$(egetent passwd 0 | cut -d ':' -f 1)
+ [[ ${rootuser} ]] || rootuser=root
+ rootgroup=$(egetent group 0 | cut -d ':' -f 1)
+ [[ ${rootgroup} ]] || rootgroup=root
+}
+
+src_prepare() {
+ default
+
+ # respect LDFLAGS
+ sed -i "s:\(@LIBS@\):\$(LDFLAGS) \1:" Makefile.in || die "sed failed"
+
+ # Adjust fcrontab path
+ sed -i -e 's:/etc/fcrontab:/etc/fcron/fcrontab:' script/check_system_crontabs.sh || die
+
+ mv configure.in configure.ac || die
+
+ cp "${FILESDIR}"/crontab.2 "${WORKDIR}"/crontab || die
+
+ eautoconf
+}
+
+src_configure() {
+ # Don't try to pass --with-debug as it'll play with cflags as
+ # well, and run foreground which is a _very_ nasty idea for
+ # Gentoo.
+ use debug && append-cppflags -DDEBUG
+
+ # bindir is used just for calling fcronsighup
+ econf \
+ --with-cflags="${CFLAGS}" \
+ --bindir=/usr/libexec \
+ --sbindir=/usr/libexec \
+ $(use_with audit) \
+ $(use_with mta sendmail) \
+ $(use_with pam) \
+ $(use_with readline) \
+ $(use_with selinux) \
+ --sysconfdir=/etc/fcron \
+ --with-username=fcron \
+ --with-groupname=fcron \
+ --with-piddir=/run \
+ --with-spooldir=/var/spool/fcron \
+ --with-fifodir=/run \
+ --with-fcrondyn=yes \
+ --disable-checks \
+ --with-editor=/usr/libexec/editor \
+ --with-shell=/bin/sh \
+ --without-db2man \
+ --without-dsssl-dir \
+ --with-rootname=${rootuser} \
+ --with-rootgroup=${rootgroup} \
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)"
+}
+
+src_compile() {
+ default
+
+ # bug #216460
+ sed -i \
+ -e 's:/usr/local/etc/fcron:/etc/fcron/fcron:g' \
+ -e 's:/usr/local/etc:/etc:g' \
+ -e 's:/usr/local/:/usr/:g' \
+ doc/*/*/*.{txt,1,5,8,html} \
+ || die "unable to fix documentation references"
+}
+
+src_install() {
+ keepdir /var/spool/fcron
+
+ exeinto /usr/libexec
+ doexe fcron fcronsighup
+
+ dobin fcrondyn fcrontab
+
+ insinto /etc/fcron
+ doins files/fcron.{allow,deny,conf}
+
+ if use system-crontab; then
+ dosym fcrontab /usr/bin/crontab
+
+ exeinto /usr/libexec
+ newexe script/check_system_crontabs.sh check_system_crontabs
+
+ insinto /etc/fcron
+ newins "${FILESDIR}"/fcrontab.2 fcrontab
+
+ fowners ${rootuser}:fcron /etc/fcron/fcrontab
+ fperms 0640 /etc/fcron/fcrontab
+
+ insinto /etc
+ newins "${FILESDIR}"/crontab.2 crontab
+ fi
+
+ fowners fcron:fcron \
+ /var/spool/fcron \
+ /usr/bin/fcron{dyn,tab}
+
+ # fcronsighup needs to be suid root, because it sends a HUP to the
+ # running fcron daemon, but only has to be called by the fcron group
+ # anyway
+ fowners ${rootuser}:fcron \
+ /usr/libexec/fcronsighup \
+ /etc/fcron/fcron.{allow,deny,conf} \
+ /etc/fcron
+
+ fperms 6770 /var/spool/fcron
+ fperms 6775 /usr/bin/fcron{dyn,tab}
+
+ fperms 4710 /usr/libexec/fcronsighup
+
+ fperms 0750 /etc/fcron
+ fperms 0640 /etc/fcron/fcron.{allow,deny,conf}
+
+ pamd_mimic system-services fcron auth account session
+ cat > "${T}"/fcrontab.pam <<- EOF
+ # Don't ask for the user's password; fcrontab will only allow to
+ # change user if running as root.
+ auth sufficient pam_permit.so
+
+ # Still use the system-auth stack for account and session as the
+ # sysadmin might have set up stuff properly, and also avoids
+ # sidestepping limits (since fcrontab will run \$EDITOR).
+ account include system-auth
+ session include system-auth
+ EOF
+ newpamd "${T}"/fcrontab.pam fcrontab
+
+ newinitd "${FILESDIR}"/fcron.init-r5 fcron
+ systemd_newunit "${S}/script/fcron.init.systemd" fcron.service
+
+ newconfd "${FILESDIR}"/fcron.confd fcron
+
+ local DOCS=( MANIFEST VERSION "${WORKDIR}/crontab")
+ DOCS+=( doc/en/txt/{readme,thanks,faq,todo,relnotes,changes}.txt )
+
+ local HTML_DOCS=( doc/en/HTML/. )
+
+ einstalldocs
+
+ newdoc files/fcron.conf fcron.conf.sample
+ doman doc/en/man/*.{1,5,8}
+
+ for lang in fr; do
+ use l10n_${lang} || continue
+
+ doman -i18n=${lang} doc/${lang}/man/*.{1,5,8}
+
+ docinto html/${lang}
+ dodoc -r doc/${lang}/HTML/.
+ done
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ # This is a new installation
+ elog "Make sure you execute"
+ elog ""
+ elog " # emerge --config ${CATEGORY}/${PN}"
+ elog ""
+ elog "to install the default systab on this system."
+ else
+ local v
+ for v in ${REPLACING_VERSIONS}; do
+ if ! version_is_at_least "3.2.1" ${v}; then
+ # This is an upgrade
+
+ elog "fcron's default systab was updated since your last installation."
+ elog "You can use"
+ elog ""
+ elog " # emerge --config ${CATEGORY}/${PN}"
+ elog ""
+ elog "to re-install systab (do not call this command before you"
+ elog "have merged your configuration files)."
+
+ # Show this elog only once
+ break
+ fi
+ done
+ fi
+
+ if ! use system-crontab; then
+ echo ""
+ ewarn "Remember that fcron will *not* use /etc/cron.d in this configuration"
+ ewarn "due to USE=-system-crontab!"
+ echo ""
+ fi
+}
+
+pkg_config() {
+ if [[ $(fcrontab -l -u systab 2>/dev/null) ]]; then
+ eerror "We're not going to make any change to your systab as long as"
+ eerror "it contains data; please clear it before proceeding."
+ eerror "You can do that with"
+ eerror ""
+ eerror " # fcrontab -u systab -r"
+ eerror ""
+ eerror "However you are advised to do this by hand to review existing"
+ eerror "systab just in case."
+ return 1
+ fi
+
+ if use system-crontab; then
+ elog "This is going to set up fcron to execute check_system_crontabs."
+ elog "In this configuration, /etc/crontab and /etc/cron.d are respected."
+ elog "Per default fcron will check for modifications every 10 minutes."
+ /usr/libexec/check_system_crontabs -v -i -f
+ else
+ elog "This is going to set up fcron to set up a default systab that"
+ elog "executes /etc/cron.{hourly,daily,weekly,monthly} but will ignore"
+ elog "/etc/crontab and /etc/cron.d."
+ fcrontab -u systab - <<- EOF
+ !serial(true)
+ 00 * * * * /bin/rm -f /var/spool/cron/lastrun/cron.hourly
+ 00 00 * * * /bin/rm -f /var/spool/cron/lastrun/cron.daily
+ 00 00 * * 6 /bin/rm -f /var/spool/cron/lastrun/cron.weekly
+ 00 00 1 * * /bin/rm -f /var/spool/cron/lastrun/cron.monthly
+ */10 * * * * /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons
+ !serial(false)
+ EOF
+ fi
+}
diff --git a/sys-process/fcron/files/crontab.2 b/sys-process/fcron/files/crontab.2
new file mode 100644
index 000000000000..4f2048f03de8
--- /dev/null
+++ b/sys-process/fcron/files/crontab.2
@@ -0,0 +1,26 @@
+# /etc/crontab:
+# This is fcron's special systab and *not* root's crontab!
+
+# Global variables
+SHELL=/bin/bash
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+MAILTO=root
+HOME=/
+
+# "run-crons" from sys-process/cronbase package doesn't allow selective
+# runs like "run-parts" from sys-apps/debianutils. So every time
+# "run-crons" gets executed it loops through
+# /etc/cron.{hourly,daily,weekly,monthly} and executes one after another if
+# lastrun lock file isn't in place.
+# Without fcron's "serial(true)" option it would be possible that a lastrun
+# lock file which should have been removed still exists when "run-crons"
+# starts so that a promptly execution of all cronjobs isn't always
+# guaranteed.
+
+!serial(true)
+00 * * * * /bin/rm -f /var/spool/cron/lastrun/cron.hourly
+00 00 * * * /bin/rm -f /var/spool/cron/lastrun/cron.daily
+00 00 * * 6 /bin/rm -f /var/spool/cron/lastrun/cron.weekly
+00 00 1 * * /bin/rm -f /var/spool/cron/lastrun/cron.monthly
+*/10 * * * * /usr/bin/test -x /usr/sbin/run-crons && /usr/sbin/run-crons
+!serial(false)
diff --git a/sys-process/fcron/files/fcron-3.1.1-noreadline.patch b/sys-process/fcron/files/fcron-3.1.1-noreadline.patch
new file mode 100644
index 000000000000..161e75b0998e
--- /dev/null
+++ b/sys-process/fcron/files/fcron-3.1.1-noreadline.patch
@@ -0,0 +1,14 @@
+Index: fcron-3.1.1/configure.in
+===================================================================
+--- fcron-3.1.1.orig/configure.in
++++ fcron-3.1.1/configure.in
+@@ -86,7 +86,8 @@ AC_FUNC_WAIT3
+ AC_CHECK_LIB(xnet, shutdown)
+ AC_CHECK_LIB(selinux, getcon, [selinuxavail=1], [selinuxavail=0])
+ AC_CHECK_LIB(audit, audit_open, [auditavail=1], [auditavail=0])
+-AX_LIB_READLINE
++AC_ARG_WITH([readline], AS_HELP_STRING([--without-readline], [Build without readline @<:@default=yes@:>@]))
++AS_IF([test "x$with_readline" != "xno"], [AX_LIB_READLINE], [ax_cv_lib_readline=no])
+ AC_CHECK_FUNC(getloadavg, [getloadavg=1], [getloadavg=0])
+ AC_CHECK_LIB(kstat, kstat_open, [kstat=1], [kstat=0])
+ if test $getloadavg -eq 1; then
diff --git a/sys-process/fcron/files/fcron-3.2.1-configure-fix-audit-parameter-check.patch b/sys-process/fcron/files/fcron-3.2.1-configure-fix-audit-parameter-check.patch
new file mode 100644
index 000000000000..b4166ff9d7e3
--- /dev/null
+++ b/sys-process/fcron/files/fcron-3.2.1-configure-fix-audit-parameter-check.patch
@@ -0,0 +1,30 @@
+From cc7a684862fee31c442c49d6a537d86979c23220 Mon Sep 17 00:00:00 2001
+From: Thomas Deutschmann <whissi@gentoo.org>
+Date: Thu, 17 Nov 2016 17:19:35 +0100
+Subject: [PATCH] configure: Fix --with-audit parameter check
+
+Due to a missing "$" the variable "$useaudit" was never checked for
+0 value with the result that you cannot disable building against
+libaudit.
+
+Gentoo-Bug: https://bugs.gentoo.org/540446
+---
+ configure.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.in b/configure.in
+index 7e7634f..708d1dd 100644
+--- a/configure.in
++++ b/configure.in
+@@ -822,7 +822,7 @@ AC_ARG_WITH(audit,
+ ;;
+ esac ]
+ )
+-if test useaudit = "0"; then
++if test "$useaudit" = 0; then
+ AC_MSG_RESULT(no)
+ elif test "$useaudit" = "1" && test "$auditavail" != 1; then
+ useaudit=0
+--
+2.10.2
+
diff --git a/sys-process/fcron/files/fcron.confd b/sys-process/fcron/files/fcron.confd
new file mode 100644
index 000000000000..ea907d8e80b7
--- /dev/null
+++ b/sys-process/fcron/files/fcron.confd
@@ -0,0 +1,7 @@
+# /etc/conf.d/fcron
+
+# Options to fcron
+# See fcron(8) for more details
+# Notes:
+# * Do not specify another CONFIGFILE
+#FCRON_OPTS=""
diff --git a/sys-process/fcron/files/fcron.init-r5 b/sys-process/fcron/files/fcron.init-r5
new file mode 100644
index 000000000000..4021cb2fbb3e
--- /dev/null
+++ b/sys-process/fcron/files/fcron.init-r5
@@ -0,0 +1,100 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+FCRON_INSTANCE="${SVCNAME##*.}"
+FCRON_OPTS=${FCRON_OPTS:-""}
+
+if [ -n "${FCRON_INSTANCE}" ] && [ "${SVCNAME}" != "fcron" ]; then
+ FCRON_CONFIGFILE="/etc/fcron/fcron.${FCRON_INSTANCE}.conf"
+else
+ FCRON_CONFIGFILE="/etc/fcron/fcron.conf"
+fi
+
+getconfig() {
+ local key="$1"
+ local value_default="$2"
+ local value=
+
+ if service_started; then
+ value="$(service_get_value "${key}")"
+ fi
+
+ if [ -z "${value}" ] && [ -r "${FCRON_CONFIGFILE}" ]; then
+ value="$(sed -n -e 's:^'"${key}"'[ \t]*=[ \t]*::p' "${FCRON_CONFIGFILE}")"
+ fi
+
+ if [ -z "${value}" ]; then
+ # Value not explicitly set in the configfile or configfile does not exist
+ # or is not readable
+ echo "${value_default}"
+ else
+ echo "${value}"
+ fi
+
+ return 0
+}
+
+depend() {
+ config "${FCRON_CONFIGFILE}"
+
+ use clock logger
+ need hostname
+
+ # provide the cron service if we are the main instance
+ [ "${SVCNAME}" = "fcron" ] && provide cron
+}
+
+
+command="/usr/libexec/fcron"
+command_args="${FCRON_OPTS} -c \"${FCRON_CONFIGFILE}\""
+start_stop_daemon_args=${FCRON_SSDARGS:-"--wait 1000"}
+pidfile="$(getconfig pidfile /run/fcron.pid)"
+fcrontabs="$(getconfig fcrontabs /var/spool/fcron)"
+fifofile="$(getconfig fifofile /run/fcron.fifo)"
+required_files="${FCRON_CONFIGFILE}"
+
+extra_started_commands="reload"
+
+reload() {
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+}
+
+start_pre() {
+ if [ "${SVCNAME}" != "fcron" ]; then
+ local _has_invalid_instance_cfg=0
+
+ if [ "${pidfile}" = "/run/fcron.pid" ]; then
+ eerror "You cannot use the same pidfile like the default instance!"
+ eerror "Please adjust your 'pidfile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fcrontabs}" = "/var/spool/fcron" ]; then
+ eerror "You cannot use the same fcrontabs location like the default instance!"
+ eerror "Please adjust your 'fcrontabs' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fifofile}" = "/run/fcron.fifo" ]; then
+ eerror "You cannot use the same fifo file like the default instance!"
+ eerror "Please adjust your 'fifofile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ [ ${_has_invalid_instance_cfg} -ne 0 ] && return 1
+ fi
+
+ checkpath --file "${FCRON_CONFIGFILE}" --owner root:fcron --mode 0640
+
+ if [ ! -d "${fcrontabs}" ]; then
+ ebegin "Creating missing spooldir '${fcrontabs}'"
+ ${command} --newspooldir "${fcrontabs}"
+ eend $?
+ fi
+}
+
+start_post() {
+ service_set_value fcrontabs "${fcrontabs}"
+ service_set_value fifofile "${fifofile}"
+}
diff --git a/sys-process/fcron/files/fcron.init.4 b/sys-process/fcron/files/fcron.init.4
new file mode 100644
index 000000000000..e253e5bffcfe
--- /dev/null
+++ b/sys-process/fcron/files/fcron.init.4
@@ -0,0 +1,98 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+FCRON_INSTANCE="${SVCNAME##*.}"
+
+if [ -n "${FCRON_INSTANCE}" ] && [ "${SVCNAME}" != "fcron" ]; then
+ FCRON_CONFIGFILE="/etc/fcron/fcron.${FCRON_INSTANCE}.conf"
+else
+ FCRON_CONFIGFILE="/etc/fcron/fcron.conf"
+fi
+
+getconfig() {
+ local key="$1"
+ local value_default="$2"
+ local value=
+
+ if service_started; then
+ value="$(service_get_value "${key}")"
+ fi
+
+ if [ -z "${value}" ] && [ -r "${FCRON_CONFIGFILE}" ]; then
+ value="$(sed -n -e 's:^'"${key}"'[ \t]*=[ \t]*::p' "${FCRON_CONFIGFILE}")"
+ fi
+
+ if [ -z "${value}" ]; then
+ # Value not explicitly set in the configfile or configfile does not exist
+ # or is not readable
+ echo "${value_default}"
+ else
+ echo "${value}"
+ fi
+
+ return 0
+}
+
+depend() {
+ config "${FCRON_CONFIGFILE}"
+
+ use clock logger
+ need hostname
+
+ # provide the cron service if we are the main instance
+ [ "${SVCNAME}" = "fcron" ] && provide cron
+}
+
+command="/usr/libexec/fcron"
+command_args="-c \"${FCRON_CONFIGFILE}\""
+start_stop_daemon_args=${FCRON_SSDARGS:-"--wait 1000"}
+pidfile="$(getconfig pidfile /run/fcron.pid)"
+fcrontabs="$(getconfig fcrontabs /var/spool/fcron)"
+fifofile="$(getconfig fifofile /run/fcron.fifo)"
+required_files="${FCRON_CONFIGFILE}"
+
+extra_started_commands="reload"
+
+reload() {
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+}
+
+start_pre() {
+ if [ "${SVCNAME}" != "fcron" ]; then
+ local _has_invalid_instance_cfg=0
+
+ if [ "${pidfile}" = "/run/fcron.pid" ]; then
+ eerror "You cannot use the same pidfile like the default instance!"
+ eerror "Please adjust your 'pidfile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fcrontabs}" = "/var/spool/fcron" ]; then
+ eerror "You cannot use the same fcrontabs location like the default instance!"
+ eerror "Please adjust your 'fcrontabs' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ if [ "${fifofile}" = "/run/fcron.fifo" ]; then
+ eerror "You cannot use the same fifo file like the default instance!"
+ eerror "Please adjust your 'fifofile' setting in '${FCRON_CONFIGFILE}'."
+ _has_invalid_instance_cfg=1
+ fi
+
+ [ ${_has_invalid_instance_cfg} -ne 0 ] && return 1
+ fi
+
+ checkpath --file "${FCRON_CONFIGFILE}" --owner root:fcron --mode 0640
+
+ if [ ! -d "${fcrontabs}" ]; then
+ ebegin "Creating missing spooldir '${fcrontabs}'"
+ ${command} --newspooldir "${fcrontabs}"
+ eend $?
+ fi
+}
+
+start_post() {
+ service_set_value fcrontabs "${fcrontabs}"
+ service_set_value fifofile "${fifofile}"
+}
diff --git a/sys-process/fcron/files/fcrontab.2 b/sys-process/fcron/files/fcrontab.2
new file mode 100644
index 000000000000..e8c83b5fa3bf
--- /dev/null
+++ b/sys-process/fcron/files/fcrontab.2
@@ -0,0 +1,4 @@
+# Script for checking system crontabs and creating the fcron systab.
+# Runs every 10 minutes, does not mail output, doesn't log job runs
+# except for errors.
+@mail(false),nolog(true) 10 /usr/libexec/check_system_crontabs -s 0
diff --git a/sys-process/fcron/metadata.xml b/sys-process/fcron/metadata.xml
new file mode 100644
index 000000000000..0a8d8d7a3e54
--- /dev/null
+++ b/sys-process/fcron/metadata.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>whissi@gentoo.org</email>
+ <name>Thomas Deutschmann</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>cron-bugs@gentoo.org</email>
+ <name>Gentoo Cron Project</name>
+ </maintainer>
+ <use>
+ <flag name="debug">
+ Enable debug code and output. Since version 3.0.5 this will no
+ longer force foreground execution, and fcron will be able to run
+ as a service properly.
+ </flag>
+ <flag name="mta">
+ Enable mta support for sending emails from fcron
+ </flag>
+ <flag name="pam">
+ Enable PAM support for fcron. This means that fcron will pass
+ through the "fcron" stack before executing the jobs, and
+ fcrontab will use the "fcrontab" stack to authenticate the user
+ before editing its crontab file.
+ </flag>
+ <flag name="system-crontab">
+ Set up fcron to respect /etc/crontab and /etc/cron.d. If this
+ flag is disabled, /etc/cron.d and /etc/crontab will be ignored,
+ but /etc/cron.{hourly,daily,weekly,monthly} will still be
+ respected.
+ </flag>
+ </use>
+</pkgmetadata>