3 ## Customized version of db2html to make it easier to use alternate
4 ## stylesheets. Some versions of db2html support a '-d' option to
5 ## specify this, but not all. We'll explicitly specify that here.
7 ## John R. Sheets <jsheets@codeweavers.com>
9 ## The DocBook installations behave differently for the various Linux
10 ## distributions. Try to make some sense out of it all....
12 ## $LINUXDIST holds the name of the distribution
13 ## $JADETAG adds "/#html" to the stylesheet-specification in the Jade
14 ## command line (see comments below), if necessary for that dist.
20 if [ -f /etc/debian_version ]; then
26 if [ -f /etc/redhat-release ]; then
32 if [ -f /usr/bin/crux ]; then
38 ## FIXME: Add more distributions here...
40 if [ -n "$LINUXDIST" ]; then
41 echo "Using db2html parameters for a $LINUXDIST Linux distribution..."
44 ## Use included default.dsl DSSSL stylesheet unless explicitly overridden with
45 ## the $WINEDOC_STYLESHEET envar.
47 ## NOTE: The invoked DSSSL stylesheet *MUST* have an HTML-specific section
48 ## in it; otherwise, jade will spew everything to stdout and fail to use
49 ## the stated stylesheet. Something like this:
51 ## <style-specification id="html" use="docbook">
52 if [ -z "$WINEDOC_STYLESHEET" ]; then
53 DB_STYLESHEET=../default.dsl
55 DB_STYLESHEET=$WINEDOC_STYLESHEET
59 TMPDIR=DBTOHTML_OUTPUT_DIR$$
61 echo TMPDIR is $TMPDIR
63 echo "Using stylesheet: \"${DB_STYLESHEET}\""
67 echo "Usage: `basename $0` [filename.sgml]" >&2
75 echo Cannot read \"$1\". Exiting. >&2
78 if echo $1 | egrep -i '\.sgml$|\.sgm$' >/dev/null 2>&1
80 # now make sure that the output directory is always a subdirectory
81 # of the current directory
82 input_file=`basename $1`
83 output="`echo $input_file | sed 's,\.sgml$,,;s,\.sgm$,,'`"
84 echo "input file was called $input_file -- output will be in $output"
91 if [ $1 = `basename $1` ]; then
97 JADE_CMD="$JADEPROG -t sgml -ihtml -d ${DB_STYLESHEET}${JADETAG} ${EXTRA_PATH}$1"
98 echo "Invoking command '$JADE_CMD'"
101 echo "working on ${EXTRA_PATH}$1"
102 (cd $TMPDIR; $JADE_CMD; cd $SAVE_PWD)
106 if [ -d "${output}.junk" ]
108 /bin/rm -rf "${output}.junk"
110 if [ -d "${output}" ]
112 mv "$output" "${output}.junk"
114 echo "about to rename temporary directory to $output"
115 mv "${TMPDIR}" "$output"