aboutsummaryrefslogtreecommitdiff
path: root/devel/apache-ant/files
diff options
context:
space:
mode:
authorErnst de Haan <znerd@FreeBSD.org>2002-10-11 15:12:57 +0000
committerErnst de Haan <znerd@FreeBSD.org>2002-10-11 15:12:57 +0000
commitd6f3daa08db9d57a69b0a5d35b157386a87ef07c (patch)
tree55c82b894a18a29e478936c14cc19490b4aeadc0 /devel/apache-ant/files
parent4d15848cd8c27dbee8b7f5f6b9f9a742eba3e78a (diff)
downloadports-d6f3daa08db9d57a69b0a5d35b157386a87ef07c.tar.gz
ports-d6f3daa08db9d57a69b0a5d35b157386a87ef07c.zip
Notes
Diffstat (limited to 'devel/apache-ant/files')
-rw-r--r--devel/apache-ant/files/ant142
-rw-r--r--devel/apache-ant/files/ant.sh.in142
-rw-r--r--devel/apache-ant/files/patch-bin::ant32
3 files changed, 284 insertions, 32 deletions
diff --git a/devel/apache-ant/files/ant b/devel/apache-ant/files/ant
new file mode 100644
index 000000000000..4927ef8832a4
--- /dev/null
+++ b/devel/apache-ant/files/ant
@@ -0,0 +1,142 @@
+#!/bin/sh
+#
+# FreeBSD-specific startup script for Jakarta Ant.
+#
+# See: http://jakarta.apache.org/ant/
+#
+# $FreeBSD$
+#
+
+
+DEFAULT_JAVACMD=%%JAVA%%
+DEFAULT_JAVA_HOME=%%JAVA_HOME%%
+DEFAULT_JIKES=false
+ANT_HOME=%%ANT_HOME%%
+
+
+#-----------------------------------------------------------------------------
+# Determine configuration settings
+#-----------------------------------------------------------------------------
+
+# Load system-wide configuration
+if [ -f "%%PREFIX%%/etc/ant.conf" ]; then
+ . %%PREFIX%%/etc/ant.conf
+fi
+
+# Load user-specific configuration
+if [ -f "${HOME}/.antrc" ]; then
+ . "${HOME}/.antrc"
+fi
+
+# Determine if Jikes should be used
+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"
+
+# Determine 'java' executable
+if [ -z "${JAVACMD}" ]; then
+ if [ -n "${JAVA_HOME}" ]; then
+ JAVACMD="${JAVA_HOME}/bin/java"
+ else
+ JAVACMD=${DEFAULT_JAVACMD}
+ fi
+fi
+
+# Check if 'java' executable can be found
+if [ ! -x "$JAVACMD" ]; then
+ echo "Error: JAVA_HOME is not defined correctly: ${JAVA_HOME}"
+ echo " Unable to find ${JAVACMD}"
+ exit 1
+fi
+
+
+#-----------------------------------------------------------------------------
+# Determine CLASSPATH
+#-----------------------------------------------------------------------------
+
+# Initialize the classpath to the existing classpath
+if [ -n "$CLASSPATH" ]; then
+ LOCALCLASSPATH="${CLASSPATH}"
+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
+for JAR_FILE in "%%PREFIX%%/share/java/classes"/*.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
+
+# 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
+#-----------------------------------------------------------------------------
+
+# Add Jikes flag if appropriate
+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
+#-----------------------------------------------------------------------------
+
+if [ -n "${VERBOSE_ANT_SCRIPT}" ]; then
+ echo "Java command: ${JAVACMD}"
+ echo "Ant options: ${ANT_OPTS}"
+ echo "Ant arguments: ${ANT_ARGS}"
+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
new file mode 100644
index 000000000000..4927ef8832a4
--- /dev/null
+++ b/devel/apache-ant/files/ant.sh.in
@@ -0,0 +1,142 @@
+#!/bin/sh
+#
+# FreeBSD-specific startup script for Jakarta Ant.
+#
+# See: http://jakarta.apache.org/ant/
+#
+# $FreeBSD$
+#
+
+
+DEFAULT_JAVACMD=%%JAVA%%
+DEFAULT_JAVA_HOME=%%JAVA_HOME%%
+DEFAULT_JIKES=false
+ANT_HOME=%%ANT_HOME%%
+
+
+#-----------------------------------------------------------------------------
+# Determine configuration settings
+#-----------------------------------------------------------------------------
+
+# Load system-wide configuration
+if [ -f "%%PREFIX%%/etc/ant.conf" ]; then
+ . %%PREFIX%%/etc/ant.conf
+fi
+
+# Load user-specific configuration
+if [ -f "${HOME}/.antrc" ]; then
+ . "${HOME}/.antrc"
+fi
+
+# Determine if Jikes should be used
+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"
+
+# Determine 'java' executable
+if [ -z "${JAVACMD}" ]; then
+ if [ -n "${JAVA_HOME}" ]; then
+ JAVACMD="${JAVA_HOME}/bin/java"
+ else
+ JAVACMD=${DEFAULT_JAVACMD}
+ fi
+fi
+
+# Check if 'java' executable can be found
+if [ ! -x "$JAVACMD" ]; then
+ echo "Error: JAVA_HOME is not defined correctly: ${JAVA_HOME}"
+ echo " Unable to find ${JAVACMD}"
+ exit 1
+fi
+
+
+#-----------------------------------------------------------------------------
+# Determine CLASSPATH
+#-----------------------------------------------------------------------------
+
+# Initialize the classpath to the existing classpath
+if [ -n "$CLASSPATH" ]; then
+ LOCALCLASSPATH="${CLASSPATH}"
+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
+for JAR_FILE in "%%PREFIX%%/share/java/classes"/*.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
+
+# 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
+#-----------------------------------------------------------------------------
+
+# Add Jikes flag if appropriate
+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
+#-----------------------------------------------------------------------------
+
+if [ -n "${VERBOSE_ANT_SCRIPT}" ]; then
+ echo "Java command: ${JAVACMD}"
+ echo "Ant options: ${ANT_OPTS}"
+ echo "Ant arguments: ${ANT_ARGS}"
+fi
+
+${JAVACMD} ${ANT_OPTS} org.apache.tools.ant.Main ${ANT_ARGS} $@
diff --git a/devel/apache-ant/files/patch-bin::ant b/devel/apache-ant/files/patch-bin::ant
deleted file mode 100644
index 17e24e18806f..000000000000
--- a/devel/apache-ant/files/patch-bin::ant
+++ /dev/null
@@ -1,32 +0,0 @@
---- bin/ant.orig Tue May 21 17:57:59 2002
-+++ bin/ant Tue May 21 17:58:50 2002
-@@ -3,6 +3,9 @@
- # Copyright (c) 2001-2002 The Apache Software Foundation. All rights
- # reserved.
-
-+DEFAULT_JAVACMD=%%JAVA%%
-+DEFAULT_JAVA_HOME=%%JAVA_HOME%%
-+
- # load system-wide ant configuration
- if [ -f "/etc/ant.conf" ] ; then
- . /etc/ant.conf
-@@ -21,6 +24,10 @@
- . $HOME/.antrc
- fi
-
-+if [ -z "$JAVA_HOME" ] ; then
-+ JAVA_HOME=$DEFAULT_JAVA_HOME
-+fi
-+
- # OS specific support. $var _must_ be set to either true or false.
- cygwin=false;
- darwin=false;
-@@ -88,7 +95,7 @@
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- else
-- JAVACMD=java
-+ JAVACMD=$DEFAULT_JAVACMD
- fi
- fi
-