%global pkgname repoze.sphinx.autointerface %global srcname %(tr . - <<< %{pkgname}) Name: python-%{srcname} Version: 0.8 Release: %mkrel 5 Group: Development/Python Summary: Auto-generate Sphinx API docs from Zope interfaces License: BSD URL: https://github.com/repoze/%{pkgname} Source0: https://github.com/repoze/%{pkgname}/archive/%{version}/%{pkgname}-%{version}.tar.gz BuildArch: noarch BuildRequires: pkgconfig(python2) BuildRequires: python2dist(setuptools) BuildRequires: python2dist(sphinx) BuildRequires: python2dist(zope.interface) BuildRequires: pkgconfig(python3) BuildRequires: python3dist(setuptools) BuildRequires: python3dist(sphinx) BuildRequires: python3dist(zope.interface) %{?python_provide:%python_provide python-%{srcname}} %global common_desc \ This package defines an extension for the Sphinx documentation system. \ The extension allows generation of API documentation by introspection of \ zope.interface instances in code. %description %{common_desc} %package -n python2-%{srcname} Group: Development/Python Summary: Auto-generate Sphinx API docs from Zope interfaces Requires: python2dist(sphinx) Requires: python2dist(zope.interface) %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} %{common_desc} %package -n python3-%{srcname} Group: Development/Python Summary: Auto-generate Sphinx API docs from Zope interfaces Requires: python3dist(sphinx) Requires: python3dist(zope.interface) %{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} %{common_desc} %prep %setup -q -c cp -a %{pkgname}-%{version} python3-%{pkgname}-%{version} %build # Python 2 build pushd %{pkgname}-%{version} %py2_build python2 %{_bindir}/rst2html --no-datestamp CHANGES.rst CHANGES.html python2 %{_bindir}/rst2html --no-datestamp README.rst README.html popd # Python 3 build pushd python3-%{pkgname}-%{version} %py3_build popd %install # Python 2 install pushd %{pkgname}-%{version} %py2_install popd # Python 3 install pushd python3-%{pkgname}-%{version} %py3_install popd %files -n python2-%{srcname} %doc %{pkgname}-%{version}/CHANGES.html %{pkgname}-%{version}/CONTRIBUTORS.txt %doc %{pkgname}-%{version}/README.html %license %{pkgname}-%{version}/COPYRIGHT.txt %{pkgname}-%{version}/LICENSE.txt %{python2_sitelib}/* %files -n python3-%{srcname} %doc %{pkgname}-%{version}/CHANGES.html %{pkgname}-%{version}/CONTRIBUTORS.txt %doc %{pkgname}-%{version}/README.html %license %{pkgname}-%{version}/COPYRIGHT.txt %{pkgname}-%{version}/LICENSE.txt %{python3_sitelib}/*