--- fop.sh.orig 2005-03-02 17:50:48.356252608 +0100 +++ fop.sh 2005-03-02 17:59:21.169293176 +0100 @@ -1,4 +1,5 @@ #! /bin/sh +test "$FOP_HOME" || FOP_HOME=/usr/share/fop/ # # Shell script to run FOP, adapted from the Jakarta-Ant project. @@ -6,14 +7,6 @@ . $HOME/.foprc fi -# OS specific support. $var _must_ be set to either true or false. -cygwin=false; -darwin=false; -case "`uname`" in - CYGWIN*) cygwin=true ;; - Darwin*) darwin=true ;; -esac - if [ -z "$FOP_HOME" ] ; then # try to find FOP if [ -d /opt/fop ] ; then @@ -42,63 +35,7 @@ fi -# For Cygwin, ensure paths are in UNIX format before anything is touched -if $cygwin ; then - [ -n "$FOP_HOME" ] && - FOP_HOME=`cygpath --unix "$FOP_HOME"` - [ -n "$JAVA_HOME" ] && - JAVA_HOME=`cygpath --unix "$JAVA_HOME"` - [ -n "$CLASSPATH" ] && - CLASSPATH=`cygpath --path --unix "$CLASSPATH"` -fi - -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}/build/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 - -# For Cygwin, switch paths to Windows format before running java -if $cygwin; then - FOP_HOME=`cygpath --path --windows "$FOP_HOME"` - JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` - LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"` -fi - -$JAVACMD -classpath "$LOCALCLASSPATH" $FOP_OPTS org.apache.fop.apps.Fop "$@" +cp=${CLASSPATH}:`java-config -p avalon-framework-4.1,batik-1.5,fop,xalan,xerces-2` +`java-config -J` -classpath ${cp} ${FOP_OPTS} org.apache.fop.apps.Fop "${@}"