From 03e4ec7184b1303264640844562f2345dfed6650 Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Tue, 22 Mar 2022 12:46:13 +0800 Subject: nftables: upgrade 1.0.1 -> 1.0.2 Backport a patch to fix build error: ../../nftables-1.0.2/examples/nft-buffer.c:3:10: fatal error: nftables/libnftables.h: No such file or directory 3 | #include | ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Yi Zhao Signed-off-by: Khem Raj --- ...mpile-with-make-check-and-add-AM_CPPFLAGS.patch | 39 ++++++++++++++++++++++ .../recipes-filter/nftables/nftables_1.0.1.bb | 31 ----------------- .../recipes-filter/nftables/nftables_1.0.2.bb | 34 +++++++++++++++++++ 3 files changed, 73 insertions(+), 31 deletions(-) create mode 100644 meta-networking/recipes-filter/nftables/nftables/0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch delete mode 100644 meta-networking/recipes-filter/nftables/nftables_1.0.1.bb create mode 100644 meta-networking/recipes-filter/nftables/nftables_1.0.2.bb diff --git a/meta-networking/recipes-filter/nftables/nftables/0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch b/meta-networking/recipes-filter/nftables/nftables/0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch new file mode 100644 index 0000000000..65ab2dfd8c --- /dev/null +++ b/meta-networking/recipes-filter/nftables/nftables/0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch @@ -0,0 +1,39 @@ +From 18a08fb7f0443f8bde83393bd6f69e23a04246b3 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Tue, 22 Feb 2022 00:56:36 +0100 +Subject: [PATCH] examples: compile with `make check' and add AM_CPPFLAGS + +Compile examples via `make check' like libnftnl does. Use AM_CPPFLAGS to +specify local headers via -I. + +Unfortunately, `make distcheck' did not catch this compile time error in +my system, since it was using the nftables/libnftables.h file of the +previous nftables release. + +Fixes: 5b364657a35f ("build: missing SUBIRS update") +Fixes: caf2a6ad2d22 ("examples: add libnftables example program") +Signed-off-by: Pablo Neira Ayuso + +Upstream-Status: Backport +[http://git.netfilter.org/nftables/commit/?id=18a08fb7f0443f8bde83393bd6f69e23a04246b3] + +Signed-off-by: Yi Zhao +--- + examples/Makefile.am | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/examples/Makefile.am b/examples/Makefile.am +index c972170d..3b8b0b67 100644 +--- a/examples/Makefile.am ++++ b/examples/Makefile.am +@@ -1,4 +1,6 @@ +-noinst_PROGRAMS = nft-buffer \ ++check_PROGRAMS = nft-buffer \ + nft-json-file + ++AM_CPPFLAGS = -I$(top_srcdir)/include ++ + LDADD = $(top_builddir)/src/libnftables.la +-- +2.25.1 + diff --git a/meta-networking/recipes-filter/nftables/nftables_1.0.1.bb b/meta-networking/recipes-filter/nftables/nftables_1.0.1.bb deleted file mode 100644 index 2c378e8fd9..0000000000 --- a/meta-networking/recipes-filter/nftables/nftables_1.0.1.bb +++ /dev/null @@ -1,31 +0,0 @@ -SUMMARY = "Netfilter Tables userspace utillites" -SECTION = "net" -LICENSE = "GPL-2.0-only" -LIC_FILES_CHKSUM = "file://COPYING;md5=d1a78fdd879a263a5e0b42d1fc565e79" - -DEPENDS = "libmnl libnftnl bison-native \ - ${@bb.utils.contains('PACKAGECONFIG', 'mini-gmp', '', 'gmp', d)}" - -# Ensure we reject the 0.099 version by matching at least two dots -UPSTREAM_CHECK_REGEX = "nftables-(?P\d+(\.\d+){2,}).tar.bz2" - -SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2" -SRC_URI[sha256sum] = "3ceeba625818e81a0be293e9dd486c3ef799ebd92165270f1e57e9a201efa423" - -inherit autotools manpages pkgconfig - -PACKAGECONFIG ??= "python readline json" -PACKAGECONFIG[json] = "--with-json, --without-json, jansson" -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}, --with-python-bin="", python3" -PACKAGECONFIG[readline] = "--with-cli=readline, --without-cli, readline" -PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables" - -inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} - -RRECOMMENDS:${PN} += "kernel-module-nf-tables" - -PACKAGES =+ "${PN}-python" -FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" -RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" diff --git a/meta-networking/recipes-filter/nftables/nftables_1.0.2.bb b/meta-networking/recipes-filter/nftables/nftables_1.0.2.bb new file mode 100644 index 0000000000..fd8e26ed1a --- /dev/null +++ b/meta-networking/recipes-filter/nftables/nftables_1.0.2.bb @@ -0,0 +1,34 @@ +SUMMARY = "Netfilter Tables userspace utillites" +SECTION = "net" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=d1a78fdd879a263a5e0b42d1fc565e79" + +DEPENDS = "libmnl libnftnl bison-native \ + ${@bb.utils.contains('PACKAGECONFIG', 'mini-gmp', '', 'gmp', d)}" + +# Ensure we reject the 0.099 version by matching at least two dots +UPSTREAM_CHECK_REGEX = "nftables-(?P\d+(\.\d+){2,}).tar.bz2" + +SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2 \ + file://0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch \ + " + +SRC_URI[sha256sum] = "0b28a36ffcf4567b841de7bd3f37918b1fed27859eb48bdec51e1f7a83954c02" + +inherit autotools manpages pkgconfig + +PACKAGECONFIG ??= "python readline json" +PACKAGECONFIG[json] = "--with-json, --without-json, jansson" +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}, --with-python-bin="", python3" +PACKAGECONFIG[readline] = "--with-cli=readline, --without-cli, readline" +PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables" + +inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} + +RRECOMMENDS:${PN} += "kernel-module-nf-tables" + +PACKAGES =+ "${PN}-python" +FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" +RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" -- cgit v1.2.3-54-g00ecf