blob: 7a307dc292ecd5d9c6906377eb622d107fc9d62c [file] [log] [blame]
Andrew Geisslerd5838332022-05-27 11:33:10 -05001SUMMARY = "Userspace logging daemon for netfilter/iptables"
2DESCRIPTION = "ulogd-2.x provides a flexible, almost universal logging daemon for \
3netfilter logging. This encompasses both packet-based logging (logging of \
4policy violations) and flow-based logging, e.g. for accounting purpose."
5HOMEPAGE = "https://www.netfilter.org/projects/ulogd/index.html"
6LICENSE = "GPL-2.0-only"
7LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b"
8
9DEPENDS = "libnfnetlink"
10PROVIDES = "ulogd"
11
12PV .= "+git${SRCPV}"
13
14SRC_URI = "git://git.netfilter.org/ulogd2;branch=master \
15 file://ulogd.init \
16 file://ulogd.service \
17"
18SRCREV = "5f9628c9273815b6e560603427fe86118e7cb5bb"
19
20S = "${WORKDIR}/git"
21
22inherit autotools manpages pkgconfig systemd update-rc.d
23
24PACKAGECONFIG ?= "dbi json nfacct nfct nflog pcap sqlite3 ulog"
25PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi"
26PACKAGECONFIG[json] = "--enable-json,--disable-json,jansson"
27PACKAGECONFIG[manpages] = ""
28PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5"
29PACKAGECONFIG[nfacct] = "--enable-nfacct,--disable-nfacct,libnetfilter-acct"
30PACKAGECONFIG[nfct] = "--enable-nfct,--disable-nfct,libnetfilter-conntrack"
31PACKAGECONFIG[nflog] = "--enable-nflog,--disable-nflog,libnetfilter-log"
32PACKAGECONFIG[pcap] = "--enable-pcap,--disable-pcap,libpcap"
33PACKAGECONFIG[pgsql] = "--enable-pgsql,--disable-pgsql,postgresql"
34PACKAGECONFIG[sqlite3] = "--enable-sqlite3,--disable-sqlite3,sqlite3"
35PACKAGECONFIG[ulog] = "--enable-ulog,--disable-ulog"
36
37do_install:append () {
38 install -d ${D}${sysconfdir}
39 install -m 0644 ${B}/ulogd.conf ${D}${sysconfdir}/ulogd.conf
40
41 install -d ${D}${mandir}/man8
42 install -m 0644 ${S}/ulogd.8 ${D}${mandir}/man8/ulogd.8
43
44 install -d ${D}${systemd_system_unitdir}
45 install -m 0644 ${WORKDIR}/ulogd.service ${D}${systemd_system_unitdir}
46 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/ulogd.service
47
48 install -d ${D}${sysconfdir}/init.d
49 install -m 755 ${WORKDIR}/ulogd.init ${D}${sysconfdir}/init.d/ulogd
50}
51
52PACKAGES += "${PN}-plugins"
53ALLOW_EMPTY:${PN}-plugins = "1"
54
55PACKAGES_DYNAMIC += "^${PN}-plugin-.*$"
56NOAUTOPACKAGEDEBUG = "1"
57
58CONFFILES:${PN} = "${sysconfdir}/ulogd.conf"
59RRECOMMENDS:${PN} += "${PN}-plugins"
60
61FILES:${PN}-dbg += "${sbindir}/.debug"
62
63python split_ulogd_libs () {
64 libdir = d.expand('${libdir}/ulogd')
65 dbglibdir = os.path.join(libdir, '.debug')
66
67 split_packages = do_split_packages(d, libdir, r'^ulogd_.*\_([A-Z0-9]*).so', '${PN}-plugin-%s', 'ulogd2 %s plugin', prepend=True)
68 split_dbg_packages = do_split_packages(d, dbglibdir, r'^ulogd_.*\_([A-Z0-9]*).so', '${PN}-plugin-%s-dbg', 'ulogd2 %s plugin - Debugging files', prepend=True, extra_depends='${PN}-dbg')
69
70 if split_packages:
71 pn = d.getVar('PN')
72 d.setVar('RRECOMMENDS:' + pn + '-plugins', ' '.join(split_packages))
73 d.appendVar('RRECOMMENDS:' + pn + '-dbg', ' ' + ' '.join(split_dbg_packages))
74}
75PACKAGESPLITFUNCS:prepend = "split_ulogd_libs "
76
77SYSTEMD_SERVICE:${PN} = "ulogd.service"
78
79INITSCRIPT_NAME = "ulogd"
80INITSCRIPT_PARAMS = "defaults"