%global pypi_name colorama %if 0%{?rhel} %if 0%{?rhel}> 7 %bcond_with python2 %bcond_without python3 %else %bcond_without python2 %bcond_with python3 %endif %else %if 0%{?fedora} > 29 %bcond_without python3 %else %bcond_without python2 %bcond_without python3 %endif %endif Name: python-%{pypi_name} Version: 0.4.4 Release: %autorelease Summary: Cross-platform colored terminal text License: BSD URL: http://pypi.python.org/pypi/colorama Source0: https://files.pythonhosted.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %description Makes ANSI escape character sequences, for producing colored terminal text and cursor positioning, work under MS Windows. ANSI escape character sequences have long been used to produce colored terminal text and cursor positioning on Unix and Macs. Colorama makes this work on Windows, too. 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 %{with python2} %package -n python2-%{pypi_name} Summary: Cross-platform colored terminal text BuildRequires: python2-devel %{?el6:BuildRequires: python-setuptools} %{!?el6:BuildRequires: python2-setuptools} %{?el6:Provides: python-%{pypi_name}} %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} Makes ANSI escape character sequences, for producing colored terminal text and cursor positioning, work under MS Windows. ANSI escape character sequences have long been used to produce colored terminal text and cursor positioning on Unix and Macs. Colorama makes this work on Windows, too. 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. Python 2 version. %endif %if %{with python3} %package -n python3-%{pypi_name} Summary: Cross-platform colored terminal text %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-setuptools %description -n python3-%{pypi_name} Makes ANSI escape character sequences, for producing colored terminal text and cursor positioning, work under MS Windows. ANSI escape character sequences have long been used to produce colored terminal text and cursor positioning on Unix and Macs. Colorama makes this work on Windows, too. 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. Python 3 version. %endif %prep %autosetup -n %{pypi_name}-%{version} rm -rf *.egg-info %build %if %{with python2} %py2_build %endif %if %{with python3} %py3_build %endif %install %if %{with python2} %py2_install %endif %if %{with python3} %py3_install %endif %if %{with python2} %files -n python2-%{pypi_name} %doc README.rst %license LICENSE.txt %{python2_sitelib}/%{pypi_name}/ %{python2_sitelib}/%{pypi_name}-%{version}-*.egg-info/ %endif %if %{with python3} %files -n python3-%{pypi_name} %doc README.rst %license LICENSE.txt %{python3_sitelib}/%{pypi_name}/ %{python3_sitelib}/%{pypi_name}-%{version}-*.egg-info/ %endif %changelog %autochangelog