From rv@arabica.esil.univ-mrs.fr  Mon Mar  8 05:41:13 2004
Return-Path: <rv@arabica.esil.univ-mrs.fr>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D5F6B16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  8 Mar 2004 05:41:13 -0800 (PST)
Received: from arabica.esil.univ-mrs.fr (arabica.esil.univ-mrs.fr [139.124.41.108])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3051543D31
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  8 Mar 2004 05:41:13 -0800 (PST)
	(envelope-from rv@arabica.esil.univ-mrs.fr)
Received: from arabica.esil.univ-mrs.fr (localhost.esil.univ-mrs.fr [127.0.0.1])
	by arabica.esil.univ-mrs.fr (8.12.10/8.12.10) with ESMTP id i28DfBgw017390
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 8 Mar 2004 14:41:11 +0100 (CET)
	(envelope-from rv@arabica.esil.univ-mrs.fr)
Received: (from rv@localhost)
	by arabica.esil.univ-mrs.fr (8.12.10/8.12.10/Submit) id i28DfANJ017389;
	Mon, 8 Mar 2004 14:41:10 +0100 (CET)
	(envelope-from rv)
Message-Id: <200403081341.i28DfANJ017389@arabica.esil.univ-mrs.fr>
Date: Mon, 8 Mar 2004 14:41:10 +0100 (CET)
From: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
Reply-To: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Update port: java/jakarta-commons-logging [PATCH]
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63928
>Category:       java
>Synopsis:       Update port: java/jakarta-commons-logging [PATCH]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    znerd
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 08 05:50:06 PST 2004
>Closed-Date:    Thu Apr 15 13:59:01 PDT 2004
>Last-Modified:  Thu Apr 15 13:59:01 PDT 2004
>Originator:     Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
>Release:        FreeBSD 5.2.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD arabica.esil.univ-mrs.fr 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Fri Feb 27 11:36:17 CET 2004 root@arabica.esil.univ-mrs.fr:/usr/obj/usr/src/sys/ASSIMILATED i386

>Description:

Changes:
- Now using PORTDOCS macro for automated PLIST build (should fix the deinstall
  issue)
- Now using OPTIONS macro for dependency setting:
  - WITH_LOG4J: Enable Jakarta Log4j log factory (default: on)
  - WITH_LOGKIT: Enable Avalon LogKit log factory (default: off)
  - WITH_JDK14LOG: Enable JDK 1.4 log factory (default: off)
- Changed Ant target 'dist' to 'compile' (to produce only JAR when NOPORTDOCS
  is set)
- Now using Ant target 'javadoc' (see above)
- Fixed an issue with shared JARs not in classpath (by setting
  ANT_INCLUDE_SHARED_JARS=YES)

NOTE: The OPTIONS macro will not ensure that optional components will not be
built (they will be if the right dependency is already installed) but rather
that dependencies are correctly set.

NOTE2: I was thinking of using a PKGNAMESUFFIX according to optional
dependencies. Here are my two cents on the subject:
  - '-minimal' when everything in turned off
  - '-all' when everything inturned on
  - a minus-separated list of optional comonents (eg: '-log4j-logkit' or
	'-jdk14') otherwise

NOTE3: I think we should really do something for the ANT_INCLUDE_SHARED_JARS
issue. Maybe defining ANT macros in bsd.java.mk 2.0 would be fine. A PR is on
the way: http://www.freebsd.org/cgi/query-pr.cgi?pr=59997

>How-To-Repeat:


>Fix:

diff -ur jakarta-commons-logging.original/Makefile jakarta-commons-logging/Makefile
--- jakarta-commons-logging.original/Makefile	Mon Mar  8 01:51:36 2004
+++ jakarta-commons-logging/Makefile	Mon Mar  8 03:14:16 2004
@@ -15,18 +15,36 @@
 MAINTAINER=	znerd@FreeBSD.org
 COMMENT=	Generic logging wrapper library
 
-BUILD_DEPENDS=	${ANT}:${PORTSDIR}/devel/apache-ant \
-		${LOCALBASE}/share/java/classes/log4j.jar:${PORTSDIR}/java/jakarta-log4j
+BUILD_DEPENDS=	${ANT}:${PORTSDIR}/devel/apache-ant
 
-USE_JAVA=	1.2+
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-src
 
