%global pypi_name tempest-lib %global module_name tempest_lib %if 0%{?fedora} %global with_python3 1 %endif Name: python-%{pypi_name} Version: 0.7.0 Release: 1%{?dist} Summary: OpenStack Functional Testing Library License: ASL 2.0 URL: http://www.openstack.org/ Source0: https://pypi.python.org/packages/source/t/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python-pbr BuildRequires: python-oslo-sphinx BuildRequires: python-sphinx BuildRequires: python-testtools BuildRequires: python-monotonic %description tempest-lib is a library of common functionality that was originally in tempest. %package -n python2-%{pypi_name} Summary: OpenStack Functional Testing Library %{?python_provide:%python_provide python-%{pypi_name}} Requires: python-pbr Requires: python-babel Requires: python-fixtures Requires: python-iso8601 Requires: python-jsonschema Requires: python-httplib2 Requires: python-paramiko Requires: python-six Requires: python-oslo-log Requires: python-os-testr %description -n python2-%{pypi_name} tempest-lib is a library of common functionality that was originally in tempest. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: OpenStack Functional Testing Library BuildRequires: python3-devel BuildRequires: python3-pbr BuildRequires: python3-mock Requires: python3-pbr %description -n python3-%{pypi_name} tempest-lib is a library of common functionality that was originally in tempest. %endif # if with_python3 %prep %setup -q -n %{pypi_name}-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' %endif # with_python3 %build export PBR_VERSION=%{version} %{__python2} setup.py build # generate html docs and man page sphinx-build doc/source html sphinx-build -b man doc/source man # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif # with_python3 %install %{__python2} setup.py install --skip-build --root %{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root %{buildroot} popd %endif # with_python3 mkdir -p %{buildroot}%{_mandir}/man1 install -p -D -m 644 man/*.1 %{buildroot}%{_mandir}/man1/ %check set +e cp .testr.conf %{buildroot}%{python2_sitelib}/ cd %{buildroot}%{python2_sitelib}/ testr init testr run rc=$? if [ $rc != 0 ]; then testr failing fi rm -rf .testr* exit $rc %files -n python2-%{pypi_name} %doc html README.rst %{!?_licensedir:%global license %%doc} %license LICENSE %{_bindir}/skip-tracker %{python2_sitelib}/%{module_name} %{python2_sitelib}/%{module_name}-%{version}-py?.?.egg-info %{_mandir}/man1/* %if 0%{?with_python3} %files -n python3-%{pypi_name} %license LICENSE %doc html README.rst %{python3_sitelib}/%{module_name} %{python3_sitelib}/%{module_name}-%{version}-py?.?.egg-info %endif # with_python3 %changelog * Mon Sep 7 2015 Frederic Lepied 1.5.3-1 - initial release