Update specfile to build for more distro versions

This commit is contained in:
Zane Bitter 2021-10-27 10:35:38 -04:00
commit c48a9ab0b8

View file

@ -1,15 +1,23 @@
%global srcname autopage
# Macros for pyproject (Fedora) vs. setup.py (CentOS)
%if 0%{?fedora}
%if 0%{?fedora} >= 33
%bcond_without pyproject
%else
%bcond_with pyproject
%endif
# Macros for disabling tests on CentOS 7
%if 0%{?el7}
%bcond_with enable_tests
%else
%bcond_without enable_tests
%endif
Name: python-%{srcname}
Version: 0.4.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: A Python library to provide automatic paging for console output
License: ASL 2.0
URL: https://pypi.python.org/pypi/autopage
@ -30,8 +38,10 @@ BuildRequires: python3-devel
%if %{with pyproject}
BuildRequires: pyproject-rpm-macros
%else
%if %{with enable_tests}
BuildRequires: %{py3_dist fixtures}
%endif
%endif
%description -n python3-%{srcname} %_description
@ -61,11 +71,13 @@ cp %{SOURCE1} ./
%endif
%check
%if %{with enable_tests}
%if %{with pyproject}
%tox
%else
%{python3} setup.py test
%endif
%endif
%if %{with pyproject}
%files -n python3-%{srcname} -f %{pyproject_files}
@ -78,6 +90,9 @@ cp %{SOURCE1} ./
%doc README.md
%changelog
* Wed Oct 27 2021 Zane Bitter <zaneb@fedoraproject.org> 0.4.0-2
- Update specfile to build for more distros
* Mon Jul 12 2021 Zane Bitter <zaneb@fedoraproject.org> 0.4.0-1
- Update to v0.4.0