#! /bin/sh

# Shell script wrapper around the fop program,
# Copyright 2008 by Vincent Fourmond <fourmond@debian.org>
#
# Licensed under the same terms as fop itself, that is under
# the conditions of the Apache 2 licencee.

# Include the wrappers utility script
. /usr/lib/java-wrappers/java-wrappers.sh


# We prefer to use openjdk or Sun's java if available
find_java_runtime openjdk sun  || find_java_runtime 

find_jars commons-io avalon-framework serializer xalan2 xml-apis 
find_jars batik-all commons-logging servlet-api xercesImpl xmlgraphics-commons
find_jars xml-apis-ext 

# We load the hyphenation jar at the request of the user.
if [ "$FOP_HYPHENATION_PATH" ]; then
    find_jars $FOP_HYPHENATION_PATH
fi
find_jars fop


# comment this line if you want fop to run without headless property
HEADLESS=-Djava.awt.headless=true

run_java $HEADLESS org.apache.fop.cli.Main "$@"
