%global pypi_name sphinxcontrib-apidoc %if 0%{?fedora} || 0%{?rhel} > 7 %global with_python3 1 %endif Name: python-%{pypi_name} Version: 0.2.1 Release: 6%{?dist} Summary: A Sphinx extension for running 'sphinx-apidoc' on each build License: BSD URL: http://www.sphinx-doc.org/ Source0: https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python2-pbr BuildRequires: python2-pytest BuildRequires: python2-sphinx BuildRequires: python2-setuptools %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-pbr BuildRequires: python3-pytest BuildRequires: python3-sphinx BuildRequires: python3-setuptools %endif %global common_desc \ This package contains Sphinx extension for running sphinx-apidoc_ \ on each build.Overview *sphinx-apidoc* is a tool for automatic generation \ of Sphinx sources that, using the autodoc _ extension, \ documents a whole package in the style of other automatic API documentation \ tools. *sphinx-apidoc* does not actually build documentation - rather it \ simply generates it. %description %common_desc %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} Requires: python2-pbr Requires: python2-sphinx %description -n python2-%{pypi_name} %common_desc %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3-pbr Requires: python3-sphinx %description -n python3-%{pypi_name} %common_desc %endif %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %py2_build %if 0%{?with_python3} %py3_build %endif %install %py2_install %if 0%{?with_python3} %py3_install %endif # %check # FIXME(chkumar246): Tests are broken in current version, So # disabling it, Once new version will be available. We will # add it. # py.test || # %if %{with python3} # py.test-3 || # %endif %files -n python2-%{pypi_name} %license LICENSE %doc README.rst %{python2_sitelib}/sphinxcontrib_apidoc*nspkg.pth %{python2_sitelib}/sphinxcontrib/apidoc %{python2_sitelib}/sphinxcontrib_apidoc-%{version}-py?.?.egg-info %if %{with python3} %files -n python3-%{pypi_name} %license LICENSE %doc README.rst %{python3_sitelib}/sphinxcontrib_apidoc*nspkg.pth %{python3_sitelib}/sphinxcontrib/apidoc %{python3_sitelib}/sphinxcontrib_apidoc-%{version}-py?.?.egg-info %endif %changelog * Tue Apr 10 2018 Chandan Kumar - 0.2.1-6 - Fixed python3 files * Tue Apr 10 2018 Chandan Kumar - 0.2.1-5 - Disabled tests * Tue Apr 10 2018 Chandan Kumar - 0.2.1-4 - Added conditional for python3 support * Tue Apr 10 2018 Chandan Kumar - 0.2.1-3 - Added python3 conditionals on BR * Tue Apr 10 2018 Chandan Kumar - 0.2.1-2 - Added python3 BR and fixed tests * Tue Apr 10 2018 Chandan Kumar - 0.2.1-1 - Initial package.