# Script to check for catalogs, stylesheets, XSL processors and all
# the other stuff necessary to convert the XML documentation.
_xsltwrapper="xsltproc.sh"
_xmllintwrapper="xmllint.sh"
for _try_catalog in /etc/sgml/catalog /usr/share/sgml/docbook/xml-dtd-4.1.2/xmlcatalog /usr/share/apps/ksgmltools2/customization/en/catalog /usr/share/sgml/catalog /usr/local/share/sgml/catalog /usr/lib/sgml/catalog /usr/local/lib/sgml/catalog
for _try_chunk_xsl in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl /usr/share/sgml/docbook/yelp/docbook/html/chunk.xsl /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl /usr/local/share/sgml/docbook/yelp/docbook/html/chunk.xsl
# This must not trigger on something like saxon-fop-6.4.4.jar.
for _try_saxon_jar in /usr/share/java/saxon.jar /usr/local/share/java/saxon.jar /usr/share/java/saxon-[0-9]*.jar /usr/local/share/java/saxon-[0-9]*.jar
do
if test -f "$_try_saxon_jar"
then
_saxon_jar=$_try_saxon_jar
#Don't break to find the _latest_ saxon.jar.
fi
done
if test -n "$_saxon_jar"
then
if test -n "$_chunk_xsl"
then
_xsltcommand="cd \$1 && if test \"\`dirname \$2 | head -c 1\`\" = \".\" ; then $_java -classpath $_saxon_jar com.icl.saxon.StyleSheet \$_IN_DIR/\$3 \$_IN_DIR/\$2 ; else $_java -classpath $_saxon_jar com.icl.saxon.StyleSheet \$_IN_DIR/\$3 \$2 ;fi"
echo "Found the Saxon XSLT Processor ($_saxon_jar), using Java VM '$_java'."
else
echo "Found the Saxon XSLT processor but no stylesheets on your system."
echo "Saxon is unusable without stylesheets."
fi
fi
fi
fi
if test -z "$_xsltcommand"
then
# Java not found.
# now try openjade/jade.
for _try_jade in jade openjade
do
if command -v $_try_jade > /dev/null
then
_jade=$_try_jade
break
fi
done
if test -n "$_jade"
then
echo "xsltproc and Saxon XSLT processors not found."
echo "I will try to use OpenJade or Jade (using '$_jade')."
for _try_docbook_dsl in /usr/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl /usr/local/share/sgml/docbook/stylesheet/dsssl/modular/html/docbook.dsl
do
if test -f "$_try_docbook_dsl"
then
_docbook_dsl=$_try_docbook_dsl
break
fi
done
for _try_xml_dcl in /usr/share/sgml/declaration/xml.dcl /usr/local/share/sgml/declaration/xml.dcl
do
if test -f "$_try_xml_dcl"
then
_xml_dcl=$_try_xml_dcl
break
fi
done
if test "x$_docbook_dsl" = "x" -o "x$_xml_dcl" = "x"
then
echo "One of the files docbook.dsl and xml.dcl or both of them weren't found."