%{!?__python2: %global __python2 %__python} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %if 0%{?fedora} %bcond_without python3 %else %bcond_with python3 %endif %global pkgname testinfra Name: python-%{pkgname} Version: 1.10.1 Release: 1%{?dist} Summary: Unit testing for config-managed server state License: ASL 2.0 URL: https://github.com/philpep/%{pkgname} Source0: %{url}/archive/%{version}/%{pkgname}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-pbr # testing requirements BuildRequires: python2-mock BuildRequires: python2-six BuildRequires: python2-pytest BuildRequires: python2-pytest-xdist BuildRequires: python2-pytest-cov BuildRequires: python2-winrm BuildRequires: python2-paramiko BuildRequires: salt %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-pbr # testing requirements BuildRequires: python3-mock BuildRequires: python3-six BuildRequires: python3-pytest BuildRequires: python3-pytest-xdist BuildRequires: python3-pytest-cov BuildRequires: python3-winrm BuildRequires: python3-paramiko %endif # with python3 %if %{with python3} BuildRequires: python3-sphinx %else BuildRequires: python2-sphinx %endif # with python3 %description With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools like Salt, Ansible, Puppet, Chef and so on. Testinfra aims to be a Serverspec equivalent in python and is written as a plugin to the powerful Pytest test engine %package -n python2-%{pkgname} Summary: Unit testing for config-managed server state %{?python_provide:%python_provide python2-%{pkgname}} %description -n python2-%{pkgname} With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools like Salt, Ansible, Puppet, Chef and so on. Testinfra aims to be a Serverspec equivalent in python and is written as a plugin to the powerful Pytest test engine %if %{with python3} %package -n python3-%{pkgname} Summary: Unit testing for config-managed server state %{?python_provide:%python_provide python3-%{pkgname}} %description -n python3-%{pkgname} With Testinfra you can write unit tests in Python to test actual state of your servers configured by management tools like Salt, Ansible, Puppet, Chef and so on. Testinfra aims to be a Serverspec equivalent in python and is written as a plugin to the powerful Pytest test engine %endif # with python3 %prep %autosetup -n %{pkgname}-%{version} %build SKIP_PIP_INSTALL=1 PBR_VERSION=%{version} %py2_build %if %{with python3} SKIP_PIP_INSTALL=1 PBR_VERSION=%{version} %py3_build %endif # with python3 # generate html docs sphinx-build doc/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install SKIP_PIP_INSTALL=1 PBR_VERSION=%{version} %py2_install %if %{with python3} SKIP_PIP_INSTALL=1 PBR_VERSION=%{version} %py3_install %endif # with python3 %check SKIP_PIP_INSTALL=1 PBR_VERSION=%{version} %{__python2} setup.py test %files -n python2-%{pkgname} %license LICENSE %doc html *.rst %if %{without python3} %{_bindir}/%{pkgname} %endif # without python3 %{python2_sitelib}/%{pkgname} %{python2_sitelib}/%{pkgname}-%{version}-py?.?.egg-info %if %{with python3} %files -n python3-%{pkgname} %license LICENSE %doc html *.rst %{_bindir}/%{pkgname} %{python3_sitelib}/%{pkgname} %{python3_sitelib}/%{pkgname}-%{version}-py?.?.egg-info %endif # with python3 %changelog * Wed Jan 24 2018 Brett Lentz - 1.10.1-1 - initial package