From 6da20b208590b50485fc3504111761205b6a4830 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Tue, 1 Oct 2019 10:51:31 +0200 Subject: [PATCH] nftables-0.9.2-3 - Drop unneeded docbook2X build dependency - Add python3-nftables sub-package --- nftables.spec | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/nftables.spec b/nftables.spec index 6bdd329..1e5dc70 100644 --- a/nftables.spec +++ b/nftables.spec @@ -3,7 +3,7 @@ Name: nftables Version: 0.9.2 #Release: 0.1.%%{snapdate}git%%{?dist} -Release: 2%{?dist} +Release: 3%{?dist} # Upstream released a 0.100 version, then 0.4. Need Epoch to get back on track. Epoch: 1 Summary: Netfilter Tables userspace utillites @@ -26,11 +26,11 @@ BuildRequires: libmnl-devel BuildRequires: gmp-devel BuildRequires: readline-devel BuildRequires: libnftnl-devel -BuildRequires: docbook2X BuildRequires: systemd BuildRequires: asciidoc BuildRequires: iptables-devel BuildRequires: jansson-devel +BuildRequires: python3-devel %description Netfilter Tables userspace utilities. @@ -43,6 +43,14 @@ Requires: pkgconfig %description devel Development tools and static libraries and header files for the libnftables library. +%package -n python3-nftables +Summary: Python module providing an interface to libnftables +Requires: %{name} = %{epoch}:%{version}-%{release} +%{?python_provide:%python_provide python3-nftables} + +%description -n python3-nftables +The nftables python module provides an interface to libnftables via ctypes. + %prep #setup -q -n nftables-%{snapdate} %setup -q @@ -72,6 +80,12 @@ mkdir -m 700 -p $RPM_BUILD_ROOT/%{_sysconfdir}/nftables chmod 600 $RPM_BUILD_ROOT/%{_sysconfdir}/nftables/*.nft chmod 700 $RPM_BUILD_ROOT/%{_sysconfdir}/nftables +# make nftables.py use the real library file name +# to avoid nftables-devel package dependency +sofile=$(readlink $RPM_BUILD_ROOT/%{_libdir}/libnftables.so) +sed -i -e 's/\(sofile=\)".*"/\1"'$sofile'"/' \ + $RPM_BUILD_ROOT/%{python3_sitelib}/nftables/nftables.py + %post %systemd_post nftables.service %ldconfig_post @@ -99,9 +113,17 @@ chmod 700 $RPM_BUILD_ROOT/%{_sysconfdir}/nftables %{_includedir}/nftables/libnftables.h %{_mandir}/man3/libnftables.3* +%files -n python3-nftables +%{python3_sitelib}/nftables-*.egg-info +%{python3_sitelib}/nftables/ + %changelog +* Tue Oct 01 2019 Phil Sutter - 1:0.9.2-3 +- Drop unneeded docbook2X build dependency +- Add python3-nftables sub-package + * Fri Aug 23 2019 Kevin Fenzi - 0.9.2-2 -- Mobe libnftables section 3 man page to devel package. +- Move libnftables section 3 man page to devel package. * Fri Aug 23 2019 Kevin Fenzi - 0.9.2-1 - Update to 0.9.2. Fixes bug #1743223