xfce-extra/xfce4-mailwatch-plugin: Force GTK+2 exo version
[gentoo.git] / sys-process / cronie / cronie-1.5.4.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 inherit autotools cron flag-o-matic pam systemd user
7
8 DESCRIPTION="Cronie is a standard UNIX daemon cron based on the original vixie-cron"
9 HOMEPAGE="https://github.com/cronie-crond/cronie"
10 SRC_URI="https://github.com/cronie-crond/cronie/archive/${P}.tar.gz"
11
12 LICENSE="ISC BSD BSD-2 GPL-2"
13 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
14 IUSE="+anacron +inotify pam selinux"
15
16 DEPEND="
17         pam? ( virtual/pam )
18         anacron? ( !sys-process/anacron
19                 elibc_musl? ( sys-libs/obstack-standalone )
20         )
21 "
22 RDEPEND="${DEPEND}"
23 BDEPEND="
24         sys-apps/debianutils
25 "
26
27 #cronie supports /etc/crontab
28 CRON_SYSTEM_CRONTAB="yes"
29
30 S="${WORKDIR}/${PN}-${P}"
31
32 PATCHES=(
33         "${FILESDIR}/${PN}-1.5.3-systemd.patch"
34 )
35
36 pkg_setup() {
37         enewgroup crontab
38 }
39
40 src_prepare() {
41         default
42         eautoreconf
43 }
44
45 src_configure() {
46         local myeconfargs=(
47                 $(use_with inotify)
48                 $(use_with pam)
49                 $(use_with selinux)
50                 $(use_enable anacron)
51                 --enable-syscrontab
52                 --with-daemon_username=cron
53                 --with-daemon_groupname=cron
54         )
55
56         if use anacron; then
57                 use elibc_musl && append-cflags "-lobstack"
58         fi
59         SPOOL_DIR="/var/spool/cron/crontabs" \
60         ANACRON_SPOOL_DIR="/var/spool/anacron" \
61         econf "${myeconfargs[@]}"
62 }
63
64 src_install() {
65         default
66
67         docrondir -m 1730 -o root -g crontab
68         fowners root:crontab /usr/bin/crontab
69         fperms 2751 /usr/bin/crontab
70
71         newconfd "${S}"/crond.sysconfig ${PN}
72
73         insinto /etc
74         newins "${FILESDIR}/${PN}-crontab" crontab
75         newins "${FILESDIR}/${PN}-1.2-cron.deny" cron.deny
76
77         insinto /etc/cron.d
78         doins contrib/0hourly
79
80         newinitd "${FILESDIR}/${PN}-1.3-initd" ${PN}
81         newpamd "${FILESDIR}/${PN}-1.4.3-pamd" crond
82
83         systemd_newunit contrib/cronie.systemd cronie.service
84
85         if use anacron ; then
86                 local anacrondir="/var/spool/anacron"
87                 keepdir ${anacrondir}
88                 fowners root:cron ${anacrondir}
89                 fperms 0750 ${anacrondir}
90
91                 insinto /etc
92                 doins contrib/anacrontab
93
94                 insinto /etc/cron.hourly
95                 doins contrib/0anacron
96                 fperms 0750 /etc/cron.hourly/0anacron
97         else
98                 insinto /etc/cron.d
99                 doins contrib/dailyjobs
100         fi
101
102         einstalldocs
103 }
104
105 pkg_postinst() {
106         cron_pkg_postinst
107
108         if [[ -n "${REPLACING_VERSIONS}" ]] ; then
109                 ewarn "You should restart ${PN} daemon or else you might experience segfaults"
110                 ewarn "or ${PN} not working reliably anymore."
111                 einfo "(see https://bugs.gentoo.org/557406 for details.)"
112         fi
113 }