Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 1 | SUMMARY = "Netfilter Tables userspace utillites" |
| 2 | SECTION = "net" |
| 3 | LICENSE = "GPL-2.0-only" |
| 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=d1a78fdd879a263a5e0b42d1fc565e79" |
| 5 | |
| 6 | DEPENDS = "libmnl libnftnl bison-native \ |
| 7 | ${@bb.utils.contains('PACKAGECONFIG', 'mini-gmp', '', 'gmp', d)}" |
| 8 | |
| 9 | # Ensure we reject the 0.099 version by matching at least two dots |
| 10 | UPSTREAM_CHECK_REGEX = "nftables-(?P<pver>\d+(\.\d+){2,}).tar.bz2" |
| 11 | |
| 12 | SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2 \ |
| 13 | file://0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch \ |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 14 | file://run-ptest \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 15 | " |
| 16 | |
| 17 | SRC_URI[sha256sum] = "0b28a36ffcf4567b841de7bd3f37918b1fed27859eb48bdec51e1f7a83954c02" |
| 18 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 19 | inherit autotools manpages pkgconfig ptest |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 20 | |
| 21 | PACKAGECONFIG ??= "python readline json" |
| 22 | PACKAGECONFIG[json] = "--with-json, --without-json, jansson" |
| 23 | PACKAGECONFIG[manpages] = "--enable-man-doc, --disable-man-doc, asciidoc-native" |
| 24 | PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp" |
| 25 | PACKAGECONFIG[python] = "--enable-python --with-python-bin=${PYTHON}, --with-python-bin="", python3" |
| 26 | PACKAGECONFIG[readline] = "--with-cli=readline, --without-cli, readline" |
| 27 | PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables" |
| 28 | |
| 29 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} |
| 30 | |
| 31 | RRECOMMENDS:${PN} += "kernel-module-nf-tables" |
| 32 | |
| 33 | PACKAGES =+ "${PN}-python" |
| 34 | FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" |
| 35 | RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 36 | |
| 37 | RDEPENDS:${PN}-ptest += " make bash python3-core python3-ctypes python3-json python3-misc util-linux" |
| 38 | |
| 39 | TESTDIR = "tests" |
| 40 | |
| 41 | PRIVATE_LIBS:${PN}-ptest:append = "libnftables.so.1" |
| 42 | |
| 43 | do_install_ptest() { |
| 44 | cp -rf ${S}/build-aux ${D}${PTEST_PATH} |
| 45 | cp -rf ${S}/src ${D}${PTEST_PATH} |
| 46 | mkdir -p ${D}${PTEST_PATH}/src/.libs |
| 47 | cp -rf ${B}/src/.libs/* ${D}${PTEST_PATH}/src/.libs |
| 48 | cp -rf ${B}/src/.libs/nft ${D}${PTEST_PATH}/src/ |
| 49 | cp -rf ${S}/py ${D}${PTEST_PATH} |
| 50 | cp -rf ${S}/${TESTDIR} ${D}${PTEST_PATH}/${TESTDIR} |
| 51 | sed -i 's#/usr/bin/python#/usr/bin/python3#' ${D}${PTEST_PATH}/${TESTDIR}/json_echo/run-test.py |
| 52 | sed -i 's#/usr/bin/env python#/usr/bin/env python3#' ${D}${PTEST_PATH}/${TESTDIR}/py/nft-test.py |
| 53 | } |