diff options
author | Herve Quiroz <hq@FreeBSD.org> | 2005-10-10 14:38:42 +0000 |
---|---|---|
committer | Herve Quiroz <hq@FreeBSD.org> | 2005-10-10 14:38:42 +0000 |
commit | 4f0d16a7d3f80741a3e093c7e3bd181152131ac5 (patch) | |
tree | 823f833ccc86e0221b1063486e233e8d1d025d07 /devel | |
parent | 09f28108b16a8baac7fc732e72193deaee6d29c0 (diff) | |
download | ports-4f0d16a7d3f80741a3e093c7e3bd181152131ac5.tar.gz ports-4f0d16a7d3f80741a3e093c7e3bd181152131ac5.zip |
Notes
Diffstat (limited to 'devel')
-rw-r--r-- | devel/apache-ant/Makefile | 53 | ||||
-rw-r--r-- | devel/apache-ant/files/ant | 102 | ||||
-rw-r--r-- | devel/apache-ant/files/ant.sh.in | 54 |
3 files changed, 35 insertions, 174 deletions
diff --git a/devel/apache-ant/Makefile b/devel/apache-ant/Makefile index cb637333886a..c6a580d79057 100644 --- a/devel/apache-ant/Makefile +++ b/devel/apache-ant/Makefile @@ -7,6 +7,7 @@ PORTNAME= apache-ant PORTVERSION= 1.6.5 +PORTREVISION= 1 CATEGORIES= devel java MASTER_SITES= ${MASTER_SITE_APACHE:S,%SUBDIR%/,ant/binaries/:bin,} \ http://www.esil.univ-mrs.fr/~hquiroz/:man @@ -42,56 +43,38 @@ MANPAGE_WRKSRC= ${WRKSRC}/${MANPAGE_SUBDIR} MAN1= ant.1 MAN5= build.xml.5 -do-patch: - @${CP} ${FILESDIR}/ant ${WRKSRC}/bin/ant - -post-patch: - @${ECHO_CMD} -n ">> Customizing ant shell script..." - @${SED} \ - -e "/%%ANT_HOME%%/s//${PORTDESTDIR:S/\//\\\//g}/g" \ - -e "/%%JAVA%%/s//${JAVA:S/\//\\\//g}/g" \ - -e "/%%JAVA_HOME%%/s//${JAVA_HOME:S/\//\\\//g}/g" \ - -e "/%%PREFIX%%/s//${PREFIX:S/\//\\\//g}/g" \ - ${WRKSRC}/bin/ant > ${WRKDIR}/ant - @${MV} ${WRKDIR}/ant ${WRKSRC}/bin/ant - @${ECHO_CMD} " [ DONE ]" - - @${ECHO_CMD} -n ">> Removing unneeded files..." - @${RM} -f ${WRKSRC}/lib/parser.jar - @${ECHO_CMD} " [ DONE ]" +SUB_FILES= ant.sh +SUB_LIST= ANT_HOME=${PORTDESTDIR} post-extract: @${TAR} -C ${WRKSRC} -xzf ${DISTDIR}/${MANPAGE_DISTFILE} do-install: - @${ECHO_CMD} -n ">> Creating destination directory..." + @${ECHO_MSG} -n ">> Creating destination directory..." @${MKDIR} ${PORTDESTDIR}/bin - @${MKDIR} ${PORTDESTDIR}/lib - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" - @${ECHO_CMD} -n ">> Installing scripts..." - @cd ${INSTALL_WRKSRC}; \ - ${INSTALL_SCRIPT} ${WRKSRC}/bin/ant ${PREFIX}/bin; \ - ${INSTALL_SCRIPT} ${WRKSRC}/bin/antRun ${PORTDESTDIR}/bin; - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} -n ">> Installing scripts..." + @${INSTALL_SCRIPT} ${WRKDIR}/ant.sh ${PREFIX}/bin/ant + @${INSTALL_SCRIPT} ${WRKSRC}/bin/antRun ${PORTDESTDIR}/bin/ + @${ECHO_MSG} " [ DONE ]" - @${ECHO_CMD} -n ">> Installing readme files..." - @cd ${INSTALL_WRKSRC}; \ - ${INSTALL_DATA} ${READMES} ${PORTDESTDIR}; - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} -n ">> Installing readme files..." + @${INSTALL_DATA} ${READMES:S|^|${WRKSRC}/|} ${PORTDESTDIR} + @${ECHO_MSG} " [ DONE ]" - @${ECHO_CMD} -n ">> Installing manpages..." - @${INSTALL_MAN} ${MANPAGE_WRKSRC}/ant.1 ${PREFIX}/man/man1 - @${INSTALL_MAN} ${MANPAGE_WRKSRC}/build.xml.5 ${PREFIX}/man/man5 - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} -n ">> Installing manpages..." + @${INSTALL_MAN} ${MANPAGE_WRKSRC}/ant.1 ${MAN1PREFIX}/man/man1 + @${INSTALL_MAN} ${MANPAGE_WRKSRC}/build.xml.5 ${MAN5PREFIX}/man/man5 + @${ECHO_MSG} " [ DONE ]" .if defined(DATADIRS) .for DIR in ${DATADIRS} - @${ECHO_CMD} -n ">> Installing data directory '${DIR}'..." + @${ECHO_MSG} -n ">> Installing data directory '${DIR}'..." @cd ${INSTALL_WRKSRC}; \ ${FIND} ${DIR} -type d -exec ${MKDIR} ${PORTDESTDIR}/\{} \; ;\ ${FIND} ${DIR} -type f -exec ${INSTALL_DATA} \{} ${PORTDESTDIR}/\{} \; - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" .endfor .endif diff --git a/devel/apache-ant/files/ant b/devel/apache-ant/files/ant deleted file mode 100644 index 34e80b5c8249..000000000000 --- a/devel/apache-ant/files/ant +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/sh -# -#-*- mode: Fundamental; tab-width: 4; -*- -# ex:ts=4 -# -# FreeBSD-specific startup script for Apache Ant. -# -# See: http://ant.apache.org/ -# -# $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 - -# 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 execute ${JAVACMD}" - exit 1 -fi - - -#----------------------------------------------------------------------------- -# Determine 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 - -# FreeBSD-specific: Add the .jar files from ${PREFIX}/share/java/classes -if [ "${ANT_INCLUDE_SHARED_JARS}" = "YES" ]; then - CLASSPATH_CMD=/usr/local/bin/classpath - if [ -x "${CLASSPATH_CMD}" ]; then - SHARED_JARS=`${CLASSPATH_CMD}` - LOCALCLASSPATH=${SHARED_JARS}:"${LOCALCLASSPATH}" - else - echo "Error: ${CLASSPATH_CMD} is not present on your system" - echo " you should install the java/javavmwrapper port" - exit 1 - fi -fi - - -#----------------------------------------------------------------------------- -# Determine all Ant options -#----------------------------------------------------------------------------- - -# Add Jikes flag if appropriate -if ${usejikes}; then - ANT_OPTS="${ANT_OPTS} -Dbuild.compiler=jikes" -fi - - -#----------------------------------------------------------------------------- -# Execute Ant -#----------------------------------------------------------------------------- - -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 diff --git a/devel/apache-ant/files/ant.sh.in b/devel/apache-ant/files/ant.sh.in index 34e80b5c8249..851df66b030d 100644 --- a/devel/apache-ant/files/ant.sh.in +++ b/devel/apache-ant/files/ant.sh.in @@ -11,10 +11,8 @@ # -DEFAULT_JAVACMD=%%JAVA%% -DEFAULT_JAVA_HOME=%%JAVA_HOME%% DEFAULT_JIKES=false -ANT_HOME=%%ANT_HOME%% +ANT_HOME=${ANT_HOME:-"%%ANT_HOME%%"} #----------------------------------------------------------------------------- @@ -23,7 +21,7 @@ ANT_HOME=%%ANT_HOME%% # Load system-wide configuration if [ -f "%%PREFIX%%/etc/ant.conf" ]; then - . %%PREFIX%%/etc/ant.conf + . "%%PREFIX%%/etc/ant.conf" fi # Load user-specific configuration @@ -32,30 +30,11 @@ if [ -f "${HOME}/.antrc" ]; then fi # Determine if Jikes should be used -if [ -z "${usejikes}" ]; then - usejikes=${DEFAULT_JIKES}; -fi +usejikes=${usejikes:-${DEFAULT_JIKES}}; # 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 execute ${JAVACMD}" - exit 1 -fi - - #----------------------------------------------------------------------------- # Determine CLASSPATH #----------------------------------------------------------------------------- @@ -67,20 +46,15 @@ else LOCALCLASSPATH=${ANT_LIB}/ant-launcher.jar:${LOCALCLASSPATH} fi -# FreeBSD-specific: Add the .jar files from ${PREFIX}/share/java/classes -if [ "${ANT_INCLUDE_SHARED_JARS}" = "YES" ]; then - CLASSPATH_CMD=/usr/local/bin/classpath +# FreeBSD-specific: Add the .jar files from ${JAVALIBDIR} +if [ -n "${ANT_INCLUDE_SHARED_JARS}" ]; then + CLASSPATH_CMD=%%LOCALBASE%%/bin/classpath if [ -x "${CLASSPATH_CMD}" ]; then SHARED_JARS=`${CLASSPATH_CMD}` LOCALCLASSPATH=${SHARED_JARS}:"${LOCALCLASSPATH}" - else - echo "Error: ${CLASSPATH_CMD} is not present on your system" - echo " you should install the java/javavmwrapper port" - exit 1 fi fi - #----------------------------------------------------------------------------- # Determine all Ant options #----------------------------------------------------------------------------- @@ -88,15 +62,21 @@ fi # Add Jikes flag if appropriate if ${usejikes}; then ANT_OPTS="${ANT_OPTS} -Dbuild.compiler=jikes" + if [ -n "${JIKESPATH}" ]; then + ANT_OPTS="${ANT_OPTS} -Djikes.class.path=${JIKESPATH}" + fi fi - #----------------------------------------------------------------------------- # Execute Ant #----------------------------------------------------------------------------- -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}" "$@" +JAVACMD="${JAVACMD:-"%%LOCALBASE%%/bin/java"}" +if [ ! -x "${JAVACMD}" ]; then + echo "Error: ${JAVACMD} is not present on your system" >&2 + echo " Please specify the path to an existing java executable with the" >&2 + echo " JAVACMD environment variable when running ant." >&2 + exit 1 fi + +exec "${JAVACMD}" ${ANT_OPTS} -classpath "${LOCALCLASSPATH}" -Dant.home="${ANT_HOME}" org.apache.tools.ant.launch.Launcher ${ANT_ARGS} -lib "${CLASSPATH}" "$@" |