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