Blame SOURCES/db2html

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