Generate PDF instead of HTML Sphinx documentation.

See https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
This commit is contained in:
Benjamin A. Beasley 2021-09-29 19:28:28 -04:00
parent 3d21e9a99b
commit b9fee2d907

View File

@ -1,3 +1,9 @@
# 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 lesser substitute.
%bcond_without doc_pdf
Name: python-pyrsistent Name: python-pyrsistent
Summary: Persistent/Functional/Immutable data structures Summary: Persistent/Functional/Immutable data structures
Version: 0.18.0 Version: 0.18.0
@ -16,7 +22,11 @@ BuildRequires: python3-devel
BuildRequires: gcc BuildRequires: gcc
# For Sphinx documentation # For Sphinx documentation
%if %{with doc_pdf}
BuildRequires: make BuildRequires: make
BuildRequires: python3-sphinx-latex
BuildRequires: latexmk
%endif
# We need manual BRs since they are generally not available where # We need manual BRs since they are generally not available where
# %%pyproject_buildrequires can access them, i.e., outside requirements.txt, # %%pyproject_buildrequires can access them, i.e., outside requirements.txt,
@ -112,8 +122,10 @@ BuildArch: noarch
# Default SPHINXOPTS are '-W -n', but -W turns warnings into errors and there # Default SPHINXOPTS are '-W -n', but -W turns warnings into errors and there
# are some warnings. We want to build the documentation as best we can anyway. # are some warnings. We want to build the documentation as best we can anyway.
# Additionally, we parallelize sphinx-build. # Additionally, we parallelize sphinx-build.
%make_build -C docs html SPHINXOPTS='-n %{?_smp_mflags}' %if %{with doc_pdf}
rm -f docs/build/html/.buildinfo PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='-n %{?_smp_mflags}'
%make_build -C docs/build/latex
%endif
%install %install
@ -134,7 +146,9 @@ env PYTHONHASHSEED=0 %pytest --doctest-modules pyrsistent
%license LICENSE.mit %license LICENSE.mit
%doc CHANGES.txt %doc CHANGES.txt
%doc README.rst %doc README.rst
%doc docs/build/html %if %{with doc_pdf}
%doc docs/build/latex/Pyrsistent.pdf
%endif
%changelog %changelog