python-pyroute2/python-pyroute2.spec
2022-12-08 17:47:13 +08:00

85 lines
2.5 KiB
RPMSpec

%global _empty_manifest_terminate_build 0
Name: python-pyroute2
Version: 0.7.3
Release: 1
Summary: Python Netlink library
License: GPLv2+ and Apache-2.0
URL: https://github.com/svinota/pyroute2
Source0: https://files.pythonhosted.org/packages/9c/e6/8d163b1aea84223696fef8f8c55566adf166b79d614d602469d64af00226/pyroute2-0.7.3.tar.gz
Source1: setup.py
BuildArch: noarch
%description
Pyroute2 is a pure Python **netlink** library. The core requires only Python
stdlib, no 3rd party libraries. The library was started as an RTNL protocol
implementation, so the name is **pyroute2**, but now it supports many netlink
protocols.
%package -n python3-pyroute2
Summary: Python Netlink library
Provides: python-pyroute2 = %{version}-%{release}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%description -n python3-pyroute2
Pyroute2 for python3 is a pure Python **netlink** library. The core requires only
Python stdlib, no 3rd party libraries. The library was started as an RTNL protocol
implementation, so the name is **pyroute2**, but now it supports many netlink
protocols.
%package help
Summary: Development documents and examples for pyroute2
Provides: python3-pyroute2-doc
%description help
Development documents and examples for pyroute2.
%prep
%autosetup -n pyroute2-%{version}
cp %{SOURCE1} ./
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-pyroute2 -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Mon Dec 05 2022 liqiuyu <liqiuyu@kylinos.cn> - 0.7.3-1
- Update package to version 0.7.3
* Fri Oct 23 2020 wutao <wutao61@huawei.com> - 0.5.14-1
- upgrade and disable python2 build
* Tue May 12 2020 hexiaowen <hexiaowen@huawei.com> - 0.5.3-6
- init packaging