add new python and python3 packages with language bindings (rh #1167112)

Resolves: 1167112
This commit is contained in:
Thomas Haller 2015-01-05 11:06:32 +01:00
parent c42a3ddece
commit 9e1c1903bc

View File

@ -1,6 +1,6 @@
Name: libnl3
Version: 3.2.25
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Convenience library for kernel netlink sockets
Group: Development/Libraries
License: LGPLv2
@ -17,6 +17,9 @@ Patch3: 0003-fix-python-meta-data.patch
BuildRequires: flex bison
BuildRequires: python
BuildRequires: libtool autoconf automake
BuildRequires: swig
BuildRequires: python2-devel
BuildRequires: python3-devel
%description
This package contains a convenience library to simplify
@ -50,6 +53,22 @@ Requires: %{name} = %{version}-%{release}
%description doc
This package contains libnl3 API documentation
%package -n python-libnl3
Summary: libnl3 binding for Python 2
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description -n python-libnl3
Python 2 bindings for libnl3
%package -n python3-libnl3
Summary: libnl3 binding for Python 3
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
%description -n python3-libnl3
Python 3 bindings for libnl3
%prep
%setup -q -n libnl-%{fullversion}
%patch1 -p1 -b .0001-link-inet6-add-support-for-tokenized-interface-ident.orig
@ -63,14 +82,32 @@ autoreconf -vif
%configure --disable-static
make %{?_smp_mflags}
pushd ./python/
# build twice, otherwise capi.py is not copied to the build directory.
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
popd
%install
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -name \*.la -delete
pushd ./python/
%{__python3} setup.py install --skip-build --root "$RPM_BUILD_ROOT"
%{__python2} setup.py install --skip-build --root "$RPM_BUILD_ROOT"
popd
%check
make check
pushd ./python/
%{__python3} setup.py check
%{__python2} setup.py check
popd
%post -p /sbin/ldconfig
%post cli -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -106,7 +143,20 @@ make check
%doc libnl-doc-%{fullversion}/images/icons/callouts/*
%doc libnl-doc-%{fullversion}/api/*
%files -n python-libnl3
%defattr(-,root,root,-)
%{python2_sitearch}/netlink
%{python2_sitearch}/netlink-*.egg-info
%files -n python3-libnl3
%defattr(-,root,root,-)
%{python3_sitearch}/netlink
%{python3_sitearch}/netlink-*.egg-info
%changelog
* Tue Feb 3 2015 Thomas Haller <thaller@redhat.com> - 3.2.25-6
* add new packages with language bindings for Python 2 and Python 3 (rh #1167112)
* Tue Dec 9 2014 Thomas Haller <thaller@redhat.com> - 3.2.25-5
- Add support for IPv6 link local address generation