]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
py: remove setup.py integration with autotools
authorPablo Neira Ayuso <pablo@netfilter.org>
Tue, 18 Jul 2023 12:01:19 +0000 (14:01 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 1 Sep 2025 20:36:32 +0000 (22:36 +0200)
commit b3def33efecb2f7be39fc9aefc9546907202056c upstream.

With Python distutils and setuptools going deprecated, remove
integration with autotools. This integration is causing issues
in modern environments.

Note that setup.py is still left in place under the py/ folder.

Update INSTALL file to refer to Python support and setup.py.

Acked-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
INSTALL
Makefile.am
configure.ac
py/Makefile.am

diff --git a/INSTALL b/INSTALL
index 9a597057ae3ecb4fb7e812a441f00b817a7cacc0..9b626745d7a41e72dfde6a8b6d547b5ba69ee177 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -81,6 +81,13 @@ Installation instructions for nftables
  Run "make" to compile nftables, "make install" to install it in the
  configured paths.
 
+ Python support
+ ==============
+
+ CPython bindings are available for nftables under the py/ folder.
+
+ setup.py is provided to install it.
+
  Source code
  ===========
 
index 72fb4e88012da3796402717ba0496d1ee29f1058..84c3c366b86a91d96a8201f2212b6aa95ab9590d 100644 (file)
@@ -4,10 +4,8 @@ SUBDIRS =      src     \
                include \
                files   \
                doc     \
-               examples
-if HAVE_PYTHON
-SUBDIRS += py
-endif
+               examples\
+               py
 
 EXTRA_DIST =   tests   \
                files
index a9c4b78fb093e79a22616f51eb2772dac09e5235..2239bc7ef6e77c6acbda3348c8bc54b70361a870 100644 (file)
@@ -108,25 +108,6 @@ AC_DEFINE([HAVE_LIBJANSSON], [1], [Define if you have libjansson])
 ])
 AM_CONDITIONAL([BUILD_JSON], [test "x$with_json" != xno])
 
-AC_ARG_ENABLE(python,
-       AS_HELP_STRING([--enable-python], [Enable python]),,[enable_python=check]
-       )
-
-AC_ARG_WITH([python_bin],
-            [AS_HELP_STRING([--with-python-bin], [Specify Python binary to use])],
-           [PYTHON_BIN="$withval"], [AC_PATH_PROGS(PYTHON_BIN, python python2 python2.7 python3)]
-          )
-
-AS_IF([test "x$PYTHON_BIN" = "x"], [
-       AS_IF([test "x$enable_python" = "xyes"], [AC_MSG_ERROR([Python asked but not found])],
-       [test "x$enable_python" = "xcheck"], [
-               AC_MSG_WARN([Python not found, continuing anyway])
-               enable_python=no
-       ])
-])
-
-AM_CONDITIONAL([HAVE_PYTHON], [test "$enable_python" != "no"])
-
 AC_CONFIG_FILES([                                      \
                Makefile                                \
                libnftables.pc                          \
@@ -157,10 +138,3 @@ nft configuration:
   enable man page:              ${enable_man_doc}
   libxtables support:          ${with_xtables}
   json output support:          ${with_json}"
-
-AS_IF([test "$enable_python" != "no"], [
-       echo "  enable Python:          yes (with $PYTHON_BIN)"
-       ], [
-       echo "  enable Python:          no"
-       ]
-       )
index 215ecd9e47513007f30cd266fcac1da387ce3ea9..f10ae360599feeeec3d40d032c0f4eac159a2e5d 100644 (file)
@@ -1,28 +1 @@
 EXTRA_DIST = setup.py __init__.py nftables.py schema.json
-
-all-local:
-       cd $(srcdir) && \
-               $(PYTHON_BIN) setup.py build --build-base $(abs_builddir)
-
-install-exec-local:
-       cd $(srcdir) && \
-               $(PYTHON_BIN) setup.py build --build-base $(abs_builddir) \
-               install --prefix $(DESTDIR)$(prefix)
-
-uninstall-local:
-       rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/nftables
-       rm -rf $(DESTDIR)$(prefix)/lib*/python*/dist-packages/nftables
-       rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/nftables-[0-9]*.egg-info
-       rm -rf $(DESTDIR)$(prefix)/lib*/python*/dist-packages/nftables-[0-9]*.egg-info
-       rm -rf $(DESTDIR)$(prefix)/lib*/python*/site-packages/nftables-[0-9]*.egg
-       rm -rf $(DESTDIR)$(prefix)/lib*/python*/dist-packages/nftables-[0-9]*.egg
-
-clean-local:
-       cd $(srcdir) && \
-               $(PYTHON_BIN) setup.py clean \
-               --build-base $(abs_builddir)
-       rm -rf scripts-* lib* build dist bdist.* nftables.egg-info
-       find . -name \*.pyc -delete
-
-distclean-local:
-       rm -f version