%global pypi_name pylxd %global tag .0b2 %if 0%{?fedora} %global with_python3 1 %endif Name: python-%{pypi_name} Version: 2.0.0 Release: 0.1%{?tag}%{?dist} Summary: python library for lxd License: ASL 2.0 URL: http://www.linuxcontainers.org Source0: https://pypi.python.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}%{?tag}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-pbr >= 1.8 BuildRequires: python-requests >= 2.5.2 BuildRequires: python-requests-unixsocket >= 0.1.4 BuildRequires: python-sphinx %description A Python library for interacting with the LXD REST API. %package -n python2-%{pypi_name} Summary: python library for lxd %{?python_provide:%python_provide python2-%{pypi_name}} %description -n python2-%{pypi_name} A Python library for interacting with the LXD REST API. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: python library for lxd %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pbr >= 1.8 BuildRequires: python3-requests >= 2.5.2 BuildRequires: python3-requests-unixsocket >= 0.1.4 BuildRequires: python3-sphinx %description -n python3-%{pypi_name} A Python library for interacting with the LXD REST API. %endif %package -n python-%{pypi_name}-doc Summary: pylxd documentation %description -n python-%{pypi_name}-doc Documentation for pylxd %prep %autosetup -n %{pypi_name}-%{version}%{?tag} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %if 0%{?with_python3} %py3_build %endif # generate html docs sphinx-build doc/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install. %if 0%{?with_python3} %py3_install %endif %py2_install %files -n python2-%{pypi_name} %doc doc/source/readme.rst README.md %license LICENSE %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc doc/source/readme.rst README.md %license LICENSE %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif %files -n python-%{pypi_name}-doc %doc html %changelog * Tue Mar 8 2016 Haïkel Guémar - 2.0.0-0.1.0b2 - Initial package.