diff options
| -rw-r--r-- | meta-networking/recipes-filter/nftables/nftables/0001-examples-compile-with-make-check-and-add-AM_CPPFLAGS.patch | 39 | ||||
| -rw-r--r-- | meta-networking/recipes-filter/nftables/nftables/0001-nftables-python-Split-root-from-prefix.patch | 44 | ||||
| -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 @@ | |||
| 1 | From 18a08fb7f0443f8bde83393bd6f69e23a04246b3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Pablo Neira Ayuso <pablo@netfilter.org> | ||
| 3 | Date: Tue, 22 Feb 2022 00:56:36 +0100 | ||
| 4 | Subject: [PATCH] examples: compile with `make check' and add AM_CPPFLAGS | ||
| 5 | |||
| 6 | Compile examples via `make check' like libnftnl does. Use AM_CPPFLAGS to | ||
| 7 | specify local headers via -I. | ||
| 8 | |||
| 9 | Unfortunately, `make distcheck' did not catch this compile time error in | ||
| 10 | my system, since it was using the nftables/libnftables.h file of the | ||
| 11 | previous nftables release. | ||
| 12 | |||
| 13 | Fixes: 5b364657a35f ("build: missing SUBIRS update") | ||
| 14 | Fixes: caf2a6ad2d22 ("examples: add libnftables example program") | ||
| 15 | Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> | ||
| 16 | |||
| 17 | Upstream-Status: Backport | ||
| 18 | [http://git.netfilter.org/nftables/commit/?id=18a08fb7f0443f8bde83393bd6f69e23a04246b3] | ||
| 19 | |||
| 20 | Signed-off-by: Yi Zhao <yi.zhao@windriver.com> | ||
| 21 | --- | ||
| 22 | examples/Makefile.am | 4 +++- | ||
| 23 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
| 24 | |||
| 25 | diff --git a/examples/Makefile.am b/examples/Makefile.am | ||
| 26 | index 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 | -- | ||
| 38 | 2.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 @@ | |||
| 1 | From c7513195a72b2e5be5c9c439cc606eb5dcc3fb7a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Alex Kiernan <alex.kiernan@gmail.com> | ||
| 3 | Date: Tue, 12 Jul 2022 17:44:34 +0100 | ||
| 4 | Subject: [PATCH] nftables: python: Split root from prefix | ||
| 5 | |||
| 6 | The 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 | |||
| 11 | Upstream-Status: Pending | ||
| 12 | Signed-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 | |||
| 18 | diff --git a/py/Makefile.am b/py/Makefile.am | ||
| 19 | index 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 | ||
| 31 | diff --git a/py/setup.py b/py/setup.py | ||
| 32 | index 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 | -- | ||
| 43 | 2.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" | |||
| 6 | DEPENDS = "libmnl libnftnl bison-native \ | 6 | DEPENDS = "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 | ||
| 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 \ | 9 | 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 \ | 10 | file://0001-nftables-python-Split-root-from-prefix.patch \ |
| 14 | file://run-ptest \ | 11 | file://run-ptest \ |
| 15 | " | 12 | " |
| 16 | 13 | ||
| 17 | SRC_URI[sha256sum] = "0b28a36ffcf4567b841de7bd3f37918b1fed27859eb48bdec51e1f7a83954c02" | 14 | SRC_URI[sha256sum] = "927fb1fea1f685a328c10cf791eb655d7e1ed49d310eea5cb3101dfd8d6cba35" |
| 18 | 15 | ||
| 19 | inherit autotools manpages pkgconfig ptest | 16 | inherit autotools manpages pkgconfig ptest |
| 20 | 17 | ||
| 21 | PACKAGECONFIG ??= "python readline json" | 18 | PACKAGECONFIG ?= "python readline json" |
| 19 | PACKAGECONFIG[editline] = "--with-cli=editline, , libedit, , , linenoise readline" | ||
| 22 | PACKAGECONFIG[json] = "--with-json, --without-json, jansson" | 20 | PACKAGECONFIG[json] = "--with-json, --without-json, jansson" |
| 21 | PACKAGECONFIG[linenoise] = "--with-cli=linenoise, , linenoise, , , editline readline" | ||
| 23 | PACKAGECONFIG[manpages] = "--enable-man-doc, --disable-man-doc, asciidoc-native" | 22 | PACKAGECONFIG[manpages] = "--enable-man-doc, --disable-man-doc, asciidoc-native" |
| 24 | PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp" | 23 | PACKAGECONFIG[mini-gmp] = "--with-mini-gmp, --without-mini-gmp" |
| 25 | PACKAGECONFIG[python] = "--enable-python --with-python-bin=${PYTHON}, --with-python-bin="", python3" | 24 | PACKAGECONFIG[python] = "--enable-python --with-python-bin=${PYTHON}, --disable-python, python3-setuptools-native" |
| 26 | PACKAGECONFIG[readline] = "--with-cli=readline, --without-cli, readline" | 25 | PACKAGECONFIG[readline] = "--with-cli=readline, , readline, , , editline linenoise" |
| 27 | PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables" | 26 | PACKAGECONFIG[xtables] = "--with-xtables, --without-xtables, iptables" |
| 28 | 27 | ||
| 28 | EXTRA_OECONF = "${@bb.utils.contains_any('PACKAGECONFIG', 'editline linenoise readline', '', '--without-cli', d)}" | ||
| 29 | |||
| 29 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} | 30 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3native', '', d)} |
| 30 | 31 | ||
| 31 | RRECOMMENDS:${PN} += "kernel-module-nf-tables" | 32 | RRECOMMENDS:${PN} += "kernel-module-nf-tables" |
| @@ -34,7 +35,7 @@ PACKAGES =+ "${PN}-python" | |||
| 34 | FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" | 35 | FILES:${PN}-python = "${nonarch_libdir}/${PYTHON_DIR}" |
| 35 | RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" | 36 | RDEPENDS:${PN}-python = "python3-core python3-json ${PN}" |
| 36 | 37 | ||
| 37 | RDEPENDS:${PN}-ptest += " make bash python3-core python3-ctypes python3-json python3-misc util-linux" | 38 | RDEPENDS:${PN}-ptest += " ${PN}-python make bash python3-core python3-ctypes python3-json python3-misc util-linux" |
| 38 | 39 | ||
| 39 | TESTDIR = "tests" | 40 | TESTDIR = "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 |
