blob: 14b9dace2a39dcefb8b1149d08c0118a1bcbe785 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "Delayed job execution and batch processing"
2HOMEPAGE = "http://blog.calhariz.com/"
3DESCRIPTION = "At allows for commands to be run at a particular time. Batch will execute commands when \
4the system load levels drop to a particular level."
5SECTION = "base"
6LICENSE = "GPLv2+"
7LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4"
8DEPENDS = "flex flex-native bison-native \
9 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
10
11PACKAGECONFIG ?= "\
12 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
13"
14
15PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux,libselinux,"
16
Patrick Williams213cb262021-08-07 19:21:33 -050017RDEPENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)} \
Brad Bishop19323692019-04-05 15:28:33 -040018"
19
20PAM_DEPS = "libpam libpam-runtime pam-plugin-env pam-plugin-limits"
21
Patrick Williams213cb262021-08-07 19:21:33 -050022RCONFLICTS:${PN} = "atd"
23RREPLACES:${PN} = "atd"
Brad Bishop19323692019-04-05 15:28:33 -040024
Andrew Geisslerd1e89492021-02-12 15:35:20 -060025SRC_URI = "http://software.calhariz.com/at/${BPN}_${PV}.orig.tar.gz \
Brad Bishop19323692019-04-05 15:28:33 -040026 file://fix_parallel_build_error.patch \
27 file://posixtm.c \
28 file://posixtm.h \
29 file://file_replacement_with_gplv2.patch \
30 file://atd.init \
31 file://atd.service \
32 ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
33 file://makefile-fix-parallel.patch \
34 file://0001-remove-glibc-assumption.patch \
35 "
36
37PAM_SRC_URI = "file://pam.conf.patch \
38 file://configure-add-enable-pam.patch"
39
William A. Kennington IIIac69b482021-06-02 12:28:27 -070040SRC_URI[sha256sum] = "2211da14914fde1f9cc83592838fb6385a32fb11fcecb7816c77700df6559088"
Brad Bishop19323692019-04-05 15:28:33 -040041
42EXTRA_OECONF += "ac_cv_path_SENDMAIL=/bin/true \
43 --with-daemon_username=root \
44 --with-daemon_groupname=root \
45 --with-jobdir=/var/spool/at/jobs \
46 --with-atspool=/var/spool/at/spool \
47 ac_cv_header_security_pam_appl_h=${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'yes', 'no', d)} "
48
49inherit autotools-brokensep systemd update-rc.d
50
51INITSCRIPT_NAME = "atd"
52INITSCRIPT_PARAMS = "defaults"
53
Patrick Williams213cb262021-08-07 19:21:33 -050054SYSTEMD_SERVICE:${PN} = "atd.service"
Brad Bishop19323692019-04-05 15:28:33 -040055
56copy_sources() {
57 cp -f ${WORKDIR}/posixtm.[ch] ${S}
58}
59do_patch[postfuncs] += "copy_sources"
60
61do_install () {
62 oe_runmake -e "IROOT=${D}" install
63
64 install -d ${D}${sysconfdir}/init.d
65 install -m 0755 ${WORKDIR}/atd.init ${D}${sysconfdir}/init.d/atd
66
67 # install systemd unit files
Andrew Geissler5199d832021-09-24 16:47:35 -050068 install -d ${D}${systemd_system_unitdir}
69 install -m 0644 ${WORKDIR}/atd.service ${D}${systemd_system_unitdir}
70 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/atd.service
Brad Bishop19323692019-04-05 15:28:33 -040071
72 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
73 install -D -m 0644 ${WORKDIR}/${BP}/pam.conf ${D}${sysconfdir}/pam.d/atd
74 fi
William A. Kennington IIIac69b482021-06-02 12:28:27 -070075 rm -f ${D}${datadir}/at/batch-job
Brad Bishop19323692019-04-05 15:28:33 -040076}