#! /bin/sh # # Shell script to run FOP, adapted from the Jakarta-Ant project. if [ -f $HOME/.foprc ] ; then . $HOME/.foprc fi FOP_HOME=/usr/share/fop if [ -z "$JAVACMD" ] ; then if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables JAVACMD=$JAVA_HOME/jre/sh/java else JAVACMD=$JAVA_HOME/bin/java fi else JAVACMD=java fi fi if [ ! -x "$JAVACMD" ] ; then echo "Error: JAVA_HOME is not defined correctly." echo " We cannot execute $JAVACMD" exit fi if [ -n "$CLASSPATH" ] ; then LOCALCLASSPATH=$CLASSPATH fi # add fop.jar, which resides in $FOP_HOME/build LOCALCLASSPATH=${FOP_HOME}/lib/fop.jar:$LOCALCLASSPATH # add in the dependency .jar files, which reside in $FOP_HOME/lib DIRLIBS=${FOP_HOME}/lib/*.jar for i in ${DIRLIBS} do # if the directory is empty, then it will return the input string # this is stupid, so case for it if [ "$i" != "${DIRLIBS}" ] ; then if [ -z "$LOCALCLASSPATH" ] ; then LOCALCLASSPATH=$i else LOCALCLASSPATH="$i":$LOCALCLASSPATH fi fi done $JAVACMD -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.fop.apps.Fop "$@"