From d33128556b455c9e04fc16d42155bbdb43250124 Mon Sep 17 00:00:00 2001 From: Shawn Wang Date: Mon, 10 Apr 2023 16:17:54 +0800 Subject: [PATCH] Optimize the spec file Signed-off-by: Shawn Wang --- python-requests-ftp.spec | 55 +++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/python-requests-ftp.spec b/python-requests-ftp.spec index 75a56e8..e9fad28 100644 --- a/python-requests-ftp.spec +++ b/python-requests-ftp.spec @@ -1,57 +1,46 @@ -%define anolis_release 3 -%global srcname requests-ftp +%define anolis_release 4 +%global pypi_name requests-ftp -Name: python-%{srcname} +Name: python-%{pypi_name} Version: 0.3.1 Release: %{anolis_release}%{?dist} Summary: FTP transport adapter for python-requests - -License: ASL 2.0 -URL: https://github.com/Lukasa/requests-ftp -Source0: https://pypi.python.org/packages/source/r/%{srcname}/%{srcname}-%{version}.tar.gz - +License: Apache-2.0 +URL: https://github.com/Lukasa/%{pypi_name} +Source0: https://pypi.python.org/packages/source/r/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch -# from https://github.com/Lukasa/requests-ftp/pull/28, handle multi-line responses -# from 4090846 Patch1: PR28-01-Adding-2-tests-and-updated-statud_code-build.patch -# from 4f6a9f5 Patch2: PR28-02-Adding-code-3-to-retr4ieve-status_code.patch -# from 3fb2700 Patch3: PR28-03-fix-warning-in-interpreting-ftp-status-codes-minor-d.patch -# 2caa427 is only test updates, tests not in pypi tarball -# from 7321ab3 Patch5: PR28-05-Improve-logging-in-status-code-extraction.patch - %description -Requests-FTP is an implementation of a very stupid FTP transport adapter for +%{pypi_name} is an implementation of a very stupid FTP transport adapter for use with the awesome Requests Python library. -%package -n python3-%{srcname} -Summary: FTP transport adapter for python3-requests -%{?python_provide:%python_provide python3-%{srcname}} +%package -n python%{python3_pkgversion}-%{pypi_name} +Summary: FTP transport adapter for python%{python3_pkgversion}-requests +%{?python_provide:%python_provide python%{python3_pkgversion}-%{pypi_name}} +BuildRequires: python%{python3_pkgversion}-devel +Requires: python%{python3_pkgversion}-requests -BuildRequires: python3-devel - -Requires: python3-requests - -%description -n python3-requests-ftp -Requests-FTP is an implementation of a very stupid FTP transport adapter for +%description -n python%{python3_pkgversion}-%{pypi_name} +%{pypi_name} is an implementation of a very stupid FTP transport adapter for use with the awesome Requests Python library. This is the Python 3 version of the transport adapter module. %package doc -Summary: Documentation files for %{srcname} -Requires: python3-%{srcname} = %{version}-%{release} +Summary: Documentation files for %{pypi_name} +Requires: python%{python3_pkgversion}-%{pypi_name} = %{version}-%{release} BuildArch: noarch %description doc -The python3-%{srcname}-doc package contains documentation files for %{srcname}. +The python%{python3_pkgversion}-%{pypi_name}-doc package contains documentation files for %{pypi_name}. %prep -%autosetup -n %{srcname}-%{version} -p1 +%autosetup -n %{pypi_name}-%{version} -p1 rm -rf requests_ftp.egg-info %generate_buildrequires @@ -62,16 +51,18 @@ rm -rf requests_ftp.egg-info %install %pyproject_install +%pyproject_save_files requests_ftp -%files -n python3-%{srcname} +%files -n python%{python3_pkgversion}-%{pypi_name} -f %{pyproject_files} %license LICENSE -%{python3_sitelib}/requests_ftp/ -%{python3_sitelib}/requests_ftp-%{version}.dist-info/ %files doc %doc README.rst %changelog +* Mon Apr 10 2023 Shawn Wang - 0.3.1-4 +- Optimize the spec file + * Mon Feb 27 2023 mgb01105731 - 0.3.1-3 - optimise dependency -- Gitee