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 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 9 | SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2 \ |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 10 | file://0001-nftables-python-Split-root-from-prefix.patch \ |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 11 | file://run-ptest \ |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 12 | " |
| 13 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 14 | SRC_URI[sha256sum] = "927fb1fea1f685a328c10cf791eb655d7e1ed49d310eea5cb3101dfd8d6cba35" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 15 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 16 | inherit autotools manpages pkgconfig ptest |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 17 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 18 | PACKAGECONFIG ?= "python readline json" |
| 19 | PACKAGECONFIG[editline] = "--with-cli=editline, , libedit, , , linenoise readline" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 20 | PACKAGECONFIG[json] = "--with-json, --without-json, jansson" |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 21 | PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , , editline readline" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 22 | PACKAGECONFIG[manpages] = "--enable-man-doc, --disable-man-doc, asciidoc-native" |
| 23 | PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp" |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 24 | PACKAGECONFIG[python] = "--enable-python --with-python-bin=${PYTHON}, --disable-python, python3-setuptools-native" |
| 25 | PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline linenoise" |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 26 | PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables" |
| 27 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 28 | EXTRA_OECONF = "${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', '', '--without-cli', d)}" |
| 29 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 30 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} |
| 31 | |
| 32 | RRECOMMENDS:${PN} += "kernel-module-nf-tables" |
| 33 | |
| 34 | PACKAGES =+ "${PN}-python" |
| 35 | FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" |
| 36 | RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 37 | |
Andrew Geissler | 615f2f1 | 2022-07-15 14:00:58 -0500 | [diff] [blame^] | 38 | RDEPENDS:${PN}-ptest += " ${PN}-python make bash python3-core python3-ctypes python3-json python3-misc util-linux" |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 39 | |
| 40 | TESTDIR = "tests" |
| 41 | |
| 42 | PRIVATE_LIBS:${PN}-ptest:append = "libnftables.so.1" |
| 43 | |
| 44 | do_install_ptest() { |
| 45 | cp -rf ${S}/build-aux ${D}${PTEST_PATH} |
| 46 | cp -rf ${S}/src ${D}${PTEST_PATH} |
| 47 | mkdir -p ${D}${PTEST_PATH}/src/.libs |
| 48 | cp -rf ${B}/src/.libs/* ${D}${PTEST_PATH}/src/.libs |
| 49 | cp -rf ${B}/src/.libs/nft ${D}${PTEST_PATH}/src/ |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame] | 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 | } |