Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 5 May 2003 20:09:59 +0200 (CEST)
From:      Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
To:        Greg Lewis <glewis@misty.eyesbeyond.com>
Cc:        freebsd-java@freebsd.org
Subject:   Re: bsd.java.mk: USE_ANT
Message-ID:  <20030505200415.K97673@puget.esil.univ-mrs.fr>
In-Reply-To: <20030502172300.GA5567@misty.eyesbeyond.com>
References:  <20030501190202.S93849@puget.esil.univ-mrs.fr> <20030502172300.GA5567@misty.eyesbeyond.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
Hi,


Here it is ! A patch for bsd.java.mk and a patch for an existing port to
test the new Ant support.

BTW Ernst, there were some missing files in the pkg-plist for
jakarta-commons-cli so even if you don't commit the Ant support as-is, you
may use the port diff to fix the existing port.

If people review it and agree with it, I think it will ease the porting of
java libs. Furthermore, it would encourage porters to have the libs built
from source instead of just installed from downloaded binaries.

Regards,

Herve


[-- Attachment #2 --]
diff -u jakarta-commons-cli.old/Makefile jakarta-commons-cli/Makefile
--- jakarta-commons-cli.old/Makefile	Mon May  5 14:44:08 2003
+++ jakarta-commons-cli/Makefile	Mon May  5 20:00:28 2003
@@ -15,33 +15,28 @@
 MAINTAINER=	znerd@FreeBSD.org
 COMMENT=	Java library for command line arguments and options
 
-BUILD_DEPENDS=	${ANT}:${PORTSDIR}/devel/jakarta-ant \
-		${LOCALBASE}/share/java/classes/commons-lang.jar:${PORTSDIR}/java/jakarta-commons-lang
+BUILD_DEPENDS=	${LOCALBASE}/share/java/classes/commons-lang.jar:${PORTSDIR}/java/jakarta-commons-lang
 
 USE_JAVA=	1.2+
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}
 
 PLIST_SUB+=	T=${TARGET_DIR:S/^${PREFIX}\///}
-ANT?=		${LOCALBASE}/bin/ant
-.if defined(NOPORTDOCS)
-ANT_TARGET=	jar -Dnoget
-.else
-ANT_TARGET=	jar javadoc -Dnoget -verbose
+USE_ANT=	yes
+ANT_ARGS=	-Dnoget
+ANT_TARGET=	jar
+.if !defined(NOPORTDOCS)
+ANT_TARGET=	javadoc
 .endif
-JAVASHAREDIR=	${PREFIX}/share/java
-JARDIR=		${JAVASHAREDIR}/classes
-JARFILE=	${PORTNAME}-${PORTVERSION}-beta-2-dev.jar
-DESTJARFILE=	${PORTNAME}.jar
+JARFILE=	${WRKSRC}/target/${PORTNAME}-${PORTVERSION}-beta-2-dev.jar
+DESTJARFILE=	${JAVAJARDIR}/${PORTNAME}.jar
 
-do-build:
-	@${MKDIR} ${WRKSRC}/lib
-	@cd ${WRKSRC} && ${ANT} ${ANT_TARGET}
+pre-build:
+	@mkdir ${WRKSRC}/lib
 
 do-install:
-	@${ECHO} -n ">> Installing JAR as ${JARDIR}/${DESTJARFILE}..."
-	@${CP} ${WRKSRC}/target/${JARFILE} ${JARDIR}/${DESTJARFILE}
+	@${ECHO} -n ">> Installing JAR as ${DESTJARFILE}..."
+	@${CP} ${JARFILE} ${DESTJARFILE}
 	@${ECHO} " [ DONE ]"
-
 .if !defined(NOPORTDOCS)
 	@${ECHO} -n ">> Installing documentation in ${DOCSDIR}..."
 	@${MKDIR} ${DOCSDIR}
diff -u jakarta-commons-cli.old/pkg-plist jakarta-commons-cli/pkg-plist
--- jakarta-commons-cli.old/pkg-plist	Mon May  5 14:44:08 2003
+++ jakarta-commons-cli/pkg-plist	Mon May  5 14:54:35 2003
@@ -50,6 +50,8 @@
 share/doc/commons-cli/deprecated-list.html
 share/doc/commons-cli/stylesheet.css
 share/doc/commons-cli/allclasses-frame.html
+share/doc/commons-cli/allclasses-noframe.html
+share/doc/commons-cli/constant-values.html
 share/java/classes/commons-cli.jar
 @dirrm share/doc/commons-cli/org/apache/commons/cli/class-use
 @dirrm share/doc/commons-cli/org/apache/commons/cli
Only in jakarta-commons-cli.old: work

[-- Attachment #3 --]
--- bsd.java.mk.old	Mon May  5 09:52:57 2003
+++ bsd.java.mk	Mon May  5 19:58:55 2003
@@ -506,3 +506,38 @@
 .		endif
 .	endif
 .endif
+
+
+#-----------------------------------------------------------------------------
+# Apache Ant support
+#
+# ANT_ENV		- Ant environement variables (see Ant's Manual for details)
+# ANT_ARGS		- Arguments to be passed to Ant when build the specified
+# 				  target(s).
+# ANT_TARGET	- Target(s) to build with Ant as part of the port build.
+.if defined(USE_ANT)
+
+# Define (if not already) the Ant executable
+ANT_CMD?=	${LOCALBASE}/bin/ant
+
+# Ant port dependency
+BUILD_DEPENDS+=		${ANT_CMD}:${PORTSDIR}/devel/jakarta-ant
+
+# building with Ant
+.	if !target(do-build)
+do-build:
+	@echo ">> Building with ant..."
+	@echo "	ANT_CMD=	${ANT_CMD}"
+.		if defined(ANT_ENV)
+	@echo "	ANT_ENV=	${ANT_ENV}"
+.		endif
+.		if defined(ANT_ARGS)
+	@echo "	ANT_ARGS=	${ANT_ARGS}"
+.		endif
+.		if defined(ANT_TARGET)
+	@echo "	ANT_TARGET=	${ANT_TARGET}"
+.		endif
+	@cd ${WRKSRC} && ${SETENV} ${ANT_ENV} ${ANT_CMD} ${ANT_ARGS} ${ANT_TARGET}
+.	endif
+
+.endif
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030505200415.K97673>