summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-networking/recipes-filter/nftables/nftables/0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch39
-rw-r--r--meta-networking/recipes-filter/nftables/nftables/0001-nftables-python-Split-root-from-prefix.patch44
-rw-r--r--meta-networking/recipes-filter/nftables/nftables_1.0.4.bb (renamed from meta-networking/recipes-filter/nftables/nftables_1.0.2.bb)20
3 files changed, 54 insertions, 49 deletions
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
deleted file mode 100644
index 65ab2dfd8c..0000000000
--- a/meta-networking/recipes-filter/nftables/nftables/0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From 18a08fb7f0443f8bde83393bd6f69e23a04246b3 Mon Sep 17 00:00:00 2001
2From: Pablo Neira Ayuso <pablo@netfilter.org>
3Date: Tue, 22 Feb 2022 00:56:36 +0100
4Subject: [PATCH] examples: compile with `make check' and add AM_CPPFLAGS
5
6Compile examples via `make check' like libnftnl does. Use AM_CPPFLAGS to
7specify local headers via -I.
8
9Unfortunately, `make distcheck' did not catch this compile time error in
10my system, since it was using the nftables/libnftables.h file of the
11previous nftables release.
12
13Fixes: 5b364657a35f ("build: missing SUBIRS update")
14Fixes: caf2a6ad2d22 ("examples: add libnftables example program")
15Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
16
17Upstream-Status: Backport
18[http://git.netfilter.org/nftables/commit/?id=18a08fb7f0443f8bde83393bd6f69e23a04246b3]
19
20Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
21---
22 examples/Makefile.am | 4 +++-
23 1 file changed, 3 insertions(+), 1 deletion(-)
24
25diff --git a/examples/Makefile.am b/examples/Makefile.am
26index c972170d..3b8b0b67 100644
27--- a/examples/Makefile.am
28+++ b/examples/Makefile.am
29@@ -1,4 +1,6 @@
30-noinst_PROGRAMS = nft-buffer \
31+check_PROGRAMS = nft-buffer \
32 nft-json-file
33
34+AM_CPPFLAGS = -I$(top_srcdir)/include
35+
36 LDADD = $(top_builddir)/src/libnftables.la
37--
382.25.1
39
diff --git a/meta-networking/recipes-filter/nftables/nftables/0001-nftables-python-Split-root-from-prefix.patch b/meta-networking/recipes-filter/nftables/nftables/0001-nftables-python-Split-root-from-prefix.patch
new file mode 100644
index 0000000000..377b29fff8
--- /dev/null
+++ b/meta-networking/recipes-filter/nftables/nftables/0001-nftables-python-Split-root-from-prefix.patch
@@ -0,0 +1,44 @@
1From c7513195a72b2e5be5c9c439cc606eb5dcc3fb7a Mon Sep 17 00:00:00 2001
2From: Alex Kiernan <alex.kiernan@gmail.com>
3Date: Tue, 12 Jul 2022 17:44:34 +0100
4Subject: [PATCH] nftables: python: Split root from prefix
5
6The buildpaths QA check fails when python is enabled:
7
8 WARNING: nftables-1.0.4-r0 do_package_qa: QA Issue: File /usr/lib/python3.10/site-packages/nftables/__pycache__/nftables.cpython-310.pyc in package nftables-python contains reference to TMPDIR
9 File /usr/lib/python3.10/site-packages/nftables/__pycache__/__init__.cpython-310.pyc in package nftables-python contains reference to TMPDIR [buildpaths]
10
11Upstream-Status: Pending
12Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
13---
14 py/Makefile.am | 2 +-
15 py/setup.py | 2 +-
16 2 files changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/py/Makefile.am b/py/Makefile.am
19index 215ecd9e4751..a827cca10135 100644
20--- a/py/Makefile.am
21+++ b/py/Makefile.am
22@@ -7,7 +7,7 @@ all-local:
23 install-exec-local:
24 cd $(srcdir) && \
25 $(PYTHON_BIN) setup.py build --build-base $(abs_builddir) \
26- install --prefix $(DESTDIR)$(prefix)
27+ install --root $(DESTDIR) --prefix $(prefix)
28
29 uninstall-local:
30 rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/nftables
31diff --git a/py/setup.py b/py/setup.py
32index 72fc8fd98b26..976aec583b71 100755
33--- a/py/setup.py
34+++ b/py/setup.py
35@@ -1,5 +1,5 @@
36 #!/usr/bin/env python
37-from distutils.core import setup
38+from setuptools._distutils.core import setup
39 from nftables import NFTABLES_VERSION
40
41 setup(name='nftables',
42--
432.35.1
44
diff --git a/meta-networking/recipes-filter/nftables/nftables_1.0.2.bb b/meta-networking/recipes-filter/nftables/nftables_1.0.4.bb
index e078be79a1..3466e16a62 100644
--- a/meta-networking/recipes-filter/nftables/nftables_1.0.2.bb
+++ b/meta-networking/recipes-filter/nftables/nftables_1.0.4.bb
@@ -6,26 +6,27 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d1a78fdd879a263a5e0b42d1fc565e79"
6DEPENDS = "libmnl libnftnl bison-native \ 6DEPENDS = "libmnl libnftnl bison-native \
7 ${@bb.utils.contains('PACKAGECONFIG', 'mini-gmp', '', 'gmp', d)}" 7 ${@bb.utils.contains('PACKAGECONFIG', 'mini-gmp', '', 'gmp', d)}"
8 8
9# Ensure we reject the 0.099 version by matching at least two dots
10UPSTREAM_CHECK_REGEX = "nftables-(?P<pver>\d+(\.\d+){2,}).tar.bz2"
11
12SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2 \ 9SRC_URI = "http://www.netfilter.org/projects/nftables/files/${BP}.tar.bz2 \
13 file://0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch \ 10 file://0001-nftables-python-Split-root-from-prefix.patch \
14 file://run-ptest \ 11 file://run-ptest \
15 " 12 "
16 13
17SRC_URI[sha256sum] = "0b28a36ffcf4567b841de7bd3f37918b1fed27859eb48bdec51e1f7a83954c02" 14SRC_URI[sha256sum] = "927fb1fea1f685a328c10cf791eb655d7e1ed49d310eea5cb3101dfd8d6cba35"
18 15
19inherit autotools manpages pkgconfig ptest 16inherit autotools manpages pkgconfig ptest
20 17
21PACKAGECONFIG ??= "python readline json" 18PACKAGECONFIG ?= "python readline json"
19PACKAGECONFIG[editline] = "--with-cli=editline, , libedit, , , linenoise readline"
22PACKAGECONFIG[json] = "--with-json, --without-json, jansson" 20PACKAGECONFIG[json] = "--with-json, --without-json, jansson"
21PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , , editline readline"
23PACKAGECONFIG[manpages] = "--enable-man-doc, --disable-man-doc, asciidoc-native" 22PACKAGECONFIG[manpages] = "--enable-man-doc, --disable-man-doc, asciidoc-native"
24PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp" 23PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp"
25PACKAGECONFIG[python] = "--enable-python --with-python-bin=${PYTHON}, --with-python-bin="", python3" 24PACKAGECONFIG[python] = "--enable-python --with-python-bin=${PYTHON}, --disable-python, python3-setuptools-native"
26PACKAGECONFIG[readline] = "--with-cli=readline, --without-cli, readline" 25PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline linenoise"
27PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables" 26PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables"
28 27
28EXTRA_OECONF = "${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', '', '--without-cli', d)}"
29
29inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} 30inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)}
30 31
31RRECOMMENDS:${PN} += "kernel-module-nf-tables" 32RRECOMMENDS:${PN} += "kernel-module-nf-tables"
@@ -34,7 +35,7 @@ PACKAGES =+ "${PN}-python"
34FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" 35FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}"
35RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" 36RDEPENDS:${PN}-python = "python3-core python3-json ${PN}"
36 37
37RDEPENDS:${PN}-ptest += " make bash python3-core python3-ctypes python3-json python3-misc util-linux" 38RDEPENDS:${PN}-ptest += " ${PN}-python make bash python3-core python3-ctypes python3-json python3-misc util-linux"
38 39
39TESTDIR = "tests" 40TESTDIR = "tests"
40 41
@@ -46,7 +47,6 @@ do_install_ptest() {
46 mkdir -p ${D}${PTEST_PATH}/src/.libs 47 mkdir -p ${D}${PTEST_PATH}/src/.libs
47 cp -rf ${B}/src/.libs/* ${D}${PTEST_PATH}/src/.libs 48 cp -rf ${B}/src/.libs/* ${D}${PTEST_PATH}/src/.libs
48 cp -rf ${B}/src/.libs/nft ${D}${PTEST_PATH}/src/ 49 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} 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 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 52 sed -i 's#/usr/bin/env python#/usr/bin/env python3#' ${D}${PTEST_PATH}/${TESTDIR}/py/nft-test.py