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.
This commit is contained in:
Benjamin A. Beasley 2021-10-01 18:10:33 -04:00
parent c9553e91eb
commit 03307554f4

View File

@ -11,6 +11,10 @@
# https://bugzilla.redhat.com/show_bug.cgi?id=2006555. # https://bugzilla.redhat.com/show_bug.cgi?id=2006555.
# #
# We can enable the Doxygen PDF documentation as a lesser substitute. # 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 %bcond_without doc_pdf
Name: cairomm%{apiver} Name: cairomm%{apiver}
@ -117,7 +121,9 @@ rm -rf "${workdir}"
# sources are banned in Fedora. (Note also that the bundled JavaScript had a # 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 # 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 # 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 -rf untracked/docs/reference/html
rm untracked/docs/reference/cairomm-%{apiver}.tag \ rm untracked/docs/reference/cairomm-%{apiver}.tag \
untracked/docs/reference/cairomm-%{apiver}.devhelp2 untracked/docs/reference/cairomm-%{apiver}.devhelp2
@ -156,7 +162,10 @@ install -t %{buildroot}%{_docdir}/cairomm-%{apiver} -m 0644 -p \
AUTHORS ChangeLog MAINTAINERS NEWS README AUTHORS ChangeLog MAINTAINERS NEWS README
cp -rp examples %{buildroot}%{_docdir}/cairomm-%{apiver}/ 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} %if %{with doc_pdf}
install '%{_vpath_builddir}/docs/reference/latex/refman.pdf' -p -m 0644 \ install '%{_vpath_builddir}/docs/reference/latex/refman.pdf' -p -m 0644 \
'%{buildroot}%{_docdir}/cairomm-%{apiver}/reference/cairomm-%{apiver}.pdf' '%{buildroot}%{_docdir}/cairomm-%{apiver}/reference/cairomm-%{apiver}.pdf'
@ -183,7 +192,8 @@ install '%{_vpath_builddir}/docs/reference/latex/refman.pdf' -p -m 0644 \
%files doc %files doc
%license COPYING %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 %{_docdir}/cairomm-%{apiver}
%doc %{_datadir}/devhelp/ %doc %{_datadir}/devhelp/