From 0b72d19b504c40029ff2587bf6c3f8ccb7348ffd Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Fri, 1 Oct 2021 16:30:04 -0400 Subject: [PATCH] Re-enable Doxygen HTML, stripping JS, for devhelp The devhelp is still usable even with the JavaScript stripped. See https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion of the issues around the JavaScript produced by Doxygen. --- cairomm.spec | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cairomm.spec b/cairomm.spec index 6a329f3..6917d9e 100644 --- a/cairomm.spec +++ b/cairomm.spec @@ -11,6 +11,10 @@ # https://bugzilla.redhat.com/show_bug.cgi?id=2006555. # # We can enable the Doxygen PDF documentation as a lesser substitute. +# +# We still generate the HTML documentation, but strip out all the JavaScript +# that causes policy issues. This degrades it in the browser, but is sufficient +# to keep the Devhelp documentation working. %bcond_without doc_pdf Name: cairomm @@ -129,7 +133,9 @@ rm -rf "${workdir}" # sources are banned in Fedora. (Note also that the bundled JavaScript had a # different license.) We also remove the tag file, which triggers a rebuild of # the documentation. While we are at it, we might as well rebuild the devhelp -# XML too. Note that we will not install the HTML documentation. +# XML too. Note that we will still install the HTML documentation, since the +# devhelp XML requires it, but we will strip out the JavaScript, which will +# degrade the documentation in a web browser. rm -rf untracked/docs/reference/html rm untracked/docs/reference/cairomm-%{apiver}.tag \ untracked/docs/reference/cairomm-%{apiver}.devhelp2 @@ -168,7 +174,10 @@ install -t %{buildroot}%{_docdir}/cairomm-%{apiver} -m 0644 -p \ AUTHORS ChangeLog MAINTAINERS NEWS README cp -rp examples %{buildroot}%{_docdir}/cairomm-%{apiver}/ -rm -vrf '%{buildroot}%{_docdir}/cairomm-%{apiver}/reference/html' +# Strip out bundled and/or pre-minified JavaScript; this degrades the browser +# experience, but the HTML is still usable for devhelp. +find '%{buildroot}%{_docdir}/cairomm-%{apiver}/reference/html' \ + -type f \( -name '*.js' -o -name '*.js.*' \) -print -delete %if %{with doc_pdf} install '%{_vpath_builddir}/docs/reference/latex/refman.pdf' -p -m 0644 \ '%{buildroot}%{_docdir}/cairomm-%{apiver}/reference/cairomm-%{apiver}.pdf' @@ -195,7 +204,8 @@ install '%{_vpath_builddir}/docs/reference/latex/refman.pdf' -p -m 0644 \ %files doc %license COPYING -# Note: HTML reference manual has been removed. See comment in %%install. +# Note: JavaScript has been removed from HTML reference manual, degrading the +# browser experience. It is still needed for Devhelp support. %doc %{_docdir}/cairomm-%{apiver} %doc %{_datadir}/devhelp/