diff options
author | Ernst de Haan <znerd@FreeBSD.org> | 2004-01-12 13:40:00 +0000 |
---|---|---|
committer | Ernst de Haan <znerd@FreeBSD.org> | 2004-01-12 13:40:00 +0000 |
commit | f8d4392d0bce8acb544805be541efbd09cd5d051 (patch) | |
tree | 6c6331c8e5f0171181dcc2311d42d33d3bf1a592 /devel | |
parent | Add p5-File-RsyncP 0.44, perl Rsync client. (diff) |
Fixed 'ant' shell script. Previously the '-lib' option did not
work correctly.
Bumped PORTREVISION.
Notes
Notes:
svn path=/head/; revision=97992
Diffstat (limited to 'devel')
-rw-r--r-- | devel/apache-ant/Makefile | 2 | ||||
-rw-r--r-- | devel/apache-ant/files/ant | 69 | ||||
-rw-r--r-- | devel/apache-ant/files/ant.sh.in | 69 |
3 files changed, 27 insertions, 113 deletions
diff --git a/devel/apache-ant/Makefile b/devel/apache-ant/Makefile index 971369c32b92..28b33def81e6 100644 --- a/devel/apache-ant/Makefile +++ b/devel/apache-ant/Makefile @@ -7,7 +7,7 @@ PORTNAME= apache-ant PORTVERSION= 1.6.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel java MASTER_SITES= http://apache.mirror.trueserver.nl/dist/ant/binaries/:bin \ http://apache.proserve.nl/dist/ant/binaries/:bin \ diff --git a/devel/apache-ant/files/ant b/devel/apache-ant/files/ant index 2e3f332951bf..10d0a490a360 100644 --- a/devel/apache-ant/files/ant +++ b/devel/apache-ant/files/ant @@ -36,11 +36,6 @@ if [ -z "${usejikes}" ]; then usejikes=${DEFAULT_JIKES}; fi -# Determine the JDK home directory -if [ -z "${JAVA_HOME}" ]; then - JAVA_HOME=${DEFAULT_JAVA_HOME} -fi - # Set ANT_LIB location ANT_LIB="${ANT_HOME}/lib" @@ -52,11 +47,11 @@ if [ -z "${JAVACMD}" ]; then JAVACMD=${DEFAULT_JAVACMD} fi fi - + # Check if 'java' executable can be found -if [ ! -x "$JAVACMD" ]; then +if [ ! -x "${JAVACMD}" ]; then echo "Error: JAVA_HOME is not defined correctly: ${JAVA_HOME}" - echo " Unable to find ${JAVACMD}" + echo " Unable to execute ${JAVACMD}" exit 1 fi @@ -65,24 +60,13 @@ fi # Determine CLASSPATH #----------------------------------------------------------------------------- -# Initialize the classpath to the existing classpath -if [ -n "$CLASSPATH" ]; then - LOCALCLASSPATH="${CLASSPATH}" +# Prepend LOCALCLASSPATH variable with ant-launcher.jar +if [ -z "${LOCALCLASSPATH}" ]; then + LOCALCLASSPATH=${ANT_LIB}/ant-launcher.jar +else + LOCALCLASSPATH=${ANT_LIB}/ant-launcher.jar:${LOCALCLASSPATH} fi -# Add the dependency .jar files from ${ANT_HOME}/lib -for JAR_FILE in "${ANT_LIB}"/*.jar; do - - # If the directory is empty, then the input string is returned - if [ -f "${JAR_FILE}" ]; then - if [ -z "$LOCALCLASSPATH" ]; then - LOCALCLASSPATH="${JAR_FILE}" - else - LOCALCLASSPATH="${JAR_FILE}":"$LOCALCLASSPATH" - fi - fi -done - # FreeBSD-specific: Add the .jar files from ${PREFIX}/share/java/classes if [ "${ANT_INCLUDE_SHARED_JARS}" = "YES" ]; then for JAR_FILE in "%%PREFIX%%/share/java/classes"/*.jar; do @@ -98,20 +82,6 @@ if [ "${ANT_INCLUDE_SHARED_JARS}" = "YES" ]; then done fi -# Add the JDK tools.jar or classes.zip file to the CLASSPATH -if [ -n "${JAVA_HOME}" ]; then - if [ -f "${JAVA_HOME}/lib/tools.jar" ]; then - LOCALCLASSPATH="${LOCALCLASSPATH}:${JAVA_HOME}/lib/tools.jar" - elif [ -f "${JAVA_HOME}/lib/classes.zip" ]; then - LOCALCLASSPATH="${LOCALCLASSPATH}:${JAVA_HOME}/lib/classes.zip" - fi -else - echo "Warning: JAVA_HOME environment variable is not set." - echo " If build fails because sun.* classes could not be found" - echo " you will need to set the JAVA_HOME environment variable" - echo " to the installation directory of java." -fi - #----------------------------------------------------------------------------- # Determine all Ant options @@ -122,26 +92,13 @@ if ${usejikes}; then ANT_OPTS="${ANT_OPTS} -Dbuild.compiler=jikes" fi -# Add the Jikes path to the options if necessary -if [ -n "${JIKESPATH}" ]; then - ANT_OPTS="${ANT_OPTS} -Djikes.class.path=${JIKESPATH}" -fi - -# Add option for the CLASSPATH -ANT_OPTS="${ANT_OPTS} -classpath ${LOCALCLASSPATH}" - -# Add option for Ant home directory -ANT_OPTS="${ANT_OPTS} -Dant.home=${ANT_HOME}" - #----------------------------------------------------------------------------- -# Call Ant +# Execute Ant #----------------------------------------------------------------------------- -if [ -n "${VERBOSE_ANT_SCRIPT}" ]; then - echo "Java command: ${JAVACMD}" - echo "Ant options: ${ANT_OPTS}" - echo "Ant arguments: ${ANT_ARGS}" +if [ -n "${JIKESPATH}" ]; then + exec "${JAVACMD}" ${ANT_OPTS} -classpath "${LOCALCLASSPATH}" -Dant.home="${ANT_HOME}" -Djikes.class.path="${JIKESPATH}" org.apache.tools.ant.launch.Launcher ${ANT_ARGS} -lib "${CLASSPATH}" "$@" +else + exec "${JAVACMD}" ${ANT_OPTS} -classpath "${LOCALCLASSPATH}" -Dant.home="${ANT_HOME}" org.apache.tools.ant.launch.Launcher ${ANT_ARGS} -lib "${CLASSPATH}" "$@" fi - -${JAVACMD} ${ANT_OPTS} org.apache.tools.ant.Main ${ANT_ARGS} $@ diff --git a/devel/apache-ant/files/ant.sh.in b/devel/apache-ant/files/ant.sh.in index 2e3f332951bf..10d0a490a360 100644 --- a/devel/apache-ant/files/ant.sh.in +++ b/devel/apache-ant/files/ant.sh.in @@ -36,11 +36,6 @@ if [ -z "${usejikes}" ]; then usejikes=${DEFAULT_JIKES}; fi -# Determine the JDK home directory -if [ -z "${JAVA_HOME}" ]; then - JAVA_HOME=${DEFAULT_JAVA_HOME} -fi - # Set ANT_LIB location ANT_LIB="${ANT_HOME}/lib" @@ -52,11 +47,11 @@ if [ -z "${JAVACMD}" ]; then JAVACMD=${DEFAULT_JAVACMD} fi fi - + # Check if 'java' executable can be found -if [ ! -x "$JAVACMD" ]; then +if [ ! -x "${JAVACMD}" ]; then echo "Error: JAVA_HOME is not defined correctly: ${JAVA_HOME}" - echo " Unable to find ${JAVACMD}" + echo " Unable to execute ${JAVACMD}" exit 1 fi @@ -65,24 +60,13 @@ fi # Determine CLASSPATH #----------------------------------------------------------------------------- -# Initialize the classpath to the existing classpath -if [ -n "$CLASSPATH" ]; then - LOCALCLASSPATH="${CLASSPATH}" +# Prepend LOCALCLASSPATH variable with ant-launcher.jar +if [ -z "${LOCALCLASSPATH}" ]; then + LOCALCLASSPATH=${ANT_LIB}/ant-launcher.jar +else + LOCALCLASSPATH=${ANT_LIB}/ant-launcher.jar:${LOCALCLASSPATH} fi -# Add the dependency .jar files from ${ANT_HOME}/lib -for JAR_FILE in "${ANT_LIB}"/*.jar; do - - # If the directory is empty, then the input string is returned - if [ -f "${JAR_FILE}" ]; then - if [ -z "$LOCALCLASSPATH" ]; then - LOCALCLASSPATH="${JAR_FILE}" - else - LOCALCLASSPATH="${JAR_FILE}":"$LOCALCLASSPATH" - fi - fi -done - # FreeBSD-specific: Add the .jar files from ${PREFIX}/share/java/classes if [ "${ANT_INCLUDE_SHARED_JARS}" = "YES" ]; then for JAR_FILE in "%%PREFIX%%/share/java/classes"/*.jar; do @@ -98,20 +82,6 @@ if [ "${ANT_INCLUDE_SHARED_JARS}" = "YES" ]; then done fi -# Add the JDK tools.jar or classes.zip file to the CLASSPATH -if [ -n "${JAVA_HOME}" ]; then - if [ -f "${JAVA_HOME}/lib/tools.jar" ]; then - LOCALCLASSPATH="${LOCALCLASSPATH}:${JAVA_HOME}/lib/tools.jar" - elif [ -f "${JAVA_HOME}/lib/classes.zip" ]; then - LOCALCLASSPATH="${LOCALCLASSPATH}:${JAVA_HOME}/lib/classes.zip" - fi -else - echo "Warning: JAVA_HOME environment variable is not set." - echo " If build fails because sun.* classes could not be found" - echo " you will need to set the JAVA_HOME environment variable" - echo " to the installation directory of java." -fi - #----------------------------------------------------------------------------- # Determine all Ant options @@ -122,26 +92,13 @@ if ${usejikes}; then ANT_OPTS="${ANT_OPTS} -Dbuild.compiler=jikes" fi -# Add the Jikes path to the options if necessary -if [ -n "${JIKESPATH}" ]; then - ANT_OPTS="${ANT_OPTS} -Djikes.class.path=${JIKESPATH}" -fi - -# Add option for the CLASSPATH -ANT_OPTS="${ANT_OPTS} -classpath ${LOCALCLASSPATH}" - -# Add option for Ant home directory -ANT_OPTS="${ANT_OPTS} -Dant.home=${ANT_HOME}" - #----------------------------------------------------------------------------- -# Call Ant +# Execute Ant #----------------------------------------------------------------------------- -if [ -n "${VERBOSE_ANT_SCRIPT}" ]; then - echo "Java command: ${JAVACMD}" - echo "Ant options: ${ANT_OPTS}" - echo "Ant arguments: ${ANT_ARGS}" +if [ -n "${JIKESPATH}" ]; then + exec "${JAVACMD}" ${ANT_OPTS} -classpath "${LOCALCLASSPATH}" -Dant.home="${ANT_HOME}" -Djikes.class.path="${JIKESPATH}" org.apache.tools.ant.launch.Launcher ${ANT_ARGS} -lib "${CLASSPATH}" "$@" +else + exec "${JAVACMD}" ${ANT_OPTS} -classpath "${LOCALCLASSPATH}" -Dant.home="${ANT_HOME}" org.apache.tools.ant.launch.Launcher ${ANT_ARGS} -lib "${CLASSPATH}" "$@" fi - -${JAVACMD} ${ANT_OPTS} org.apache.tools.ant.Main ${ANT_ARGS} $@ |