%if 0%{?rhel} && 0%{?rhel} <= 7 %bcond_with python3 %else %bcond_without python3 %endif %if %{?fedora}%{!?fedora:0} >= 24 || %{?rhel}%{!?rhel:0} >= 7 %bcond_without tests %else %bcond_with tests %endif %global modname ansible-tower-cli %global shortname tower-cli Name: python-%{modname} Version: 3.0.3 Release: 1%{?dist} Summary: A CLI tool for Ansible Tower License: ASL 2.0 URL: https://github.com/ansible/tower-cli Source0: %{url}/archive/v%{version}/%{shortname}-%{version}.tar.gz BuildArch: noarch %global _description \ Ansible tower-cli is a command line tool for Ansible Tower.\ It allows Tower commands to be easily run from the Unix commandline. It can\ also be used as a client library for other python apps, or as a reference\ for others developing API interactions with Tower’s REST API. %description %{_description} %package -n python2-%{modname} Summary: %{summary} %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python-setuptools Requires: python-colorama Requires: python-requests Requires: python-six %else BuildRequires: python2-setuptools Requires: python2-colorama Requires: python2-requests Requires: python2-six %endif BuildRequires: python2-devel Requires: python-click Requires: PyYAML # Tests dependencies %if %{with tests} %if 0%{?rhel} && 0%{?rhel} <= 7 BuildRequires: python-virtualenv BuildRequires: python-nose BuildRequires: python-coverage BuildRequires: python-colorama BuildRequires: python-requests BuildRequires: python-six %else BuildRequires: python2-virtualenv BuildRequires: python2-nose BuildRequires: python2-coverage BuildRequires: python2-colorama BuildRequires: python2-requests BuildRequires: python2-six %endif BuildRequires: python2-fauxquests BuildRequires: python2-mock BuildRequires: python-click BuildRequires: PyYAML %endif %{?python_provide:%python_provide python2-%{modname}} %{!?with_python3:Provides: ansible-tower-cli = %{version}-%{release}} %description -n python2-%{modname} %{_description} Python 2 version. %if %{with python3} %package -n python3-%{modname} Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools %if %{with tests} BuildRequires: python3-virtualenv BuildRequires: python3-nose BuildRequires: python3-coverage BuildRequires: python3-fauxquests BuildRequires: python3-click BuildRequires: python3-colorama BuildRequires: python3-requests BuildRequires: python3-six BuildRequires: python3-PyYAML %endif Requires: python3-click Requires: python3-colorama Requires: python3-requests Requires: python3-six Requires: python3-PyYAML Provides: ansible-tower-cli = %{version}-%{release} %{?python_provide:%python_provide python3-%{modname}} %description -n python3-%{modname} %{_description} Python 3 version. %endif %prep %autosetup -n %{shortname}-%{version} %build %py2_build %if %{with python3} %py3_build %endif %install %py2_install %if %{with python3} %py3_install %endif mkdir -p %{buildroot}%{_sysconfdir}/tower touch %{buildroot}%{_sysconfdir}/tower/tower_cli.cfg %if %{with tests} %check nosetests-%{python2_version} -v %if %{with python3} nosetests-%{python3_version} -v || : %endif %endif %files -n python2-%{modname} %license LICENSE %doc README.rst %{python2_sitelib}/tower_cli/ %{python2_sitelib}/ansible_tower_cli-*.egg-info/ %if %{with python3} %files -n python3-%{modname} %license LICENSE %doc README.rst %{python3_sitelib}/tower_cli/ %{python3_sitelib}/ansible_tower_cli-*.egg-info/ %endif %{_bindir}/%{shortname} %config(noreplace) %{_sysconfdir}/tower/tower_cli.cfg %changelog * Wed Feb 08 2017 Fabio Alessandro Locati - 3.0.3-1 - Update to 3.0.3 * Mon Dec 19 2016 Miro Hrončok - 3.0.2-2 - Rebuild for Python 3.6 * Mon Dec 12 2016 Fabio Alessandro Locati - 3.0.2-1 - Update to 3.0.2 * Tue Sep 27 2016 Fabio Alessandro Locati - 3.0.1-1 - Update to 3.0.1 * Fri Aug 26 2016 Fabio Alessandro Locati - 3.0.0-3 - Add tests - Move from pypi sources to github - Some SPEC polishement * Fri Aug 26 2016 Fabio Alessandro Locati - 3.0.0-2 - Rename from ansible-tower-cli to python-ansible-tower-cli - This package now provides: - python2-ansible-tower-cli (py2 libs and bin if py3 package not compiled) - python3-ansible-tower-cli (py3 libs and bin if py3 package compiled) - ansible-tower-cli (metapackage pointing to package that contains the bin) * Thu Aug 25 2016 Fabio Alessandro Locati - 3.0.0-1 - Initial package.