From 46eaead7824a8dd4dcb0a9edf445a883dd9f6107 Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Oct 06 2021 15:07:13 +0000 Subject: conditionalize building docs Make it possible to disable building the documentation subpackage. This makes it easier to build this package on platforms where not all the doc dependencies are available. For example, CentOS 9 does not have a "python3-docs" subpackage. --- diff --git a/python-zope-interface.spec b/python-zope-interface.spec index d4dae17..d1caf89 100644 --- a/python-zope-interface.spec +++ b/python-zope-interface.spec @@ -1,3 +1,5 @@ +%bcond_without docs + # Install doc subpackage files into the main package doc directory %global _docdir_fmt %{name} @@ -22,9 +24,6 @@ Summary: Zope 3 Interface Infrastructure BuildRequires: gcc BuildRequires: make BuildRequires: python3-devel -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 @@ -32,12 +31,17 @@ or contract. This is a separate distribution of the zope.interface package used in Zope 3. +%if %{with docs} %package doc Summary: Documentation for zope.interface BuildArch: noarch +BuildRequires: python3-docs +BuildRequires: %{py3_dist sphinx} +BuildRequires: %{py3_dist repoze-sphinx-autointerface} %description doc Documentation for %{name}. +%endif %prep %autosetup -n zope.interface-%{version} @@ -54,9 +58,11 @@ sed -i "s|\('https://docs\.python\.org/': \)None|\1'%{_docdir}/python3-docs/html %build %pyproject_wheel +%if %{with docs} # build the sphinx documents PYTHONPATH=$PWD/src make -C docs html rm -f docs/_build/html/.buildinfo +%endif %install %pyproject_install @@ -81,8 +87,10 @@ popd %{python3_sitearch}/zope.interface-*.dist-info %{python3_sitearch}/zope.interface-*-nspkg.pth +%if %{with docs} %files doc %doc docs/_build/html/ +%endif %changelog * Wed Sep 8 2021 Jerry James - 5.4.0-4