4aa8997
%bcond testcoverage 0
4aa8997
12d63d4
Name:           rpmspectool
4aa8997
Version:        1.99.9
b529d4e
Release:        %autorelease
a2822cb
Summary:        Utility for dealing with RPM spec files
12d63d4
a2822cb
License:        GPL-3.0-or-later
12d63d4
URL:            https://github.com/nphilipp/rpmspectool
a2822cb
Source0:        %{pypi_source %{name}}
12d63d4
BuildArch:      noarch
12d63d4
12d63d4
BuildRequires:  python3-devel
ee2b619
BuildRequires:  sed
4aa8997
# The dependencies needed for testing don’t get auto-generated.
4aa8997
BuildRequires:  python3dist(pytest)
4aa8997
%if %{with testcoverage}
4aa8997
BuildRequires:  python3dist(pytest-cov)
4aa8997
BuildRequires:  sed
4aa8997
%endif
4aa8997
ee2b619
Requires:       python3dist(%{name}) = %{version}
12d63d4
ee2b619
%generate_buildrequires
ee2b619
%{pyproject_buildrequires}
ee2b619
ee2b619
%global _description %{expand:
12d63d4
The rpmspectool utility lets users expand and download sources and patches in
ee2b619
RPM spec files.}
ee2b619
ee2b619
%description %_description
ee2b619
ee2b619
%package -n python3-%{name}
ee2b619
Summary:        %{summary}
ee2b619
ee2b619
%description -n python3-%{name} %_description
ee2b619
ee2b619
This package contains the Python package used by the rpmspectool CLI.
12d63d4
12d63d4
%prep
a2822cb
%autosetup
12d63d4
4aa8997
%if %{without testcoverage}
4aa8997
cat << PYTESTINI > pytest.ini
4aa8997
[pytest]
4aa8997
addopts =
4aa8997
PYTESTINI
4aa8997
%endif
4aa8997
12d63d4
%build
ee2b619
%pyproject_wheel
12d63d4
12d63d4
%install
ee2b619
%pyproject_install
ee2b619
%pyproject_save_files %{name}
ee2b619
sed -i -e 's|^\(.*/COPYING\)|%%license \1|g' %{pyproject_files}
ee2b619
ee2b619
mkdir -p %{buildroot}%{_datadir}/bash-completion/
ee2b619
cp shell-completions/bash/rpmspectool %{buildroot}%{_datadir}/bash-completion/
12d63d4
4aa8997
%check
4aa8997
%pytest -v
4aa8997
12d63d4
%files
12d63d4
%license COPYING
12d63d4
%doc README.md
12d63d4
%{_bindir}/rpmspectool
3016d95
%{_datadir}/bash-completion/
12d63d4
ee2b619
%files -n python3-%{name} -f %{pyproject_files}
ee2b619
12d63d4
%changelog
b529d4e
%autochangelog