From 39e3deebb335cca7c3891eaefa0433714fa34709 Mon Sep 17 00:00:00 2001 From: tsteven4 <13596209+tsteven4@users.noreply.github.com> Date: Thu, 24 Nov 2022 11:18:55 -0700 Subject: [PATCH] add jing for fedora builds. (#942) * add jing for fedora builds. fedora f35 and on don't have a maintainer and thus the package isn't available. kludge in jing on f35. * improve document validation. * don't force jeng on f35 --- tools/Dockerfile_f32 | 2 +- tools/Dockerfile_f35 | 2 +- tools/make_gpsbabel_doc.sh | 13 +++++++++++++ tools/make_gpsbabel_html.sh | 5 +++-- tools/make_gpsbabel_org.sh | 12 ++++++------ tools/make_gpsbabel_pdf.sh | 5 +++-- 6 files changed, 27 insertions(+), 12 deletions(-) create mode 100755 tools/make_gpsbabel_doc.sh diff --git a/tools/Dockerfile_f32 b/tools/Dockerfile_f32 index 24e355661..87d96c4d8 100644 --- a/tools/Dockerfile_f32 +++ b/tools/Dockerfile_f32 @@ -16,7 +16,7 @@ RUN dnf install --assumeyes libusbx-devel zlib-devel shapelib-devel && \ RUN dnf install --assumeyes qt5-qtbase-devel qt5-qtserialport-devel qt5-qtwebengine-devel qt5-linguist qt5-qttranslations && \ dnf clean all # tools to build the docs -RUN dnf install --assumeyes expat desktop-file-utils libxslt docbook-style-xsl fop && \ +RUN dnf install --assumeyes expat desktop-file-utils libxslt docbook-style-xsl fop docbook5-style-xsl jing && \ dnf clean all # create a link as fedora uses the name qmake-qt5 for Qt5's qmake. RUN alternatives --install /usr/bin/qmake qt /usr/lib64/qt5/bin/qmake 100 diff --git a/tools/Dockerfile_f35 b/tools/Dockerfile_f35 index b89016683..1b0b05f58 100644 --- a/tools/Dockerfile_f35 +++ b/tools/Dockerfile_f35 @@ -16,7 +16,7 @@ RUN dnf install --assumeyes libusb1-devel zlib-devel shapelib-devel && \ RUN dnf install --assumeyes qt5-qtbase-devel qt5-qtserialport-devel qt5-qtwebengine-devel qt5-linguist qt5-qttranslations && \ dnf clean all # tools to build the docs -RUN dnf install --assumeyes expat desktop-file-utils libxslt docbook-style-xsl fop && \ +RUN dnf install --assumeyes expat desktop-file-utils libxslt docbook-style-xsl fop docbook5-style-xsl && \ dnf clean all # create a link as fedora uses the name qmake-qt5 for Qt5's qmake. RUN alternatives --install /usr/bin/qmake qt /usr/lib64/qt5/bin/qmake 100 diff --git a/tools/make_gpsbabel_doc.sh b/tools/make_gpsbabel_doc.sh new file mode 100755 index 000000000..d639b7eef --- /dev/null +++ b/tools/make_gpsbabel_doc.sh @@ -0,0 +1,13 @@ +#!/bin/sh +set -ex + +perl xmldoc/makedoc +xmllint --noout --relaxng http://www.oasis-open.org/docbook/xml/5.0/rng/docbook.rng xmldoc/readme.xml +# the following doesn't seem to work. +#xmllint --noout --schematron http://www.oasis-open.org/docbook/xml/5.0/sch/docbook.sch xmldoc/readme.xml +# jing and many depedencies removed from fedora +if command -v jing >/dev/null 2>&1; then + jing http://docs.oasis-open.org/docbook/xml/5.0/rng/docbook.rng xmldoc/readme.xml + # can seed a failure by removing version="5.0" from xmldoc/readme.xml + jing http://docs.oasis-open.org/docbook/xml/5.0/sch/docbook.sch xmldoc/readme.xml +fi diff --git a/tools/make_gpsbabel_html.sh b/tools/make_gpsbabel_html.sh index e0e9c802d..e8bd0f63e 100755 --- a/tools/make_gpsbabel_html.sh +++ b/tools/make_gpsbabel_html.sh @@ -1,8 +1,9 @@ #!/bin/sh set -ex -perl xmldoc/makedoc -jing http://docs.oasis-open.org/docbook/rng/5.0/docbook.rng xmldoc/readme.xml +tooldir=$(cd "$(dirname "$0")" && pwd) + +"$tooldir"/make_gpsbabel_doc.sh xsltproc \ --output gpsbabel.html \ --stringparam toc.section.depth "1" \ diff --git a/tools/make_gpsbabel_org.sh b/tools/make_gpsbabel_org.sh index 2474d7df1..0eb9d0f96 100755 --- a/tools/make_gpsbabel_org.sh +++ b/tools/make_gpsbabel_org.sh @@ -1,17 +1,17 @@ #!/bin/sh set -ex -web=$1 -docversion=$2 +web=${1:-gpsbabel.org} +docversion=${2:-x.y.z} +tooldir=$(cd "$(dirname "$0")" && pwd) mkdir -p "${web}/htmldoc-${docversion}" -perl xmldoc/makedoc -jing http://docs.oasis-open.org/docbook/rng/5.0/docbook.rng xmldoc/readme.xml +"$tooldir"/make_gpsbabel_doc.sh xsltproc \ --stringparam base.dir "${web}/htmldoc-${docversion}/" \ --stringparam root.filename "index" \ xmldoc/babelmain.xsl \ xmldoc/readme.xml -tools/fixdoc "${web}/htmldoc-${docversion}" "GPSBabel ${docversion}:" -tools/mkcapabilities "${web}" "${web}/htmldoc-${docversion}" +"${tooldir}"/fixdoc "${web}/htmldoc-${docversion}" "GPSBabel ${docversion}:" +"${tooldir}"/mkcapabilities "${web}" "${web}/htmldoc-${docversion}" cp gpsbabel.pdf "${web}/htmldoc-${docversion}/gpsbabel-${docversion}.pdf" diff --git a/tools/make_gpsbabel_pdf.sh b/tools/make_gpsbabel_pdf.sh index bdd57abc2..abe7a560b 100755 --- a/tools/make_gpsbabel_pdf.sh +++ b/tools/make_gpsbabel_pdf.sh @@ -1,7 +1,8 @@ #!/bin/sh set -ex -perl xmldoc/makedoc -jing http://docs.oasis-open.org/docbook/rng/5.0/docbook.rng xmldoc/readme.xml +tooldir=$(cd "$(dirname "$0")" && pwd) + +"$tooldir"/make_gpsbabel_doc.sh xsltproc -o gpsbabel.fo xmldoc/babelpdf.xsl xmldoc/readme.xml HOME=. fop -q -fo gpsbabel.fo -pdf gpsbabel.pdf