Build PDF docs instead of HTML
Sphinx-generated HTML documentation is not suitable for packaging; see https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion.
This commit is contained in:
parent
7858ed545f
commit
420fad1c89
@ -1,6 +1,12 @@
|
|||||||
%global forgeurl https://gitlab.gnome.org/GNOME/%{name}/
|
%global forgeurl https://gitlab.gnome.org/GNOME/%{name}/
|
||||||
%global tag %{version}
|
%global tag %{version}
|
||||||
|
|
||||||
|
# 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: gi-docgen
|
Name: gi-docgen
|
||||||
Version: 2021.7
|
Version: 2021.7
|
||||||
%forgemeta
|
%forgemeta
|
||||||
@ -46,9 +52,13 @@ BuildArch: noarch
|
|||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
|
|
||||||
# Documentation
|
# Documentation
|
||||||
|
%if %{with doc_pdf}
|
||||||
BuildRequires: make
|
BuildRequires: make
|
||||||
BuildRequires: python3dist(sphinx)
|
BuildRequires: python3dist(sphinx)
|
||||||
BuildRequires: python3dist(sphinx-rtd-theme)
|
BuildRequires: python3dist(sphinx-rtd-theme)
|
||||||
|
BuildRequires: python3-sphinx-latex
|
||||||
|
BuildRequires: latexmk
|
||||||
|
%endif
|
||||||
|
|
||||||
# Unbundling fonts:
|
# Unbundling fonts:
|
||||||
BuildRequires: font(redhatdisplay)
|
BuildRequires: font(redhatdisplay)
|
||||||
@ -136,8 +146,10 @@ find . -type f \( -name '*.woff' -o -name '*.woff2' \) -print -delete
|
|||||||
%build
|
%build
|
||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
|
|
||||||
%make_build -C docs
|
%if %{with doc_pdf}
|
||||||
rm -rvf docs/_build/.buildinfo docs/_build/.doctrees
|
sphinx-build -b latex docs %{_vpath_builddir}/_latex
|
||||||
|
%make_build -C %{_vpath_builddir}/_latex
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -149,7 +161,10 @@ install -t '%{buildroot}%{_pkgdocdir}' -D -m 0644 -p \
|
|||||||
CONTRIBUTING.md \
|
CONTRIBUTING.md \
|
||||||
docs/CODEOWNERS \
|
docs/CODEOWNERS \
|
||||||
README.md
|
README.md
|
||||||
cp -rp docs/_build '%{buildroot}%{_pkgdocdir}/html'
|
%if %{with doc_pdf}
|
||||||
|
install -t '%{buildroot}%{_pkgdocdir}' -p -m 0644 \
|
||||||
|
'%{_vpath_builddir}/_latex/gi-docgen.pdf'
|
||||||
|
%endif
|
||||||
cp -rp examples '%{buildroot}%{_pkgdocdir}/'
|
cp -rp examples '%{buildroot}%{_pkgdocdir}/'
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user