%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%if 0%{?fedora}
%global with_python3 1
%endif
%global modname cliff
Name: python-%{modname}
Version: 2.13.0
Release: 2%{?dist}
Summary: Command Line Interface Formulation Framework
Group: Development/Libraries
License: ASL 2.0
URL: https://pypi.io/pypi/cliff
Source0: %pypi_source cliff
BuildArch: noarch
%description
cliff is a framework for building command line programs. It uses setuptools
entry points to provide subcommands, output formatters, and other
extensions.
Documentation for cliff is hosted on readthedocs.org at
http://readthedocs.org/docs/cliff/en/latest/
%package -n python2-%{modname}
Summary: Command Line Interface Formulation Framework
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires: python2-devel
BuildRequires: python2-setuptools
BuildRequires: python2-pbr
BuildRequires: python2-prettytable
BuildRequires: python2-cmd2 >= 0.6.7
BuildRequires: python2-stevedore
BuildRequires: python2-six
Requires: python2-prettytable
Requires: python2-cmd2 >= 0.6.7
Requires: python2-stevedore >= 1.20.0
Requires: python2-six
Requires: python2-unicodecsv
Requires: python2-pyyaml
%if %{?rhel}%{!?rhel:0} == 6
BuildRequires: python-argparse
Requires: python-argparse
%endif
%description -n python2-%{modname}
cliff is a framework for building command line programs. It uses setuptools
entry points to provide subcommands, output formatters, and other
extensions.
Documentation for cliff is hosted on readthedocs.org at
http://readthedocs.org/docs/cliff/en/latest/
%package -n python2-%{modname}-tests
Summary: Command Line Interface Formulation Framework
%{?python_provide:%python_provide python2-%{modname}-tests}
# Required for the test suite
BuildRequires: python2-mock
BuildRequires: bash
BuildRequires: python2-unicodecsv
BuildRequires: python2-pyyaml
BuildRequires: which
BuildRequires: python2-docutils
BuildRequires: python2-subunit
BuildRequires: python2-testrepository
BuildRequires: python2-testscenarios
BuildRequires: python2-testtools
Requires: python2-%{modname} = %{version}-%{release}
Requires: python2-mock
Requires: bash
Requires: python2-unicodecsv
Requires: python2-pyyaml
Requires: which
Requires: python2-subunit
Requires: python2-testrepository
Requires: python2-testscenarios
Requires: python2-testtools
%description -n python2-%{modname}-tests
This package contains tests for the python cliff library.
%if 0%{?with_python3}
%package -n python3-cliff
Summary: Command Line Interface Formulation Framework
Group: Development/Libraries
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pbr
BuildRequires: python3-prettytable
BuildRequires: python3-cmd2 >= 0.6.7
BuildRequires: python3-stevedore
BuildRequires: python3-six
BuildRequires: python3-PyYAML
BuildRequires: python3-testtools
Requires: python3-prettytable
Requires: python3-cmd2 >= 0.6.7
Requires: python3-stevedore >= 1.20.0
Requires: python3-six
Requires: python3-PyYAML
%description -n python3-cliff
cliff is a framework for building command line programs. It uses setuptools
entry points to provide subcommands, output formatters, and other
extensions.
Documentation for cliff is hosted on readthedocs.org at
http://readthedocs.org/docs/cliff/en/latest/
%package -n python3-%{modname}-tests
Summary: Command Line Interface Formulation Framework
%{?python_provide:%python_provide python3-%{modname}-tests}
# Required for the test suite
BuildRequires: python3-mock
BuildRequires: bash
BuildRequires: python3-unicodecsv
BuildRequires: python3-PyYAML
BuildRequires: which
BuildRequires: python3-docutils
BuildRequires: python3-subunit
BuildRequires: python3-testrepository
BuildRequires: python3-testscenarios
BuildRequires: python3-testtools
Requires: python3-%{modname} = %{version}-%{release}
Requires: bash
Requires: python3-unicodecsv
Requires: python3-PyYAML
Requires: which
Requires: python3-subunit
Requires: python3-testrepository
Requires: python3-testscenarios
Requires: python3-testtools
%description -n python3-%{modname}-tests
This package contains tests for the python cliff library.
%endif
%prep
%setup -q -n %{modname}-%{upstream_version}
rm -rf {test-,}requirements.txt
# Remove bundled egg info
rm -rf *.egg-info
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
%if 0%{?with_python3}
%py3_install
%endif
%py2_install
%check
%if 0%{?with_python3}
# FIXME(hguemar): required as unversioned python binary has been moved
# to a separate package in F29+
# Will be useless when cliff switches to stestr as its tests runner
export PYTHON=python3
%{__python3} setup.py test
rm -rf .testrepository
%endif
export PYTHON=python2
%{__python2} setup.py test
unset -v PYTHON
%files -n python2-%{modname}
%license LICENSE
%doc doc/ README.rst ChangeLog AUTHORS CONTRIBUTING.rst
%{python2_sitelib}/%{modname}
%{python2_sitelib}/%{modname}-*.egg-info
%exclude %{python2_sitelib}/%{modname}/tests
%files -n python2-%{modname}-tests
%{python2_sitelib}/%{modname}/tests
%if 0%{?with_python3}
%files -n python3-%{modname}
%license LICENSE
%doc doc/ README.rst ChangeLog AUTHORS CONTRIBUTING.rst
%{python3_sitelib}/%{modname}
%{python3_sitelib}/%{modname}-*.egg-info
%exclude %{python3_sitelib}/%{modname}/tests
%files -n python3-%{modname}-tests
%{python3_sitelib}/%{modname}/tests
%endif
%changelog
* Wed Jul 25 2018 Haïkel Guémar <hguemar@fedoraproject.org> - 2.13.0-2
- Modernize spec files
- Fix FTBFS (RHBZ#1605632)
* Wed Jul 25 2018 Pierre-Yves Chibon <pingou@pingoured.fr> - 2.13.0
- Update to 2.13.0
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 2.9.1-4
- Rebuilt for Python 3.7
* Fri Mar 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.9.1-3
- Update Python 2 dependency declarations to new packaging standards
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.9.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Sun Oct 22 2017 Kevin Fenzi <kevin@scrye.com> - 2.9.1-1
- Update to 2.9.1. Fixes bug #1448974
* Mon Oct 16 2017 Petr Viktorin <pviktori@redhat.com> 3.8.0-2
- Use explicit Python version in "python2-cliff" package name
* Thu Aug 10 2017 Alfredo Moralejo <amoralej@redhat.com> 2.8.0-1
- Update to 2.8.0