Various little cleanups in the spec

- drop %{srcname} definition, expand the name in the spec
 - do not BR pyproject-rpm-macros explicitly
 - drop obsoleted %{?python_provide:...} construct
 - add -p1 to %autosetup as the most reasonable value for git patches
 - BuildRequire runtime dependencies even without tests
 - don't install the LICENSE file with %license manually, it is already installed in .dist-info
 - don't install the PKG-INFO file with %doc, it is not documentation

No need to build, hence not bumping the release.
This commit is contained in:
Miro Hrončok 2021-12-29 11:03:41 +01:00
parent 290b3ebed7
commit cf47133f7b

View File

@ -1,17 +1,15 @@
%bcond_without tests
%global srcname more-itertools
Name: python-%{srcname}
Name: python-more-itertools
Version: 8.12.0
Release: 1%{?dist}
Summary: More routines for operating on Python iterables, beyond itertools
License: MIT
URL: https://github.com/erikrose/more-itertools
Source0: %{pypi_source}
Source0: %{pypi_source more-itertools}
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros
%global _description %{expand:
Python's itertools library is a gem - you can compose elegant solutions for
@ -21,17 +19,16 @@ Python iterables.}
%description %_description
%package -n python3-%{srcname}
%package -n python3-more-itertools
Summary: %{summary}
%{?python_provide:%python_provide python3-%{srcname}}
%description -n python3-%{srcname} %_description
%description -n python3-more-itertools %_description
%prep
%autosetup -n %{srcname}-%{version}
%autosetup -p1 -n more-itertools-%{version}
%generate_buildrequires
%pyproject_buildrequires %{?with_tests:-r -t}
%pyproject_buildrequires -r %{?with_tests: -t}
%build
%pyproject_wheel
@ -45,9 +42,8 @@ Summary: %{summary}
%tox
%endif
%files -n python3-%{srcname} -f %pyproject_files
%license LICENSE
%doc README.rst PKG-INFO
%files -n python3-more-itertools -f %pyproject_files
%doc README.rst
%changelog
* Fri Dec 24 2021 Paul Wouters <paul.wouters@aiven.io> - 8.12.0-1