%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 URL: https://github.com/click-contrib/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: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: python3dist(click) BuildRequires: python3dist(coverage) BuildRequires: python3dist(pbr) >= 2.0 BuildRequires: python3dist(sphinx) %global package_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 %{package_desc} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3dist(pbr) >= 2.0 Requires: python3dist(sphinx) %description -n python3-%{pypi_name} %{package_desc} %package -n python-%{pypi_name}-doc Summary: Documentation for sphinx-click %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 %py3_build # generate html docs sphinx-build-3 docs html # remove the sphinx-build leftovers rm -rf html/.{doctrees,buildinfo} %install %py3_install %check %{__python3} setup.py test %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.