Build Sphinx-generated docs as PDF, not HTML, to sidestep guidelines issues

epel9
Benjamin A. Beasley 1 year ago
parent 59dbd503ac
commit cdd903e8f5

@ -1,3 +1,7 @@
# Sphinx-generated HTML documentation is not suitable for packaging; see
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
#
# We can generate PDF documentation as a substitute.
%bcond docs 1
Name: python-wrapt
@ -30,6 +34,9 @@ Summary: %{summary}
%package doc
Summary: Documentation for the wrapt module
BuildRequires: make
BuildRequires: python3-sphinx-latex
BuildRequires: latexmk
# docs/requirements.txt
BuildRequires: %{py3_dist sphinx}
BuildRequires: %{py3_dist sphinx_rtd_theme}
@ -48,10 +55,9 @@ rm -rf wrapt.egg-info
%py3_build
%if %{with docs}
# for docs
pushd docs
sphinx-build -b html -d build/doctrees . build/html
popd
PYTHONPATH="${PWD}" %make_build -C docs latex \
SPHINXOPTS='-j%{?_smp_build_ncpus}'
%make_build -C docs/_build/latex LATEXMKOPTS='-quiet'
%endif
%install
@ -60,7 +66,7 @@ popd
%if %{with docs}
%files doc
%license LICENSE
%doc docs/build/html
%doc docs/_build/latex/wrapt.pdf
%endif
%files -n python3-wrapt

Loading…
Cancel
Save