From c48a9ab0b810a466e5b57090fa347589bdf4a628 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Wed, 27 Oct 2021 10:35:38 -0400 Subject: [PATCH] Update specfile to build for more distro versions --- python-autopage.spec | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/python-autopage.spec b/python-autopage.spec index af1359b..abc9907 100644 --- a/python-autopage.spec +++ b/python-autopage.spec @@ -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 0.4.0-2 +- Update specfile to build for more distros + * Mon Jul 12 2021 Zane Bitter 0.4.0-1 - Update to v0.4.0