Andrew Geissler | d583833 | 2022-05-27 11:33:10 -0500 | [diff] [blame^] | 1 | SUMMARY = "Userspace logging daemon for netfilter/iptables" |
| 2 | DESCRIPTION = "ulogd-2.x provides a flexible, almost universal logging daemon for \ |
| 3 | netfilter logging. This encompasses both packet-based logging (logging of \ |
| 4 | policy violations) and flow-based logging, e.g. for accounting purpose." |
| 5 | HOMEPAGE = "https://www.netfilter.org/projects/ulogd/index.html" |
| 6 | LICENSE = "GPL-2.0-only" |
| 7 | LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b" |
| 8 | |
| 9 | DEPENDS = "libnfnetlink" |
| 10 | PROVIDES = "ulogd" |
| 11 | |
| 12 | PV .= "+git${SRCPV}" |
| 13 | |
| 14 | SRC_URI = "git://git.netfilter.org/ulogd2;branch=master \ |
| 15 | file://ulogd.init \ |
| 16 | file://ulogd.service \ |
| 17 | " |
| 18 | SRCREV = "5f9628c9273815b6e560603427fe86118e7cb5bb" |
| 19 | |
| 20 | S = "${WORKDIR}/git" |
| 21 | |
| 22 | inherit autotools manpages pkgconfig systemd update-rc.d |
| 23 | |
| 24 | PACKAGECONFIG ?= "dbi json nfacct nfct nflog pcap sqlite3 ulog" |
| 25 | PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi" |
| 26 | PACKAGECONFIG[json] = "--enable-json,--disable-json,jansson" |
| 27 | PACKAGECONFIG[manpages] = "" |
| 28 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5" |
| 29 | PACKAGECONFIG[nfacct] = "--enable-nfacct,--disable-nfacct,libnetfilter-acct" |
| 30 | PACKAGECONFIG[nfct] = "--enable-nfct,--disable-nfct,libnetfilter-conntrack" |
| 31 | PACKAGECONFIG[nflog] = "--enable-nflog,--disable-nflog,libnetfilter-log" |
| 32 | PACKAGECONFIG[pcap] = "--enable-pcap,--disable-pcap,libpcap" |
| 33 | PACKAGECONFIG[pgsql] = "--enable-pgsql,--disable-pgsql,postgresql" |
| 34 | PACKAGECONFIG[sqlite3] = "--enable-sqlite3,--disable-sqlite3,sqlite3" |
| 35 | PACKAGECONFIG[ulog] = "--enable-ulog,--disable-ulog" |
| 36 | |
| 37 | do_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 | |
| 52 | PACKAGES += "${PN}-plugins" |
| 53 | ALLOW_EMPTY:${PN}-plugins = "1" |
| 54 | |
| 55 | PACKAGES_DYNAMIC += "^${PN}-plugin-.*$" |
| 56 | NOAUTOPACKAGEDEBUG = "1" |
| 57 | |
| 58 | CONFFILES:${PN} = "${sysconfdir}/ulogd.conf" |
| 59 | RRECOMMENDS:${PN} += "${PN}-plugins" |
| 60 | |
| 61 | FILES:${PN}-dbg += "${sbindir}/.debug" |
| 62 | |
| 63 | python 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 | } |
| 75 | PACKAGESPLITFUNCS:prepend = "split_ulogd_libs " |
| 76 | |
| 77 | SYSTEMD_SERVICE:${PN} = "ulogd.service" |
| 78 | |
| 79 | INITSCRIPT_NAME = "ulogd" |
| 80 | INITSCRIPT_PARAMS = "defaults" |