From d7001f534e3d994368d465830cfbb8480f347320 Mon Sep 17 00:00:00 2001 From: Petr Gotthard Date: Fri, 14 Apr 2023 21:19:45 +0000 Subject: [PATCH] nftables: upgrade 1.0.6 -> 1.0.7 Changelog: https://netfilter.org/projects/nftables/files/changes-nftables-1.0.7.txt The COPYING text changed to highlight that "New code though is moving to GPL version 2 or any later which is the preferred license for this project these days." Although the project itself stays GPLv2 only. https://netfilter.org/licensing.html#terms The upstream replaced distutils with setuptools, so the nftables-python is now built using the standard approach. The coexistence of setuptools and automake is solved in the same way as in meta-oe/recipes-support/libiio. The removal of *.pyc is no longer necessary. Signed-off-by: Petr Gotthard Signed-off-by: Khem Raj --- .../{nftables_1.0.6.bb => nftables_1.0.7.bb} | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) rename meta-networking/recipes-filter/nftables/{nftables_1.0.6.bb => nftables_1.0.7.bb} (60%) diff --git a/meta-networking/recipes-filter/nftables/nftables_1.0.6.bb b/meta-networking/recipes-filter/nftables/nftables_1.0.7.bb similarity index 60% rename from meta-networking/recipes-filter/nftables/nftables_1.0.6.bb rename to meta-networking/recipes-filter/nftables/nftables_1.0.7.bb index f43a223ac9..8380bbd73d 100644 --- a/meta-networking/recipes-filter/nftables/nftables_1.0.6.bb +++ b/meta-networking/recipes-filter/nftables/nftables_1.0.7.bb @@ -1,7 +1,7 @@ SUMMARY = "Netfilter Tables userspace utillites" SECTION = "net" LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://COPYING;md5=d1a78fdd879a263a5e0b42d1fc565e79" +LIC_FILES_CHKSUM = "file://COPYING;md5=81ec33bb3e47b460fc993ac768c74b62" DEPENDS = "libmnl libnftnl bison-native \ ${@bb.utils.contains('PACKAGECONFIG', 'mini-gmp', '', 'gmp', d)}" @@ -9,7 +9,7 @@ DEPENDS = "libmnl libnftnl bison-native \ SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.xz \ file://run-ptest \ " -SRC_URI[sha256sum] = "2407430ddd82987670e48dc2fda9e280baa8307abec04ab18d609df3db005e4c" +SRC_URI[sha256sum] = "c12ac941fff9adaedf17367d5ce213789b98a0d314277bc22b3d71e10891f412" inherit autotools manpages pkgconfig ptest @@ -19,31 +19,53 @@ PACKAGECONFIG[json] = "--with-json, --without-json, jansson" PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , , editline readline" PACKAGECONFIG[manpages] = "--enable-man-doc, --disable-man-doc, asciidoc-native" PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp" -PACKAGECONFIG[python] = "--enable-python --with-python-bin=${PYTHON}, --disable-python, python3-setuptools-native" +PACKAGECONFIG[python] = ",, python3-setuptools-native" PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline linenoise" PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables" -EXTRA_OECONF = "${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', '', '--without-cli', d)}" +# Disable the python via autoconf so we can build it separately via setuptools3 +EXTRA_OECONF = "--disable-python \ + ${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', '', '--without-cli', d)}" -inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} +SETUPTOOLS_SETUP_PATH = "${S}/py" + +inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3', '', d)} RRECOMMENDS:${PN} += "kernel-module-nf-tables" PACKAGES =+ "${PN}-python" -FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" +FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}" RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" +# Explicitly define do_configure, do_compile and do_install because both autotools and setuptools3 +# have EXPORT_FUNCTIONS do_configure do_compile do_install +do_configure() { + autotools_do_configure + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + setuptools3_do_configure + fi +} + +do_compile() { + autotools_do_compile + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + setuptools3_do_compile + fi +} + +do_install() { + autotools_do_install + if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then + setuptools3_do_install + fi +} + RDEPENDS:${PN}-ptest += " ${PN}-python bash make iproute2 iputils-ping procps python3-core python3-ctypes python3-json python3-misc sed util-linux" TESTDIR = "tests" PRIVATE_LIBS:${PN}-ptest:append = " libnftables.so.1" -do_install:append() { - # Avoid "contains reference to TMPDIR" warning - find ${D} -name *.pyc -delete -} - do_install_ptest() { cp -rf ${S}/build-aux ${D}${PTEST_PATH} cp -rf ${S}/src ${D}${PTEST_PATH}