#! /bin/sh # Forget portability - this is a script for maintainers only. # In fact, it's only known to run on RedHat Linux 7.1. # HTML files are included with the distribution, so it's not a big deal. # Adjustable parts. : ${DSL=/usr/share/sgml/docbook/utils-0.6/docbook-utils.dsl} : ${JADE=jade} : ${JADEFLAGS=-E 1} # Exit on errors. set -e # Big fat warning in case we need it. WARNING=' Could not generate GMC documentation. Due to installations of DocBook being very different across platforms and distributions, this "mkhtml" script has been designed to run on RedHat Linux 7.1 only. You may want to adapt it to your system if you have DocBook 4.1 installed. Please DO NOT make official releases of GNU Midnight Commander on the systems where the GMC documentation fails to be generated. ' # What to remove in case of failure CLEANFILES="*.html" rm -f $CLEANFILES # Trap if something goes wrong for signal in 0 1 2 13 15; do trap 'status=$? set +e trap 0 test $status = 0 || { echo "$WARNING"; rm -f $CLEANFILES; } exit $status' $signal done # Make sure $DSL exists. TODO: search in all known locations here. test -f "$DSL" || { echo "$DSL not found"; exit 1; } $JADE $JADEFLAGS -t sgml -i html -d "$DSL#html" gmc.sgml