%global pypi_name sphinx-click Name: python-%{pypi_name} Version: 1.0.4 Release: 1%{?dist} Summary: Sphinx extension that automatically documents click applications License: MIT License URL: https://github.com/stephenfin/sphinx-click Source0: https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz # Upstream patch, not released yet # https://github.com/click-contrib/sphinx-click/commit/a61fa7385cace7c290c44c31ad733bdf2f504860 Patch0: 0001-add-commands-option.patch BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2dist(setuptools) BuildRequires: (python2dist(click) < 7.0 with python2dist(click) >= 5.0) BuildRequires: (python2dist(coverage) < 5.0 with python2dist(coverage) > 4.3) BuildRequires: python2dist(pbr) >= 2.0 BuildRequires: (python2dist(sphinx) < 2.0 with python2dist(sphinx) >= 1.5) BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: (python3dist(click) < 7.0 with python3dist(click) >= 5.0) BuildRequires: (python3dist(coverage) < 5.0 with python3dist(coverage) > 4.3) BuildRequires: python3dist(pbr) >= 2.0 BuildRequires: (python3dist(sphinx) < 2.0 with python3dist(sphinx) >= 1.5) %global sphinx-click-desc \ sphinx-click is a Sphinx plugin that allows you to automatically extract\ documentation from a click-based application and include it in your docs. %description %{sphinx-click-desc} %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} Requires: python2dist(pbr) >= 2.0 Requires: (python2dist(sphinx) < 2.0 with python2dist(sphinx) >= 1.5) %description -n python2-%{pypi_name} %{sphinx-click-desc} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3dist(pbr) >= 2.0 Requires: (python3dist(sphinx) < 2.0 with python3dist(sphinx) >= 1.5) %description -n python3-%{pypi_name} %{sphinx_click-desc} %package -n python-%{pypi_name}-doc Summary: sphinx-click documentation %description -n python-%{pypi_name}-doc Documentation for sphinx-click %prep %autosetup -p1 -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %py3_build # generate html docs sphinx-build-3 docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install # Must do the default python version install last because # the scripts in /usr/bin are overwritten with every setup.py install. %py2_install %py3_install %check %{__python2} setup.py test %{__python3} setup.py test %files -n python2-%{pypi_name} %license LICENSE %doc README.rst %{python2_sitelib}/sphinx_click %{python2_sitelib}/sphinx_click-%{version}-py?.?.egg-info %files -n python3-%{pypi_name} %license LICENSE %doc README.rst %{python3_sitelib}/sphinx_click %{python3_sitelib}/sphinx_click-%{version}-py?.?.egg-info %files -n python-%{pypi_name}-doc %doc html %license LICENSE %changelog * Wed Feb 07 2018 Michal Cyprian - 1.0.4-1 - Initial package.