%if 0%{?rhel} && 0%{?rhel} <= 7 %bcond_with python3 %else %bcond_without python3 %endif %global pypi_name cli_helpers Summary: Python helpers for common CLI tasks Name: python-cli_helpers Version: 0.2.0 Release: 1%{?dist} License: BSD URL: https://github.com/dbcli/cli_helpers Source0: https://files.pythonhosted.org/packages/source/c/cli_helpers/cli_helpers-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python2-terminaltables BuildRequires: python2-pytest %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-terminaltables BuildRequires: python3-pytest %endif %description CLI Helpers is a Python package that makes it easy to perform common tasks when building command-line apps. Its a helper library for command-line interfaces. %package -n python2-cli_helpers Summary: Python helpers for common CLI tasks %{?python_provide:%python_provide python2-cli_helpers} %{?el6:Provides: python-cli_helpers} Requires: python2-pygments >= 1.6 Requires: python2-terminaltables >= 3.0.0 %description -n python2-cli_helpers CLI Helpers is a Python package that makes it easy to perform common tasks when building command-line apps. Its a helper library for command-line interfaces. %if %{with python3} %package -n python3-cli_helpers Summary: Python helpers for common CLI tasks %{?python_provide:%python_provide python3-cli_helpers} Requires: python3-pygments >= 1.6 Requires: python3-terminaltables >= 3.0.0 %description -n python3-cli_helpers CLI Helpers is a Python package that makes it easy to perform common tasks when building command-line apps. Its a helper library for command-line interfaces. %endif # with python3 %prep %setup -q -n %{pypi_name}-%{version} rm -rf %{pypi_name}.egg-info %build %py2_build %if %{with python3} %py3_build %endif # with python3 %install %if %{with python3} %py3_install %endif # with python3 %py2_install %check PYTHONPATH=build/lib/ py.test-2 PYTHONPATH=build/lib/ py.test-3 %files -n python2-cli_helpers %license LICENSE %doc AUTHORS CHANGELOG README.rst %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if %{with python3} %files -n python3-cli_helpers %license LICENSE %doc AUTHORS CHANGELOG README.rst %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif # with python3 %changelog * Mon Jun 26 2017 Terje Rosten - 0.2.0-1 - 0.2.0 - Rename * Mon May 15 2017 Terje Rosten - 0.1.0-2 - Minor tweaks * Sat May 13 2017 Dick Marinus - 0.1.0-1 - Initial package