%{!?__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_with python3 %else %bcond_with python3 %endif %global project rackspace-auth-openstack %global modname rackspace_auth_openstack Name: python-%{project} Version: 1.3 Release: 3%{?dist} Summary: Rackspace authentication for OpenStack clients License: ASL 2.0 URL: https://github.com/rackerlabs/%{project} Source0: https://pypi.python.org/packages/source/r/%{project}/%{project}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-novaclient BuildRequires: pytest BuildRequires: python-pytest-cov Requires: python-httpretty Requires: python-invoke Requires: python-py Requires: python-novaclient %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-pytest BuildRequires: python3-pytest-cov %endif # with python3 %description A plugin for OpenStack clients which provides client support for Rackspace authentication extensions for OpenStack. %if %{with python3} %package -n python3-rackspace-auth-openstack Summary: Rackspace authentication for OpenStack clients Requires: python3-novaclient Requires: python3-httpretty Requires: python3-py Requires: python3-invoke %description -n python3-rackspace-auth-openstack A plugin for OpenStack clients which provides client support for Rackspace authentication extensions for OpenStack. %endif %prep %setup -qc mv %{project}-%{version} python2 %if %{with python3} cp -a python2 %{py3dir} %endif %build pushd python2 %py2_build popd %if %{with python3} pushd %{py3dir} %{py3_build} popd %endif %install rm -rf %{buildroot} %if %{with python3} pushd %{py3dir} %py3_install popd %endif pushd python2 %py2_install popd %check pushd python2 %{__python2} setup.py test popd %if %{with python3} pushd %{py3dir} %{__python3} setup.py test popd %endif %files %doc python2/README.rst python2/ChangeLog python2/AUTHORS %license python2/LICENSE %{python2_sitelib}/%{modname} %{python2_sitelib}/%{modname}-%{version}-py%{python2_version}.egg-info/* %if %{with python3} %files -n python3-rackspace-auth-openstack %doc python3/README.rst python2/ChangeLog python2/AUTHORS %license python3/LICENSE %{python3_sitelib}/%{modname} %{python3_sitelib}/%{modname}-%{version}-py%{python3_version}.egg-info/* %endif # with python3 %changelog * Fri Aug 21 2015 Pete Travis 1.3-2 - Spec file improvements, including sane requires. * Mon Aug 10 2015 Pete Travis 1.3-1 - Initial packaging.