update spec file (sync with CentOS Stream 9)

This commit is contained in:
Thomas Haller 2022-04-21 16:28:59 +02:00
parent c77edb0e19
commit ae7a6c6ff7
No known key found for this signature in database
GPG Key ID: 29C2366E4DFC5728

View File

@ -8,23 +8,33 @@ URL: http://www.infradead.org/~tgr/libnl/
%define rcversion %{nil}
%define fullversion %{version}%{rcversion}
%if 0%{?rhel} > 8
# Disable python3 build by default
%bcond_with python3
%else
%bcond_without python3
%endif
Source: http://www.infradead.org/~tgr/libnl/files/libnl-%{fullversion}.tar.gz
Source1: http://www.infradead.org/~tgr/libnl/files/libnl-doc-%{fullversion}.tar.gz
#Patch1: some.patch
BuildRequires: flex
BuildRequires: bison
BuildRequires: libtool
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: flex
BuildRequires: libtool
BuildRequires: swig
%description
This package contains a convenience library to simplify
using the Linux kernel's netlink sockets interface for
network manipulation
%package devel
Summary: Libraries and headers for using libnl3
Requires: %{name} = %{version}-%{release}
@ -34,6 +44,7 @@ Requires: kernel-headers
%description devel
This package contains various headers for using libnl3
%package cli
Summary: Command line interface utils for libnl3
Requires: %{name} = %{version}-%{release}
@ -42,6 +53,7 @@ Requires: %{name} = %{version}-%{release}
This package contains various libnl3 utils and additional
libraries on which they depend
%package doc
Summary: API documentation for libnl3
Requires: %{name} = %{version}-%{release}
@ -50,6 +62,7 @@ Requires: %{name} = %{version}-%{release}
This package contains libnl3 API documentation
%if %{with python3}
%package -n python3-libnl3
Summary: libnl3 binding for Python 3
%{?python_provide:%python_provide python3-libnl3}
@ -59,11 +72,10 @@ Requires: %{name} = %{version}-%{release}
%description -n python3-libnl3
Python 3 bindings for libnl3
%endif
%prep
%setup -q -n libnl-%{fullversion}
#%patch1 -p1
%autosetup -p1 -n libnl-%{fullversion}
tar -xzf %SOURCE1
@ -72,27 +84,33 @@ autoreconf -vif
%configure
make %{?_smp_mflags}
%if %{with python3}
pushd ./python/
# build twice, otherwise capi.py is not copied to the build directory.
CFLAGS="$RPM_OPT_FLAGS" %py3_build
CFLAGS="$RPM_OPT_FLAGS" %py3_build
popd
%endif
%install
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name \*.la -delete
%if %{with python3}
pushd ./python/
%py3_install
popd
%endif
%check
make check
%if %{with python3}
pushd ./python/
%{__python3} setup.py check
popd
%endif
%ldconfig_scriptlets
%ldconfig_scriptlets cli
@ -128,10 +146,11 @@ popd
%doc libnl-doc-%{fullversion}/images/icons/callouts/*
%doc libnl-doc-%{fullversion}/api/*
%if %{with python3}
%files -n python3-libnl3
%{python3_sitearch}/netlink
%{python3_sitearch}/netlink-*.egg-info
%endif
%changelog
* Fri Apr 15 2022 Thomas Haller <thaller@redhat.com> - 3.6.0-1