+OPTIONS=	LOG4J "Enable Jakarta Log4j log factory" on \
+			LOGKIT "Enable Avalon LogKit log factory" off \
+			JDK14LOG "Enable JDK 1.4 log factory" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_JDK14LOG)
+USE_JAVA=	1.4+
+.else
+USE_JAVA=	1.2+
+.endif
+
+.if defined(WITH_LOG4J)
+BUILD_DEPENDS+=	${LOCALBASE}/share/java/classes/log4j.jar:${PORTSDIR}/java/jakarta-log4j
+.endif
+
+.if defined(WITH_LOGKIT)
+BUILD_DEPENDS+=	${LOCALBASE}/share/java/classes/logkit.jar:${PORTSDIR}/java/avalon-logkit
+.endif
+
 PLIST_SUB+=	T=${TARGET_DIR:S/^${PREFIX}\///}
 ANT?=		${LOCALBASE}/bin/ant
-.if defined(NOPORTDOCS)
-ANT_TARGET=	dist
-.else
-ANT_TARGET=	dist
+ANT_TARGET=	compile
+.if !defined(NOPORTDOCS)
+ANT_TARGET=	javadoc
+PORTDOCS=	*
 .endif
 JAVASHAREDIR=	${PREFIX}/share/java
 JARDIR=		${JAVASHAREDIR}/classes
@@ -37,11 +55,11 @@
 	@${CP} ${PORTSDIR}/java/jakarta-commons-beanutils/files/LICENSE ${WRKDIR}/${PORTNAME}-${PORTVERSION}-src/
 
 do-build:
-	@cd ${WRKSRC} && ${ANT} ${ANT_TARGET}
+	@cd ${WRKSRC} && ${SETENV} ANT_INCLUDE_SHARED_JARS=YES ${ANT} ${ANT_TARGET}
 
 do-install:
 	@${ECHO} -n ">> Installing JAR as ${JARDIR}/${DESTJARFILE}..."
-	@${CP} ${WRKSRC}/dist/${JARFILE} ${JARDIR}/${DESTJARFILE}
+	@${CP} ${WRKSRC}/target/${JARFILE} ${JARDIR}/${DESTJARFILE}
 	@${ECHO} " [ DONE ]"
 
 .if !defined(NOPORTDOCS)
@@ -51,4 +69,4 @@
 	@${ECHO} " [ DONE ]"
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ur jakarta-commons-logging.original/pkg-plist jakarta-commons-logging/pkg-plist
--- jakarta-commons-logging.original/pkg-plist	Mon Mar  8 01:51:36 2004
+++ jakarta-commons-logging/pkg-plist	Mon Mar  8 03:11:34 2004
@@ -1,37 +1 @@
-share/doc/commons-logging/org/apache/commons/logging/impl/SimpleLog.html
-share/doc/commons-logging/org/apache/commons/logging/impl/package-tree.html
-share/doc/commons-logging/org/apache/commons/logging/impl/package-frame.html
-share/doc/commons-logging/org/apache/commons/logging/impl/Jdk14Logger.html
-share/doc/commons-logging/org/apache/commons/logging/impl/Log4JCategoryLog.html
-share/doc/commons-logging/org/apache/commons/logging/impl/Log4jFactory.html
-share/doc/commons-logging/org/apache/commons/logging/impl/Log4JLogger.html
-share/doc/commons-logging/org/apache/commons/logging/impl/LogFactoryImpl.html
-share/doc/commons-logging/org/apache/commons/logging/impl/LogKitLogger.html
-share/doc/commons-logging/org/apache/commons/logging/impl/NoOpLog.html
-share/doc/commons-logging/org/apache/commons/logging/impl/package-summary.html
-share/doc/commons-logging/org/apache/commons/logging/package-tree.html
-share/doc/commons-logging/org/apache/commons/logging/package-frame.html
-share/doc/commons-logging/org/apache/commons/logging/Log.html
-share/doc/commons-logging/org/apache/commons/logging/LogFactory.html
-share/doc/commons-logging/org/apache/commons/logging/LogSource.html
-share/doc/commons-logging/org/apache/commons/logging/package-summary.html
-share/doc/commons-logging/org/apache/commons/logging/LogConfigurationException.html
-share/doc/commons-logging/serialized-form.html
-share/doc/commons-logging/packages.html
-share/doc/commons-logging/package-list
-share/doc/commons-logging/overview-tree.html
-share/doc/commons-logging/overview-summary.html
-share/doc/commons-logging/overview-frame.html
-share/doc/commons-logging/index.html
-share/doc/commons-logging/index-all.html
-share/doc/commons-logging/help-doc.html
-share/doc/commons-logging/deprecated-list.html
-share/doc/commons-logging/stylesheet.css
-share/doc/commons-logging/allclasses-frame.html
 share/java/classes/commons-logging.jar
-@dirrm share/doc/commons-logging/org/apache/commons/logging/impl
-@dirrm share/doc/commons-logging/org/apache/commons/logging
-@dirrm share/doc/commons-logging/org/apache/commons
-@dirrm share/doc/commons-logging/org/apache
-@dirrm share/doc/commons-logging/org
-@dirrm share/doc/commons-logging
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-java->znerd 
Responsible-Changed-By: glewis 
Responsible-Changed-When: Thu Apr 1 17:00:52 PST 2004 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63928 

From: Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
To: freebsd-gnats-submit@FreeBSD.org
Cc: znerd@FreeBSD.org
Subject: Re: java/63928: Update port: java/jakarta-commons-logging [PATCH]
Date: Sat, 3 Apr 2004 19:31:32 +0200

 A lot of changes here:
 
 - bsd.java.mk 2.0 compliant
 - fixed a bug with ant targets (adding rather than overwriting)
 - use JAVAJARDIR everywhere
 - fixed the ugly '*' in PORTDOCS
 - ECHO -> ECHO_CMD (I was told this is the right way by a commiter)
 - fixed indentation (I was using 4 chars indent previously)
 - use MASTER_SITE_APACHE_JAKARTA
 - removed the WRKSRC override stuff (it's the default value anyway)
 
 NOTE: I still don't understand the LICENSE stuff in post-extract... So I
 included the file in the port documentation.
 
 NOTE2: I realized with this port upgrade that USE_JAVA has to be put
 BEFORE including bsd.port.pre.mk
 
 
 
 diff -ur jakarta-commons-logging.original/Makefile jakarta-commons-logging/Makefile
 --- jakarta-commons-logging.original/Makefile	Sat Apr  3 19:01:57 2004
 +++ jakarta-commons-logging/Makefile	Sat Apr  3 19:28:33 2004
 @@ -8,47 +8,65 @@
  PORTNAME=	commons-logging
  PORTVERSION=	1.0.3
  CATEGORIES=	java
 -MASTER_SITES=	http://apache.cs.uu.nl/dist/jakarta/commons/logging/source/
 +MASTER_SITES=	${MASTER_SITE_APACHE_JAKARTA}
 +MASTER_SITE_SUBDIR=	commons/logging/source/
  PKGNAMEPREFIX=	jakarta-
  DISTNAME=	${PORTNAME}-${PORTVERSION}-src
  
  MAINTAINER=	znerd@FreeBSD.org
  COMMENT=	Generic logging wrapper library
  
 -BUILD_DEPENDS=	${ANT}:${PORTSDIR}/devel/apache-ant \
 -		${LOCALBASE}/share/java/classes/log4j.jar:${PORTSDIR}/java/jakarta-log4j
 +BUILD_DEPENDS=	${ANT}:${PORTSDIR}/devel/apache-ant
  
 -USE_JAVA=	1.2+
 -WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-src
 +OPTIONS=	LOG4J "Enable Jakarta Log4j log factory" on \
 +		LOGKIT "Enable Avalon LogKit log factory" off \
 +		JDK14LOG "Enable JDK 1.4 log factory" off
  
 -PLIST_SUB+=	T=${TARGET_DIR:S/^${PREFIX}\///}
 -ANT?=		${LOCALBASE}/bin/ant
 -.if defined(NOPORTDOCS)
 -ANT_TARGET=	dist
 +USE_JAVA=	yes
 +
 +.include <bsd.port.pre.mk>
 +
 +.if defined(WITH_JDK14LOG)
 +JAVA_VERSION=	1.4+
  .else
 -ANT_TARGET=	dist
 +JAVA_VERSION=	1.2+
 +.endif
 +
 +.if defined(WITH_LOG4J)
 +BUILD_DEPENDS+=	${JAVAJARDIR}/log4j.jar:${PORTSDIR}/java/jakarta-log4j
 +.endif
 +
 +.if defined(WITH_LOGKIT)
 +BUILD_DEPENDS+=	${JAVAJARDIR}/logkit.jar:${PORTSDIR}/java/avalon-logkit
 +.endif
 +
 +ANT?=		${LOCALBASE}/bin/ant
 +ANT_TARGET=	compile
 +.if !defined(NOPORTDOCS)
 +ANT_TARGET+=	javadoc
 +PORTDOCS=	api LICENSE
  .endif
 -JAVASHAREDIR=	${PREFIX}/share/java
 -JARDIR=		${JAVASHAREDIR}/classes
  JARFILE=	${PORTNAME}.jar
  DESTJARFILE=	${PORTNAME}.jar
 +PLIST_FILES=	${JAVAJARDIR:S,^${PREFIX}/,,}/${DESTJARFILE}
  
  post-extract:
  	@${CP} ${PORTSDIR}/java/jakarta-commons-beanutils/files/LICENSE ${WRKDIR}/${PORTNAME}-${PORTVERSION}-src/
  
  do-build:
 -	@cd ${WRKSRC} && ${ANT} ${ANT_TARGET}
 +	@cd ${WRKSRC} && ${SETENV} ANT_INCLUDE_SHARED_JARS=YES ${ANT} ${ANT_TARGET}
  
  do-install:
 -	@${ECHO} -n ">> Installing JAR as ${JARDIR}/${DESTJARFILE}..."
 -	@${CP} ${WRKSRC}/dist/${JARFILE} ${JARDIR}/${DESTJARFILE}
 -	@${ECHO} " [ DONE ]"
 +	@${ECHO_CMD} -n ">> Installing JAR as ${JAVAJARDIR}/${DESTJARFILE}..."
 +	@${CP} ${WRKSRC}/target/${JARFILE} ${JAVAJARDIR}/${DESTJARFILE}
 +	@${ECHO_CMD} " [ DONE ]"
  
  .if !defined(NOPORTDOCS)
 -	@${ECHO} -n ">> Installing documentation in ${DOCSDIR}..."
 +	@${ECHO_CMD} -n ">> Installing documentation in ${DOCSDIR}..."
  	@${MKDIR} ${DOCSDIR}
 -	@${CP} -r ${WRKSRC}/dist/docs/api/* ${DOCSDIR}
 -	@${ECHO} " [ DONE ]"
 +	@${CP} -r ${WRKSRC}/dist/docs/api ${DOCSDIR}/
 +	@${CP} ${WRKSRC}/LICENSE ${DOCSDIR}/
 +	@${ECHO_CMD} " ${PORTDOCS} [ DONE ]"
  .endif
  
 -.include <bsd.port.mk>
 +.include <bsd.port.post.mk>
 diff -ur jakarta-commons-logging.original/pkg-plist jakarta-commons-logging/pkg-plist
 --- jakarta-commons-logging.original/pkg-plist	Sat Apr  3 19:01:57 2004
 +++ jakarta-commons-logging/pkg-plist	Sat Apr  3 19:02:55 2004
 @@ -1,37 +0,0 @@
 -share/doc/commons-logging/org/apache/commons/logging/impl/SimpleLog.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/package-tree.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/package-frame.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/Jdk14Logger.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/Log4JCategoryLog.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/Log4jFactory.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/Log4JLogger.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/LogFactoryImpl.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/LogKitLogger.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/NoOpLog.html
 -share/doc/commons-logging/org/apache/commons/logging/impl/package-summary.html
 -share/doc/commons-logging/org/apache/commons/logging/package-tree.html
 -share/doc/commons-logging/org/apache/commons/logging/package-frame.html
 -share/doc/commons-logging/org/apache/commons/logging/Log.html
 -share/doc/commons-logging/org/apache/commons/logging/LogFactory.html
 -share/doc/commons-logging/org/apache/commons/logging/LogSource.html
 -share/doc/commons-logging/org/apache/commons/logging/package-summary.html
 -share/doc/commons-logging/org/apache/commons/logging/LogConfigurationException.html
 -share/doc/commons-logging/serialized-form.html
 -share/doc/commons-logging/packages.html
 -share/doc/commons-logging/package-list
 -share/doc/commons-logging/overview-tree.html
 -share/doc/commons-logging/overview-summary.html
 -share/doc/commons-logging/overview-frame.html
 -share/doc/commons-logging/index.html
 -share/doc/commons-logging/index-all.html
 -share/doc/commons-logging/help-doc.html
 -share/doc/commons-logging/deprecated-list.html
 -share/doc/commons-logging/stylesheet.css
 -share/doc/commons-logging/allclasses-frame.html
 -share/java/classes/commons-logging.jar
 -@dirrm share/doc/commons-logging/org/apache/commons/logging/impl
 -@dirrm share/doc/commons-logging/org/apache/commons/logging
 -@dirrm share/doc/commons-logging/org/apache/commons
 -@dirrm share/doc/commons-logging/org/apache
 -@dirrm share/doc/commons-logging/org
 -@dirrm share/doc/commons-logging
State-Changed-From-To: open->closed 
State-Changed-By: znerd 
State-Changed-When: Thu Apr 15 13:58:54 PDT 2004 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63928 
>Unformatted:
