diff --git a/python-sure.spec b/python-sure.spec index 1755e94..070e267 100644 --- a/python-sure.spec +++ b/python-sure.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-sure Version: 2.0.0 Release: %autorelease @@ -35,12 +41,16 @@ BuildRequires: python3dist(pytest) BuildRequires: python3dist(pytest-cov) # Documentation dependencies +%if %{with doc_pdf} BuildRequires: make # development.txt: Sphinx==2.3.1 BuildRequires: python3dist(sphinx) # development.txt: sphinx-rtd-theme==0.4.3 BuildRequires: python3dist(sphinx-rtd-theme) BuildRequires: python3-docs +BuildRequires: python3-sphinx-latex +BuildRequires: latexmk +%endif %global common_description %{expand: An idiomatic testing library for python with powerful and flexible assertions @@ -86,8 +96,10 @@ cp -p '%{SOURCE1}' . %build %pyproject_wheel -env PYTHONPATH="${PWD}" %make_build -C docs/ html SPHINXOPTS='%{?_smp_mflags}' -rm -vf docs/_build/html/.buildinfo +%if %{with doc_pdf} +env PYTHONPATH="${PWD}" %make_build -C docs/ latex SPHINXOPTS='%{?_smp_mflags}' +%make_build -C docs/build/latex +%endif %install @@ -111,7 +123,9 @@ install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 sure.1 %doc CHANGELOG.md %doc README.rst %doc TODO.rst -%doc docs/build/html +%if %{with doc_pdf} +%doc docs/build/latex/Sure.pdf +%endif %changelog