Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-process/cronie/
Date: Sat, 24 Sep 2022 21:20:16
Message-Id: 1664054319.148d949d279f94cfade0bd994b1312aa584e92be.floppym@gentoo
1 commit: 148d949d279f94cfade0bd994b1312aa584e92be
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 24 21:18:39 2022 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 24 21:18:39 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=148d949d
7
8 sys-process/cronie: install /etc/cron.d/0hourly unconditionally
9
10 Closes: https://bugs.gentoo.org/872656
11 Closes: https://bugs.gentoo.org/825026
12 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
13
14 sys-process/cronie/cronie-1.6.1-r2.ebuild | 116 ++++++++++++++++++++++++++++++
15 1 file changed, 116 insertions(+)
16
17 diff --git a/sys-process/cronie/cronie-1.6.1-r2.ebuild b/sys-process/cronie/cronie-1.6.1-r2.ebuild
18 new file mode 100644
19 index 000000000000..18db278ec2e5
20 --- /dev/null
21 +++ b/sys-process/cronie/cronie-1.6.1-r2.ebuild
22 @@ -0,0 +1,116 @@
23 +# Copyright 1999-2022 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +inherit autotools cron flag-o-matic pam systemd
29 +
30 +DESCRIPTION="Cronie is a standard UNIX daemon cron based on the original vixie-cron"
31 +HOMEPAGE="https://github.com/cronie-crond/cronie"
32 +SRC_URI="https://github.com/cronie-crond/cronie/archive/${P}.tar.gz"
33 +
34 +LICENSE="ISC BSD BSD-2 GPL-2"
35 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
36 +IUSE="+anacron +inotify pam selinux"
37 +
38 +DEPEND="
39 + acct-group/crontab
40 + pam? ( sys-libs/pam )
41 + anacron? (
42 + !sys-process/anacron
43 + !sys-process/systemd-cron
44 + elibc_musl? ( sys-libs/obstack-standalone )
45 + )
46 + selinux? ( sys-libs/libselinux )
47 +"
48 +RDEPEND="${DEPEND}
49 + sys-apps/debianutils
50 +"
51 +
52 +#cronie supports /etc/crontab
53 +CRON_SYSTEM_CRONTAB="yes"
54 +
55 +S="${WORKDIR}/${PN}-${P}"
56 +
57 +PATCHES=(
58 + "${FILESDIR}/${PN}-1.5.3-systemd.patch"
59 +)
60 +
61 +src_prepare() {
62 + default
63 + eautoreconf
64 +}
65 +
66 +src_configure() {
67 + local myeconfargs=(
68 + $(use_with inotify)
69 + $(use_with pam)
70 + $(use_with selinux)
71 + $(use_enable anacron)
72 + --enable-syscrontab
73 + # Required for correct pidfile location #835814
74 + --runstatedir="${EPREFIX}/run"
75 + --with-daemon_username=cron
76 + --with-daemon_groupname=cron
77 + )
78 +
79 + if use anacron ; then
80 + if use elibc_musl ; then
81 + append-cflags "-lobstack"
82 + fi
83 + fi
84 + SPOOL_DIR="/var/spool/cron/crontabs" \
85 + ANACRON_SPOOL_DIR="/var/spool/anacron" \
86 + econf "${myeconfargs[@]}"
87 +}
88 +
89 +src_install() {
90 + default
91 +
92 + docrondir -m 1730 -o root -g crontab
93 + fowners root:crontab /usr/bin/crontab
94 + fperms 2751 /usr/bin/crontab
95 +
96 + newconfd "${S}"/crond.sysconfig ${PN}
97 +
98 + insinto /etc
99 + newins "${FILESDIR}/${PN}-crontab" crontab
100 + newins "${FILESDIR}/${PN}-1.2-cron.deny" cron.deny
101 +
102 + insinto /etc/cron.d
103 + doins contrib/{0hourly,dailyjobs}
104 +
105 + newinitd "${FILESDIR}/${PN}-1.3-initd" ${PN}
106 +
107 + if use pam ; then
108 + newpamd "${FILESDIR}/${PN}-1.4.3-pamd" crond
109 + fi
110 +
111 + systemd_newunit contrib/cronie.systemd cronie.service
112 +
113 + if use anacron ; then
114 + local anacrondir="/var/spool/anacron"
115 + keepdir ${anacrondir}
116 + fowners root:cron ${anacrondir}
117 + fperms 0750 ${anacrondir}
118 +
119 + insinto /etc
120 + doins contrib/anacrontab
121 +
122 + insinto /etc/cron.hourly
123 + doins contrib/0anacron
124 + fperms 0750 /etc/cron.hourly/0anacron
125 + fi
126 +
127 + einstalldocs
128 +}
129 +
130 +pkg_postinst() {
131 + cron_pkg_postinst
132 +
133 + if [[ -n "${REPLACING_VERSIONS}" ]] ; then
134 + ewarn "You should restart ${PN} daemon or else you might experience segfaults"
135 + ewarn "or ${PN} not working reliably anymore."
136 + einfo "(see https://bugs.gentoo.org/557406 for details.)"
137 + fi
138 +}