From 10d415d7fa3e84bc4e037d5c47e6daaf60871a03 Mon Sep 17 00:00:00 2001 From: wk333 <13474090681@163.com> Date: Fri, 5 May 2023 16:20:03 +0800 Subject: [PATCH] Compling package with pyproject --- python-pyroute2.spec | 45 +++++++++++++++++--------------------------- setup.py | 6 ------ 2 files changed, 17 insertions(+), 34 deletions(-) delete mode 100644 setup.py diff --git a/python-pyroute2.spec b/python-pyroute2.spec index 0cf6afe..4bfd8b5 100644 --- a/python-pyroute2.spec +++ b/python-pyroute2.spec @@ -1,12 +1,12 @@ %global _empty_manifest_terminate_build 0 +%global srcname pyroute2 Name: python-pyroute2 Version: 0.7.3 -Release: 2 +Release: 3 Summary: Python Netlink library License: GPL-2.0-or-later 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 @@ -20,6 +20,9 @@ Summary: Python Netlink library Provides: python-pyroute2 = %{version}-%{release} BuildRequires: python3-devel BuildRequires: python3-setuptools +BuildRequires: python3-pip +BuildRequires: python3-wheel +Requires: python3-psutil %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 @@ -34,46 +37,32 @@ Development documents and examples for pyroute2. %prep %autosetup -n pyroute2-%{version} -cp %{SOURCE1} ./ %build -%py3_build +%pyproject_build %install -%py3_install +%pyproject_install pyroute2==%{version} 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 -n python3-pyroute2 +%{python3_sitelib}/* +%{_bindir}/ss2 +%{_bindir}/%{srcname}-cli +%{_bindir}/%{srcname}-dhcp-client +%{_bindir}/%{srcname}-test-platform -%files help -f doclist.lst +%files help %{_docdir}/* %changelog +* Fri May 05 2023 wangkai <13474090681@163.com> - 0.7.3-3 +- Compling package with pyproject + * Fri Dec 09 2022 liukuo - 0.7.3-2 - License compliance rectification diff --git a/setup.py b/setup.py deleted file mode 100644 index bac24a4..0000000 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -import setuptools - -if __name__ == "__main__": - setuptools.setup()