blob: 697501ac1f686d3bc7426047195c6ce06b3d3884 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Cron daemon for executing programs at set times"
2DESCRIPTION = "Cronie contains the standard UNIX daemon crond that runs \
3specified programs at scheduled times and related tools. It is based on the \
4original cron and has security and configuration enhancements like the \
5ability to use pam and SELinux."
6HOMEPAGE = "https://fedorahosted.org/cronie/"
Patrick Williamsf1e5d692016-03-30 15:21:19 -05007BUGTRACKER = "https://bugzilla.redhat.com"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05008
9# Internet Systems Consortium License
10LICENSE = "ISC & BSD-3-Clause & BSD-2-Clause & GPLv2+"
11LIC_FILES_CHKSUM = "file://COPYING;md5=dd2a592170760e1386c769e1043b3722 \
12 file://src/cron.c;endline=20;md5=b425c334265026177128353a142633b4 \
13 file://src/popen.c;beginline=3;endline=31;md5=edd50742d8def712e9472dba353668a9"
14
15SECTION = "utils"
16
17SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/cronie-${PV}.tar.gz \
18 file://crond.init \
19 file://crontab \
20 file://crond.service \
21 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}"
22
23PAM_SRC_URI = "file://crond_pam_config.patch"
24PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid"
25
26SRC_URI[md5sum] = "9db75e1884d83a45e002d145c6c54d45"
27SRC_URI[sha256sum] = "9cf0e3f4f5042a9c09413d62c8e0c055e12401f70b112465f0f81f2c84ebfb3f"
28
29inherit autotools update-rc.d useradd systemd
30
31PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
32
33PACKAGECONFIG[audit] = "--with-audit,--without-audit,audit,"
34PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam,${PAM_DEPS}"
35
36INITSCRIPT_NAME = "crond"
37INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ."
38
39USERADD_PACKAGES = "${PN}"
40GROUPADD_PARAM_${PN} = "--system crontab"
41
42SYSTEMD_SERVICE_${PN} = "crond.service"
43
44do_install_append () {
45 install -d ${D}${sysconfdir}/sysconfig/
46 install -d ${D}${sysconfdir}/init.d/
47 install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond
48 install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond
49
50 # install systemd unit files
51 install -d ${D}${systemd_unitdir}/system
52 install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system
53 sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
54 -e 's,@SBINDIR@,${sbindir},g' \
55 ${D}${systemd_unitdir}/system/crond.service
56
57 # below are necessary for a complete cron environment
58 install -d ${D}${localstatedir}/spool/cron
59 install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/
60 mkdir -p ${D}${sysconfdir}/cron.d
61 mkdir -p ${D}${sysconfdir}/cron.hourly
62 mkdir -p ${D}${sysconfdir}/cron.daily
63 mkdir -p ${D}${sysconfdir}/cron.weekly
64 mkdir -p ${D}${sysconfdir}/cron.monthly
65 touch ${D}${sysconfdir}/cron.deny
66
67 # below setting is necessary to allow normal user using crontab
68
69 # setgid for crontab binary
70 chown root:crontab ${D}${bindir}/crontab
71 chmod 2755 ${D}${bindir}/crontab
72
73 # allow 'crontab' group write to /var/spool/cron
74 chown root:crontab ${D}${localstatedir}/spool/cron
75 chmod 770 ${D}${localstatedir}/spool/cron
76
77 chmod 600 ${D}${sysconfdir}/crontab
78}
79
80FILES_${PN} += "${sysconfdir}/cron*"
81CONFFILES_${PN} += "${sysconfdir}/crontab"