From 8cd045c924a0e3715f0bbffe81ef94b3b107efa4 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Thu, 16 Dec 2021 09:37:39 -0500 Subject: [PATCH] Build PDF instead of HTML documentation --- freexl.spec | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/freexl.spec b/freexl.spec index 6861745..64d6751 100644 --- a/freexl.spec +++ b/freexl.spec @@ -1,3 +1,10 @@ +# Doxygen HTML help is not suitable for packaging due to a minified JavaScript +# bundle inserted by Doxygen itself. See discussion at +# https://bugzilla.redhat.com/show_bug.cgi?id=2006555. +# +# We can enable the Doxygen PDF documentation as a substitute. +%bcond_without doc_pdf + %bcond_without autoreconf Name: freexl @@ -34,7 +41,10 @@ Summary: Documentation and examples for FreeXL BuildArch: noarch +%if %{with doc_pdf} BuildRequires: doxygen +BuildRequires: doxygen-latex +%endif %description doc %{summary}. @@ -60,6 +70,19 @@ cp -rp examples clean/ # them. rm -vf clean/examples/Makefile.* +%if %{with doc_pdf} +# We enable the Doxygen PDF documentation as a substitute. We must enable +# GENERATE_LATEX and LATEX_BATCHMODE; the rest are precautionary and should +# already be set as we like them. We also disable GENERATE_HTML, since we will +# not use it. +sed -r -i \ + -e "s/^([[:blank:]]*(GENERATE_LATEX|LATEX_BATCHMODE|USE_PDFLATEX|\ +PDF_HYPERLINKS)[[:blank:]]*=[[:blank:]]*)NO[[:blank:]]*/\1YES/" \ + -e "s/^([[:blank:]]*(LATEX_TIMESTAMP|GENERATE_HTML)\ +[[:blank:]]*=[[:blank:]]*)YES[[:blank:]]*/\1NO/" \ + Doxyfile.in +%endif + %build %if %{with autoreconf} @@ -68,8 +91,11 @@ autoreconf --force --install --verbose %configure --disable-static %make_build -# Generate HTML documentation -doxygen +%if %{with doc_pdf} +doxygen Doxyfile +%make_build -C latex +mv latex/refman.pdf latex/FreeXL.pdf +%endif %check @@ -102,7 +128,9 @@ find '%{buildroot}' -type f -name '*.la' -print -delete %doc README %doc clean/examples -%doc html +%if %{with doc_pdf} +%doc latex/FreeXL.pdf +%endif %changelog @@ -112,6 +140,7 @@ find '%{buildroot}' -type f -name '*.la' -print -delete - Properly install the license file - Remove an obsolete sed-patch - Move documentation and examples to a -doc subpackage +- Build PDF instead of HTML documentation * Wed Jul 21 2021 Fedora Release Engineering - 1.0.6-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild