From b444af78b90a9a906abc3e24679ec359a20b9dd0b4197330ce94dd7fe62d1f44 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 6 Jan 2024 14:46:14 +0000 Subject: [PATCH] Accepting request 1136461 from home:bnavigator:branches:security:netfilter - Fix the python bindings subpackages * The PEP517 python build requires setuptools * Actually use the rpm subpackage definition * The version is actually python3dist(nftables) = 0.1 * is noarch and requires libnftables1 through dlopen, tell rpmlint * remove unused shebang OBS-URL: https://build.opensuse.org/request/show/1136461 OBS-URL: https://build.opensuse.org/package/show/security:netfilter/nftables?expand=0&rev=87 --- nftables.changes | 11 +++++++++++ nftables.rpmlintrc | 2 ++ nftables.spec | 19 ++++++++++++++----- 3 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 nftables.rpmlintrc diff --git a/nftables.changes b/nftables.changes index 5f76cea..e529a84 100644 --- a/nftables.changes +++ b/nftables.changes @@ -3,6 +3,17 @@ Thu Jan 4 08:04:39 UTC 2024 - Dirk Müller - buildrequire setuptools explicitly as pip drops the dependency +------------------------------------------------------------------- +Wed Jan 3 10:05:39 UTC 2024 - Ben Greiner + +- Fix the python bindings subpackages + * The PEP517 python build requires setuptools + * Actually use the rpm subpackage definition + * The version is actually python3dist(nftables) = 0.1 + * is noarch and requires libnftables1 through dlopen, tell + rpmlint + * remove unused shebang + ------------------------------------------------------------------- Thu Oct 19 23:42:57 UTC 2023 - Jan Engelhardt diff --git a/nftables.rpmlintrc b/nftables.rpmlintrc new file mode 100644 index 0000000..16cd97f --- /dev/null +++ b/nftables.rpmlintrc @@ -0,0 +1,2 @@ +# dlopen of python package not recognized by rpm requirements generator +addFilter("explicit-lib-dependency libnftables1") diff --git a/nftables.spec b/nftables.spec index 4efdec8..f53abe5 100644 --- a/nftables.spec +++ b/nftables.spec @@ -16,6 +16,11 @@ # +# configure subpackage rewriter for the python3XX-nftables bindings +%define python_subpackage_only 1 +# check py/src/nftable.py:NFTABLES_VERSION +%define pyversion 0.1 + Name: nftables Version: 1.0.9 Release: 0 @@ -28,6 +33,7 @@ URL: https://netfilter.org/projects/nftables/ Source: http://ftp.netfilter.org/pub/%name/%name-%version.tar.xz Source2: http://ftp.netfilter.org/pub/%name/%name-%version.tar.xz.sig Source3: %name.keyring +Source4: nftables.rpmlintrc BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module wheel} @@ -79,15 +85,17 @@ This package contains the header files for the library. %package -n python-nftables Summary: Python bindings for nftables Group: Development/Languages/Python -Conflicts: python3-nftables # uses dlopen Requires: libnftables1 +BuildArch: noarch %description -n python-nftables Python bindings for nftables %prep %autosetup -p1 +# remove unused shebang +sed -i '1{/bin/d}' py/src/nftables.py %build autoreconf -fi @@ -120,7 +128,7 @@ mv -v "$b/%_datadir/nftables"/*.nft "$b/%_docdir/%name/examples/" %post -n libnftables1 -p /sbin/ldconfig %postun -n libnftables1 -p /sbin/ldconfig -%files -n nftables +%files %license COPYING %_sysconfdir/nftables/ %_sbindir/nft @@ -131,13 +139,14 @@ mv -v "$b/%_datadir/nftables"/*.nft "$b/%_docdir/%name/examples/" %files -n libnftables1 %_libdir/libnftables.so.1* -%files -n nftables-devel +%files devel %_includedir/%name/ %_libdir/libnftables.so %_libdir/pkgconfig/*.pc %_mandir/man3/*.3* -%files %{python_files} -%{python_sitelib}/nftables* +%files %{python_files nftables} +%{python_sitelib}/nftables +%{python_sitelib}/nftables-%{pyversion}.dist-info %changelog