diff --git a/python-zope-interface.spec b/python-zope-interface.spec index 5ad509e..d4dae17 100644 --- a/python-zope-interface.spec +++ b/python-zope-interface.spec @@ -1,8 +1,9 @@ -%global debug_package %{nil} +# Install doc subpackage files into the main package doc directory +%global _docdir_fmt %{name} Name: python-zope-interface Version: 5.4.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Zope 3 Interface Infrastructure License: ZPLv2.1 URL: https://pypi.io/project/zope.interface @@ -18,12 +19,12 @@ This is a separate distribution of the zope.interface package used in Zope 3. Summary: Zope 3 Interface Infrastructure %{?python_provide:%python_provide python3-zope-interface} +BuildRequires: gcc +BuildRequires: make BuildRequires: python3-devel -BuildRequires: python3-setuptools -BuildRequires: python3-zope-event -BuildRequires: python3-zope-testing - -Requires: python3-zope-event +BuildRequires: python3-docs +BuildRequires: %{py3_dist sphinx} +BuildRequires: %{py3_dist repoze-sphinx-autointerface} %description -n python3-zope-interface Interfaces are a mechanism for labeling objects as conforming to a given API @@ -31,19 +32,36 @@ or contract. This is a separate distribution of the zope.interface package used in Zope 3. +%package doc +Summary: Documentation for zope.interface +BuildArch: noarch + +%description doc +Documentation for %{name}. + %prep -%setup -n zope.interface-%{version} -q -rm -rf %{modname}.egg-info +%autosetup -n zope.interface-%{version} + +# Update the sphinx theme name +sed -i "s/'default'/'classic'/" docs/conf.py + +# Use local objects.inv for intersphinx +sed -i "s|\('https://docs\.python\.org/': \)None|\1'%{_docdir}/python3-docs/html/objects.inv'|" docs/conf.py + +%generate_buildrequires +%pyproject_buildrequires -t %build -%py3_build +%pyproject_wheel + +# build the sphinx documents +PYTHONPATH=$PWD/src make -C docs html +rm -f docs/_build/html/.buildinfo %install -%py3_install -# Will put docs in %%{_docdir} instead -%{__rm} -f %{buildroot}%{python3_sitearch}/zope/interface/*.txt +%pyproject_install # C files don't need to be packaged -%{__rm} -f %{buildroot}%{python3_sitearch}/zope/interface/_zope_interface_coptimizations.c +rm -f %{buildroot}%{python3_sitearch}/zope/interface/_zope_interface_coptimizations.c %check # We have to run tests installed together with the package @@ -53,17 +71,25 @@ PURE_PYTHON=1 python3 -m unittest discover -s zope/interface -t . popd %files -n python3-zope-interface -%doc README.rst CHANGES.rst COPYRIGHT.txt docs/ -%license LICENSE.txt +%doc README.rst CHANGES.rst +%license COPYRIGHT.txt LICENSE.txt %{python3_sitearch}/zope/interface/ # Co-own %%{python3_sitearch}/zope/ %dir %{python3_sitearch}/zope/ %exclude %{python3_sitearch}/zope/interface/tests/ %exclude %{python3_sitearch}/zope/interface/common/tests/ -%{python3_sitearch}/zope.interface-*.egg-info +%{python3_sitearch}/zope.interface-*.dist-info %{python3_sitearch}/zope.interface-*-nspkg.pth +%files doc +%doc docs/_build/html/ + %changelog +* Wed Sep 8 2021 Jerry James - 5.4.0-4 +- BR gcc to build the optimized interface +- Add doc subpackage to hold Sphinx-built documentation +- Modernize the spec file + * Fri Jul 23 2021 Fedora Release Engineering - 5.4.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild