blob: 1496243c150add80c9e7872c67669b1b20511d8a [file] [log] [blame]
Andrew Geissler595f6302022-01-24 19:11:47 +00001DESCRIPTION = "Monit is a free open source utility for managing and monitoring, \
2processes, programs, files, directories and filesystems on a UNIX system. \
3Monit conducts automatic maintenance and repair and can execute meaningful \
4causal actions in error situations."
5
6HOMEPAGE = "http://mmonit.com/monit/"
7
8LICENSE = "AGPL-3.0"
9LIC_FILES_CHKSUM = "file://COPYING;md5=ea116a7defaf0e93b3bb73b2a34a3f51 \
10 file://libmonit/COPYING;md5=2405f1c59ed1bf3714cebdb40162ce92"
11
12SRC_URI = " \
13 https://mmonit.com/monit/dist/monit-${PV}.tar.gz \
14 file://monit \
15 file://monitrc \
16"
17
18SRC_URI[sha256sum] = "e85649dfa8586f4fcdd34a0295c55ddd69b0eda6cfbdac47105a2673d10b1008"
19
20DEPENDS = "zlib bison-native libnsl2 flex-native openssl virtual/crypt"
21
22inherit autotools-brokensep systemd update-rc.d
23
24PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
25PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
26
27EXTRA_OECONF = "\
28 libmonit_cv_setjmp_available=no \
29 libmonit_cv_vsnprintf_c99_conformant=no \
30 --with-ssl-lib-dir=${STAGING_LIBDIR} \
31 --with-ssl-incl-dir=${STAGING_INCDIR} \
32"
33
34SYSTEMD_SERVICE:${PN} = "monit.service"
35SYSTEMD_AUTO_ENABLE = "enable"
36
37INITSCRIPT_PACKAGES = "${PN}"
38INITSCRIPT_NAME:${PN} = "monit"
39INITSCRIPT_PARAMS:${PN} = "defaults 89"
40
41do_install:append() {
42
43 # Configuration file
44 install -Dm 0600 ${WORKDIR}/monitrc ${D}${sysconfdir}/monitrc
45
46 # SystemD
47 install -Dm 0644 ${S}/system/startup/monit.service.in ${D}${systemd_system_unitdir}/monit.service
48 sed -i -e 's,@prefix@,${exec_prefix},g' ${D}${systemd_unitdir}/system/monit.service
49
50 # SysV
51 install -Dm 0755 ${WORKDIR}/monit ${D}${sysconfdir}/init.d/monit
52}