%if 0%{?fedora} %global with_python3 1 %endif %global pypi_name cliff-tablib Name: python-%{pypi_name} Version: 1.1 Release: 1%{?dist} Summary: Tablib formatters for python-cliff License: ASL 2.0 URL: https://github.com/dreamhost/cliff-tablib Source0: https://pypi.python.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-setuptools BuildRequires: python-sphinx Requires: python-cliff %description cliff-tablib is a set of formatter extensions for producing JSON, YAML, and HTML output in programs created with the cliff framework. %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Tablib formatters for python3-cliff BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-sphinx Requires: python3-cliff %description -n python3-%{pypi_name} cliff-tablib is a set of formatter extensions for producing JSON, YAML, and HTML output in programs created with the cliff framework. %endif %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build # generate html docs sphinx-build docs/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build # generate html docs sphinx-build-3 docs/source html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} popd %endif %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 %files %doc html %{python2_sitelib}/clifftablib %{python2_sitelib}/cliff_tablib-%{version}-py?.?.egg-info %if 0%{?with_python3} %files -n python3-%{pypi_name} %doc html %{python3_sitelib}/clifftablib %{python3_sitelib}/cliff_tablib-%{version}-py?.?.egg-info %endif %changelog * Fri May 08 2015 Haïkel Guémar - 1.1-1 - Initial package.