xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-support/monit/monit_5.32.0.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunDESCRIPTION = "Monit is a free open source utility for managing and monitoring, \
2*4882a593Smuzhiyunprocesses, programs, files, directories and filesystems on a UNIX system. \
3*4882a593SmuzhiyunMonit conducts automatic maintenance and repair and can execute meaningful \
4*4882a593Smuzhiyuncausal actions in error situations."
5*4882a593Smuzhiyun
6*4882a593SmuzhiyunHOMEPAGE = "http://mmonit.com/monit/"
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunLICENSE = "AGPL-3.0-only"
9*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://COPYING;md5=ea116a7defaf0e93b3bb73b2a34a3f51 \
10*4882a593Smuzhiyun                    file://libmonit/COPYING;md5=2405f1c59ed1bf3714cebdb40162ce92"
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunSRC_URI = " \
13*4882a593Smuzhiyun	https://mmonit.com/monit/dist/monit-${PV}.tar.gz \
14*4882a593Smuzhiyun	file://monit \
15*4882a593Smuzhiyun	file://monitrc \
16*4882a593Smuzhiyun"
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunSRC_URI[sha256sum] = "1077052d4c4e848ac47d14f9b37754d46419aecbe8c9a07e1f869c914faf3216"
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunDEPENDS = "zlib bison-native libnsl2 flex-native openssl virtual/crypt"
21*4882a593Smuzhiyun
22*4882a593Smuzhiyuninherit autotools-brokensep systemd update-rc.d
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunPACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
25*4882a593SmuzhiyunPACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunEXTRA_OECONF = "\
28*4882a593Smuzhiyun    libmonit_cv_setjmp_available=no \
29*4882a593Smuzhiyun    libmonit_cv_vsnprintf_c99_conformant=no \
30*4882a593Smuzhiyun    --with-ssl-lib-dir=${STAGING_LIBDIR} \
31*4882a593Smuzhiyun    --with-ssl-incl-dir=${STAGING_INCDIR} \
32*4882a593Smuzhiyun"
33*4882a593Smuzhiyun
34*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "monit.service"
35*4882a593SmuzhiyunSYSTEMD_AUTO_ENABLE = "enable"
36*4882a593Smuzhiyun
37*4882a593SmuzhiyunINITSCRIPT_PACKAGES = "${PN}"
38*4882a593SmuzhiyunINITSCRIPT_NAME:${PN} = "monit"
39*4882a593SmuzhiyunINITSCRIPT_PARAMS:${PN} = "defaults 89"
40*4882a593Smuzhiyun
41*4882a593Smuzhiyundo_configure:prepend() {
42*4882a593Smuzhiyun    rm -rf ${S}/m4/*
43*4882a593Smuzhiyun}
44*4882a593Smuzhiyun
45*4882a593Smuzhiyundo_install:append() {
46*4882a593Smuzhiyun
47*4882a593Smuzhiyun    # Configuration file
48*4882a593Smuzhiyun    install -Dm 0600 ${WORKDIR}/monitrc ${D}${sysconfdir}/monitrc
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun    # SystemD
51*4882a593Smuzhiyun    install -Dm 0644 ${S}/system/startup/monit.service.in ${D}${systemd_system_unitdir}/monit.service
52*4882a593Smuzhiyun    sed -i -e 's,@prefix@,${exec_prefix},g' ${D}${systemd_unitdir}/system/monit.service
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun    # SysV
55*4882a593Smuzhiyun    install -Dm 0755 ${WORKDIR}/monit ${D}${sysconfdir}/init.d/monit
56*4882a593Smuzhiyun}
57