Fix python2 subpackage build for Fedora < 30 and non-Fedora

Previously, the python2 subpackage was only built when the Fedora version was > 30. This had the opposite effect to what was desired.

This commit changes that, and builds the python2 subpackage on non-Fedora and when Fedora version is < 30.
This commit is contained in:
Javier Peña 2018-10-19 13:53:49 +00:00
parent 88b274dea4
commit 9575159115

View File

@ -1,14 +1,16 @@
%global pypi_name colorama
%if 0%{?fedora}
%if 0%{?fedora} > 29 || 0%{?rhel} > 7
%bcond_with python2
%bcond_without python3
%else
%bcond_without python2
%bcond_with python3
%endif
Name: python-%{pypi_name}
Version: 0.4.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Cross-platform colored terminal text
License: BSD
@ -27,7 +29,7 @@ It also provides some shortcuts to help generate ANSI sequences, and works fine
in conjunction with any other ANSI sequence generation library, such as
Termcolor.
%if 0%{?fedora} > 29
%if %{with python2}
%package -n python2-%{pypi_name}
Summary: Cross-platform colored terminal text
BuildRequires: python2-devel
@ -76,7 +78,7 @@ Python 3 version.
rm -rf *.egg-info
%build
%if 0%{?fedora} > 29
%if %{with python2}
%py2_build
%endif
%if %{with python3}
@ -84,14 +86,14 @@ rm -rf *.egg-info
%endif
%install
%if 0%{?fedora} > 29
%if %{with python2}
%py2_install
%endif
%if %{with python3}
%py3_install
%endif
%if 0%{?fedora} > 29
%if %{with python2}
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE.txt
@ -108,6 +110,9 @@ rm -rf *.egg-info
%endif
%changelog
* Fri Oct 19 2018 Javier Peña <jpena@redhat.com> - 0.4.0-2
- Fix python2 package for non-Fedora
* Fri Oct 19 2018 Matthias Runge <mrunge@redhat.com> - 0.4.0-1
- update to 0.4.0