#!/bin/sh
#

usage="\
Usage: gtkdoc-mkpdf MODULE DRIVER_FILE"

if test "x$1" = "x--version"; then
      echo "0.6"
      exit 0
fi

if test $# -ne 2; then
      echo "${usage}" 1>&2
      exit 1
fi

module=$1

prefix=/gnome/head/INSTALL
gtkdocdir=${prefix}/share/gtk-doc/

# Delete the old index.sgml file, if it exists.
if test -f index.sgml; then
      rm -f index.sgml
fi

jade -t tex -w no-idref -d $gtkdocdir/gtk-doc.dsl $2
jade -t tex -w no-idref -d /usr/lib/sgml/stylesheet/dsssl/docbook/cygnus/cygnus-both.dsl ../diacanvas2-docs.sgml

#sed s%href=\"%href=\"$module/% < index.sgml > index.sgml.tmp && mv index.sgml.tmp index.sgml
pdfjadetex `basename $2 | sed 's/\.sgml$/.tex/'`
echo "timestamp" > ../pdf.stamp
