diff --git a/python-pyrsistent.spec b/python-pyrsistent.spec index 12b9ae7..6687518 100644 --- a/python-pyrsistent.spec +++ b/python-pyrsistent.spec @@ -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 Summary: Persistent/Functional/Immutable data structures Version: 0.18.0 @@ -16,7 +22,11 @@ BuildRequires: python3-devel BuildRequires: gcc # For Sphinx documentation +%if %{with doc_pdf} BuildRequires: make +BuildRequires: python3-sphinx-latex +BuildRequires: latexmk +%endif # We need manual BR’s since they are generally not available where # %%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 # are some warnings. We want to build the documentation as best we can anyway. # Additionally, we parallelize sphinx-build. -%make_build -C docs html SPHINXOPTS='-n %{?_smp_mflags}' -rm -f docs/build/html/.buildinfo +%if %{with doc_pdf} +PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='-n %{?_smp_mflags}' +%make_build -C docs/build/latex +%endif %install @@ -134,7 +146,9 @@ env PYTHONHASHSEED=0 %pytest --doctest-modules pyrsistent %license LICENSE.mit %doc CHANGES.txt %doc README.rst -%doc docs/build/html +%if %{with doc_pdf} +%doc docs/build/latex/Pyrsistent.pdf +%endif %changelog