From 3f8f611eb86f3735b0067394c22a5b55e2fc5376 Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Jun 01 2018 17:58:24 +0000 Subject: Removing py3 build from non-fedora --- diff --git a/python-ansible-runner.spec b/python-ansible-runner.spec index 95ecc3f..4c048fa 100644 --- a/python-ansible-runner.spec +++ b/python-ansible-runner.spec @@ -1,9 +1,13 @@ # Created by pyp2rpm-3.2.2 %global pypi_name ansible-runner +%if 0%{?fedora} +%global with_python3 1 +%endif + Name: python-%{pypi_name} Version: 1.0.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A tool and python library to interface with Ansible License: ASL 2.0 @@ -36,16 +40,7 @@ BuildRequires: %{py2_dist setuptools} BuildRequires: %{py2_dist six} %endif -%if 0%{?el7} -BuildRequires: python34-devel -BuildRequires: python34-mock -BuildRequires: python34-psutil -BuildRequires: python34-pexpect >= 4.5 -BuildRequires: python34-pytest -BuildRequires: python34-PyYAML -BuildRequires: python34-setuptools -BuildRequires: python34-six -%else +%if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3dist(mock) BuildRequires: python3dist(psutil) @@ -87,32 +82,24 @@ Ansible Runner is a tool and python library that helps when interfacing with Ansible from other systems whether through a container image interface, as a standalone tool, or imported into a python project. +%if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: %{summary} -%if ! 0%{?el7} %{?python_provide:%python_provide python3-%{pypi_name}} -%endif Requires: ansible >= 2.5 Requires: python3-daemon -%if 0%{?el7} -Requires: pexpect >= 4.5 -Requires: python-psutil -Requires: PyYAML -Requires: python-setuptools -Requires: python-six -%else Requires: python3dist(pexpect) >= 4.5 Requires: python3dist(psutil) Requires: python3dist(pyyaml) Requires: python3dist(setuptools) Requires: python3dist(six) -%endif %description -n python3-%{pypi_name} Ansible Runner is a tool and python library that helps when interfacing with Ansible from other systems whether through a container image interface, as a standalone tool, or imported into a python project. +%endif %prep %autosetup -n %{pypi_name}-%{version} @@ -121,7 +108,9 @@ rm -rf %{pypi_name}.egg-info %build %py2_build +%if 0%{?with_python3} %py3_build +%endif %install # Must do the subpackages' install first because the scripts in /usr/bin are @@ -131,13 +120,17 @@ rm -rf %{pypi_name}.egg-info cp %{buildroot}/%{_bindir}/ansible-runner %{buildroot}/%{_bindir}/ansible-runner-%{python2_version} ln -s %{_bindir}/ansible-runner-%{python2_version} %{buildroot}/%{_bindir}/ansible-runner-2 +%if 0%{?with_python3} %py3_install cp %{buildroot}/%{_bindir}/ansible-runner %{buildroot}/%{_bindir}/ansible-runner-%{python3_version} ln -s %{_bindir}/ansible-runner-%{python3_version} %{buildroot}/%{_bindir}/ansible-runner-3 +%endif %check %{__python2} setup.py test ||: +%if 0%{?with_python3} %{__python3} setup.py test ||: +%endif %files -n python2-%{pypi_name} %license LICENSE.md @@ -149,6 +142,7 @@ ln -s %{_bindir}/ansible-runner-%{python3_version} %{buildroot}/%{_bindir}/ansib %{python2_sitelib}/test %{python2_sitelib}/ansible_runner-%{version}-py?.?.egg-info +%if 0%{?with_python3} %files -n python3-%{pypi_name} %license LICENSE.md %doc README.md @@ -158,10 +152,11 @@ ln -s %{_bindir}/ansible-runner-%{python3_version} %{buildroot}/%{_bindir}/ansib %{python3_sitelib}/ansible_runner %{python3_sitelib}/test %{python3_sitelib}/ansible_runner-%{version}-py?.?.egg-info +%endif %changelog -* Fri Jun 01 2018 Dan Radez - 1.0.3-2 -- Updates to help RDO build +* Fri Jun 01 2018 Dan Radez - 1.0.3-3 +- skip py3 on non-fedora * Thu May 31 2018 Dan Radez - 1.0.3-1 - Updating to version 1.0.3 * Tue May 29 2018 Dan Radez - 1.0.2-1