diff options
| author | Frank Vanbever <frank.vanbever@essensium.com> | 2020-03-11 11:54:46 +0100 |
|---|---|---|
| committer | Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> | 2022-01-06 21:25:33 +0100 |
| commit | d341ec035067120b456f669a826e26eb594c0237 (patch) | |
| tree | 1c47c6f4db516e3ffe76e4a34c02166161c12868 | |
| parent | c8324bf87c38ddc3a746c01346ca39477021fd83 (diff) | |
| download | buildroot-d341ec035067120b456f669a826e26eb594c0237.tar.bz2 | |
package/python-iptables: use installed iptables by default
python-iptables depends on ctypes.util.find_library() which does not
work due to the absence of gcc and friends on target. The location of
the xtables library and the iptables modules can be configured through
environment variables. Within the scope of buildroot we can determine
what these should be at build time and replace the calls to os.getenv()
with the correct value.
Fixes: https://bugs.busybox.net/show_bug.cgi?id=12271
Signed-off-by: Frank Vanbever <frank.vanbever@essensium.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
| -rw-r--r-- | package/python-iptables/Config.in | 2 | ||||
| -rw-r--r-- | package/python-iptables/python-iptables.mk | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/package/python-iptables/Config.in b/package/python-iptables/Config.in index a35577bad3..0e24283d06 100644 --- a/package/python-iptables/Config.in +++ b/package/python-iptables/Config.in @@ -1,7 +1,7 @@ config BR2_PACKAGE_PYTHON_IPTABLES bool "python-iptables" depends on !BR2_STATIC_LIBS - select BR2_PACKAGE_IPTABLES # runtime dependency + select BR2_PACKAGE_IPTABLES help Python bindings for iptables. diff --git a/package/python-iptables/python-iptables.mk b/package/python-iptables/python-iptables.mk index 72bf292c77..0ccf064217 100644 --- a/package/python-iptables/python-iptables.mk +++ b/package/python-iptables/python-iptables.mk @@ -9,5 +9,14 @@ PYTHON_IPTABLES_SITE = https://files.pythonhosted.org/packages/ca/6e/cba9c6f4b5a PYTHON_IPTABLES_SETUP_TYPE = setuptools PYTHON_IPTABLES_LICENSE = Apache-2.0 PYTHON_IPTABLES_LICENSE_FILES = NOTICE +PYTHON_IPTABLES_DEPENDENCIES = iptables + +define PYTHON_IPTABLES_SET_XTABLES_ENV_VARS + XTABLES_VERSION=`awk '/XTABLES_VERSION_CODE/ {print $$NF}' $(STAGING_DIR)/usr/include/xtables-version.h`; \ + sed -i "s%os.getenv(\"PYTHON_IPTABLES_XTABLES_VERSION\")%$$XTABLES_VERSION%" $(@D)/iptc/xtables.py + sed -i "s%os.getenv(\"XTABLES_LIBDIR\")%\"/usr/lib/xtables\"%" $(@D)/iptc/xtables.py +endef + +PYTHON_IPTABLES_PRE_BUILD_HOOKS += PYTHON_IPTABLES_SET_XTABLES_ENV_VARS $(eval $(python-package)) |
