Blame SOURCES/db2html

d48bc3
#! /bin/sh
d48bc3
d48bc3
ADMON_GRAPHICS=/usr/share/sgml/docbook/dsssl-stylesheets/images/*.gif
d48bc3
d48bc3
output=docbook2html-dir
d48bc3
skip=0
d48bc3
dbdircleanup=1
d48bc3
outputdone=0
d48bc3
for arg in "$@"
d48bc3
do
d48bc3
  if [ $skip -gt 0 ]
d48bc3
  then
d48bc3
    skip=$(($skip - 1))
d48bc3
    continue
d48bc3
  fi
d48bc3
  case $arg in
d48bc3
  -h|--help|-v|--version)	break
d48bc3
				;;
d48bc3
  -n|--nostd|-u|--nochunks)	;;
d48bc3
  -o|--output)   outputdone=1
d48bc3
	         ;;
d48bc3
d48bc3
  -*)				skip=1
d48bc3
				;;
d48bc3
  *)    dbdircleanup=0
d48bc3
        if [ ${outputdone} -eq 1 ];
d48bc3
        then
d48bc3
          output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
d48bc3
          outputfile="$basename "$output""
d48bc3
          outputdone=2
d48bc3
        elif [ ${outputdone} -eq 2 ];
d48bc3
        then
d48bc3
          outputfile="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,' | \
d48bc3
                      rev | cut -d'/' -f1 | rev)"
d48bc3
        else
d48bc3
          output="$(echo $arg | sed 's,\.sgml$,,;s,\.sgm$,,;s,\.xml,,')"
d48bc3
          outputfile=$(basename "$output")
d48bc3
        fi
d48bc3
	;;
d48bc3
  esac
d48bc3
done
d48bc3
d48bc3
if [ ${dbdircleanup} -eq 0 ];
d48bc3
then
d48bc3
  echo "Output is $output/$outputfile.html"
d48bc3
fi
d48bc3
if [ -d ${output} ]
d48bc3
then
d48bc3
  rm -rf ${output}.junk
d48bc3
  mv ${output} ${output}.junk
d48bc3
fi
d48bc3
mkdir ${output}
d48bc3
mkdir ${output}/stylesheet-images
d48bc3
cp ${ADMON_GRAPHICS} ${output}/stylesheet-images
d48bc3
jw -f docbook -b html -o ${output} "$@"
d48bc3
if [ ${dbdircleanup} -eq 1 ];
d48bc3
then
d48bc3
  rm -rf ${output}
d48bc3
fi