blob: 52ddc43ff8a3427580056aa676fd5642f28326a4 [file] [log] [blame]
William A. Kennington IIIee32beb2021-06-02 12:48:35 -07001SUMMARY = "Advanced Intrusion Detection Environment"
2HOMEPAGE = "https://aide.github.io"
3LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
Patrick Williams03907ee2022-05-01 06:28:52 -05004LICENSE = "GPL-2.0-only"
William A. Kennington IIIee32beb2021-06-02 12:48:35 -07005
6DEPENDS = "bison-native libpcre"
7
8SRC_URI = "https://github.com/aide/aide/releases/download/v${PV}/${BPN}-${PV}.tar.gz \
9 file://aide.conf"
10
Andrew Geisslerd5838332022-05-27 11:33:10 -050011SRC_URI[sha256sum] = "c81505246f3ffc2e76036d43a77212ae82895b5881d9b9e25c1361b1a9b7a846"
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070012
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050013UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/releases"
14
Andrew Geissler615f2f12022-07-15 14:00:58 -050015inherit autotools pkgconfig aide-base
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070016
Andrew Geissler615f2f12022-07-15 14:00:58 -050017PACKAGECONFIG ??=" mhash zlib e2fsattrs posix capabilities curl \
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070018 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux audit', '', d)} \
19 ${@bb.utils.contains('DISTRO_FEATURES', 'xattr', 'xattr', '', d)} \
20 "
21PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux, libselinux"
22PACKAGECONFIG[zlib] = "--with-zlib, --without-zlib, zlib, zlib "
23PACKAGECONFIG[xattr] = "--with-xattr, --without-xattr, attr, attr"
24PACKAGECONFIG[curl] = "--with-curl, --without-curl, curl, libcurl"
Andrew Geisslerd5838332022-05-27 11:33:10 -050025PACKAGECONFIG[audit] = "--with-audit, --without-audit,audit"
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070026PACKAGECONFIG[gcrypt] = "--with-gcrypt, --without-gcrypt, libgcrypt, libgcrypt"
27PACKAGECONFIG[mhash] = "--with-mhash, --without-mhash, libmhash, libmhash"
28PACKAGECONFIG[e2fsattrs] = "--with-e2fsattrs, --without-e2fsattrs, e2fsprogs, e2fsprogs"
Andrew Geissler615f2f12022-07-15 14:00:58 -050029PACKAGECONFIG[capabilities] = "--with-capabilities, --without-capabilities, libcap, libcap"
30PACKAGECONFIG[posix] = "--with-posix-acl, --without-posix-acl, acl, acl"
31
32
33do_install[nostamp] = "1"
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070034
Patrick Williams213cb262021-08-07 19:21:33 -050035do_install:append () {
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070036 install -d ${D}${libdir}/${PN}/logs
37 install -d ${D}${sysconfdir}
38 install ${WORKDIR}/aide.conf ${D}${sysconfdir}/
Andrew Geissler615f2f12022-07-15 14:00:58 -050039
40 for dir in ${AIDE_INCLUDE_DIRS}; do
41 echo "${dir} NORMAL" >> ${D}${sysconfdir}/aide.conf
42 done
43 for dir in ${AIDE_SKIP_DIRS}; do
44 echo "!${dir}" >> ${D}${sysconfdir}/aide.conf
45 done
46}
47
48do_install:class-native () {
49 install -d ${STAGING_AIDE_DIR}/bin
50 install -d ${STAGING_AIDE_DIR}/lib/logs
51
52 install ${B}/aide ${STAGING_AIDE_DIR}/bin
53 install ${WORKDIR}/aide.conf ${STAGING_AIDE_DIR}/
54
55 sed -i -s "s:\@\@define DBDIR.*:\@\@define DBDIR ${STAGING_AIDE_DIR}/lib:" ${STAGING_AIDE_DIR}/aide.conf
56 sed -i -e "s:\@\@define LOGDIR.*:\@\@define LOGDIR ${STAGING_AIDE_DIR}/lib/logs:" ${STAGING_AIDE_DIR}/aide.conf
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070057}
58
59CONF_FILE = "${sysconfdir}/aide.conf"
60
Patrick Williams213cb262021-08-07 19:21:33 -050061FILES:${PN} += "${libdir}/${PN} ${sysconfdir}/aide.conf"
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070062
Patrick Williams213cb262021-08-07 19:21:33 -050063pkg_postinst_ontarget:${PN} () {
Andrew Geissler615f2f12022-07-15 14:00:58 -050064 if [ ${AIDE_SCAN_POSTINIT} ]; then
65 ${bindir}/aide -i
66 fi
67 if [ ${AIDE_RESCAN_POSTINIT} && -e ${libdir}/aide/aide.db.gz ]; then
68 ${bindir}/aide -C
69 fi
William A. Kennington IIIee32beb2021-06-02 12:48:35 -070070}
Andrew Geissler615f2f12022-07-15 14:00:58 -050071
72RDEPENDS:${PN} = "bison libpcre"
73
74BBCLASSEXTEND = "native"