1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( pypy3 python3_{5,6} )
6 inherit eutils python-single-r1 systemd
8 DESCRIPTION="systemd units to create timers for cron directories and crontab"
9 HOMEPAGE="https://github.com/systemd-cron/systemd-cron/"
10 SRC_URI="https://github.com/systemd-cron/${PN}/archive/v${PV}.tar.gz -> systemd-cron-${PV}.tar.gz"
15 IUSE="cron-boot etc-crontab-systemd minutely setgid test yearly"
17 RDEPEND=">=sys-apps/systemd-217
19 !etc-crontab-systemd? ( !sys-process/dcron )
23 DEPEND="sys-process/cronbase
24 test? ( sys-apps/man-db dev-python/pyflakes )"
26 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
29 epatch "${FILESDIR}/1.5.12-generatordir.patch"
31 python_fix_shebang --force "${S}/src/bin"
34 -e 's/^crontab/crontab-systemd/' \
35 -e 's/^CRONTAB/CRONTAB-SYSTEMD/' \
36 -- "${S}/src/man/crontab."{1,5}".in" || die
39 -e 's!/crontab$!/crontab-systemd!' \
40 -e 's!/crontab\(\.[15]\)$!/crontab-systemd\1!' \
41 -e 's/pyflakes3/pyflakes/' \
42 -- "${S}/Makefile.in" || die
44 if use etc-crontab-systemd
46 -e "s!/etc/crontab!/etc/crontab-systemd!" \
47 -- "${S}/src/man/crontab."{1,5}".in" \
48 "${S}/src/bin/systemd-crontab-generator.py" || die
56 echo --enable-${2:-${1}}=yes
58 echo --enable-${2:-${1}}=no
64 --prefix="${EPREFIX}/usr" \
65 --confdir="${EPREFIX}/etc" \
66 --runparts="${EPREFIX}/bin/run-parts" \
67 --mandir="${EPREFIX}/usr/share/man" \
68 --unitdir="$(systemd_get_unitdir)" \
69 --generatordir="$(systemd_get_systemgeneratordir)" \
70 $(my_use_enable cron-boot boot) \
71 $(my_use_enable minutely) \
72 $(my_use_enable yearly) \
73 $(my_use_enable yearly quarterly) \
74 $(my_use_enable yearly semi_annually) \
75 $(my_use_enable setgid) \
76 --enable-persistent=yes