Bug 51415 - Port textproc/xerces-j should be updated from 2.2.0 to 2.4.0
Summary: Port textproc/xerces-j should be updated from 2.2.0 to 2.4.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Mark Linimon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-25 17:00 UTC by Ernst de Haan
Modified: 2004-04-09 06:55 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ernst de Haan freebsd_committer freebsd_triage 2003-04-25 17:00:28 UTC
Current version of Xerces-J is 2.4.0, while 2.2.0 is still in ports.

See:
http://xml.apache.org/xerces2-j/index.html
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2003-04-25 21:17:42 UTC
Responsible Changed
From-To: freebsd-ports-bugs->kevlo

I'm not sure that a PR filed to nag kevlo is going to help, 
but he's the maintainer so he gets the "Responsible:".
Comment 2 Hervé Quiroz 2004-03-24 19:40:48 UTC
Here is a patch to upgrade the port to the latest version (2.6.2):

- Updated to version 2.6.2
- Now using JAVAJARDIR instead of JAVASHAREDIR/classes
- Now using PORTDOCS macro (to reduce pkg-plist size and fix the apidocs
  deinstall issue with some JDKs)
- Now using PLIST_FILES macro (thus no more pkg-plist)
- Now using MASTER_SITE_APACHE_XML/MASTER_SITE_SUBDIR
- Now using OPTIONS macro for a more flexible build/install:
  - WITH_DEPRECATED_JARS: build and install deprecated JARs (default:
	on, as some ports may depend on it)
  - WITH_SAMPLES_JAR: build and install samples (default: off)

NOTE: Upgrading this port has been rather complex because of Xerces-J
weird packing format.

NOTE2: the 'docs' ant target is still commented but not for the same
reason as before. The stylebook JAR file is bundled within the
Xerces-J-tools but it tries to use the DISPLAY while building the docs
(?!). So chances are the port will fail as root won't have DISPLAY
correctly set. Need some feedback on this one though, because I suspect
some property (System or Ant) could disable this behavior.

NOTE3: be sure to remove completely pkg-plist as it is no longer needed.

NOTE4: no SIZE info. sorry for that.

Herve



diff -ur xerces-j.original/Makefile xerces-j/Makefile
--- xerces-j.original/Makefile	Wed Mar 24 02:21:22 2004
+++ xerces-j/Makefile	Wed Mar 24 02:23:10 2004
@@ -6,11 +6,11 @@
 #
 
 PORTNAME=	xerces-j
-PORTVERSION=	2.2.0
-PORTREVISION=	1
+PORTVERSION=	2.6.2
 CATEGORIES=	textproc java
-MASTER_SITES=	http://xml.apache.org/dist/xerces-j/old_xerces2/
-DISTNAME=	Xerces-J-src.${PORTVERSION}
+MASTER_SITES=	${MASTER_SITE_APACHE_XML}
+MASTER_SITE_SUBDIR=	xerces-j/source
+DISTFILES=	Xerces-J-src.${PORTVERSION}${EXTRACT_SUFX} Xerces-J-tools.${PORTVERSION}${EXTRACT_SUFX}
 
 MAINTAINER=	kevlo@FreeBSD.org
 COMMENT=	XML parser for Java
@@ -20,32 +20,53 @@
 USE_JAVA=	1.3+
 
 WRKSRC=		${WRKDIR}/xerces-${PORTVERSION:S/./_/g}
+
+OPTIONS=	DEPRECATED_JARS "build/install the deprecated JARs" on \
+			SAMPLES_JAR "build/install the samples" off
+
+.include <bsd.port.pre.mk>
+
 ANT?=		${LOCALBASE}/bin/ant
-.if defined(NOPORTDOCS)
-ANT_TARGETS=	jar apijar
-.else
-ANT_TARGETS=	jar apijar javadocs
-# We should install other documentation too, but
-# we have no stylebook port yet
-#
-# ANT_TARGETS=	jar apijar docs javadocs
+ANT_TARGETS=	jars
+.if !defined(NOPORTDOCS)
+ANT_TARGETS+=	javadocs #docs
+PORTDOCS=	api dom3-api other xerces2 xni xs
+.endif
+
+JARFILES+=	xercesImpl.jar xml-apis.jar
+.if defined(WITH_DEPRECATED_JARS)
+ANT_TARGETS+=	deprecatedjars
+JARFILES+=	xerces.jar xmlParserAPIs.jar resolver.jar
+.endif
+.if defined(WITH_SAMPLES_JAR)
+JARFILES+=	xercesSamples.jar
 .endif
-JAVASHAREDIR=	${PREFIX}/share/java
-JARDIR=		${JAVASHAREDIR}/classes
-JARFILES=	xercesImpl.jar xmlParserAPIs.jar
+
+PLIST_FILES+=	${JARFILES:S,^,${JAVAJARDIR:S,${PREFIX},,}/,}
+
+TOOLS_JARFILES=	resolver.jar stylebook-1.0-b2.jar bin/xjavac.jar
+
+post-extract:
+	@cd ${WRKSRC} && ${MV} ../tools .
 
 do-build:
-	@cd ${WRKSRC} && ${ANT} ${ANT_TARGETS}
+	@cd ${WRKSRC} && ${SETENV} CLASSPATH=`echo ${TOOLS_JARFILES:S,^,tools/,} | ${TR} " " ":"` ${ANT} ${ANT_TARGETS}
 
 do-install:
-	@${ECHO} -n ">> Installing JAR files in ${JARDIR}..."
-	@cd ${WRKSRC}/build && ${CP} ${JARFILES} ${JARDIR}/
+	@${ECHO} -n ">> Installing JAR files in ${JAVAJARDIR}..."
+.for JARFILE in ${JARFILES}
+	@cd ${WRKSRC}/build && ${CP} ${JARFILE} ${JAVAJARDIR}/
+	@${ECHO} -n " ${JARFILE}"
+.endfor
 	@${ECHO} " [ DONE ]"
 .if !defined(NOPORTDOCS)
 	@${ECHO} -n ">> Installing documentation in ${DOCSDIR}..."
 	@${MKDIR} ${DOCSDIR}
-	@${CP} -r ${WRKSRC}/build/docs/javadocs/* ${DOCSDIR}
+.for DIR in ${PORTDOCS}
+	@cd ${WRKSRC}/build/docs/javadocs && ${CP} -r ${DIR} ${DOCSDIR}/
+	@${ECHO} -n " ${DIR}"
+.endfor
 	@${ECHO} " [ DONE ]"
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ur xerces-j.original/distinfo xerces-j/distinfo
--- xerces-j.original/distinfo	Wed Mar 24 02:21:22 2004
+++ xerces-j/distinfo	Wed Mar 24 02:21:29 2004
@@ -1 +1,2 @@
-MD5 (Xerces-J-src.2.2.0.tar.gz) = a8ed81677a7f9c17160d4a9a6a5dcdc6
+MD5 (Xerces-J-src.2.6.2.tar.gz) = cfd536b8d72f8ebe3465ae35f5e3775d
+MD5 (Xerces-J-tools.2.6.2.tar.gz) = 55ba4b71ae95acf7d50c4bc0d796ee76
Only in xerces-j.original: pkg-plist
Comment 3 Hervé Quiroz 2004-04-03 22:18:06 UTC
Some additional changes:

- bsd.java.mk 2.0 compliant
- ECHO -> ECHO_CMD
- explicit mkdir JAVAJARDIR (just in case)
- SIZE info :)
- indent tweaking (I used 4 chars wide indents with the previoux patch)



diff -ur xerces-j.original/Makefile xerces-j/Makefile
--- xerces-j.original/Makefile	Sat Apr  3 22:52:47 2004
+++ xerces-j/Makefile	Sat Apr  3 23:05:09 2004
@@ -6,46 +6,69 @@
 #
 
 PORTNAME=	xerces-j
-PORTVERSION=	2.2.0
-PORTREVISION=	1
+PORTVERSION=	2.6.2
 CATEGORIES=	textproc java
-MASTER_SITES=	http://xml.apache.org/dist/xerces-j/old_xerces2/
-DISTNAME=	Xerces-J-src.${PORTVERSION}
+MASTER_SITES=	${MASTER_SITE_APACHE_XML}
+MASTER_SITE_SUBDIR=	xerces-j/source
+DISTFILES=	Xerces-J-src.${PORTVERSION}${EXTRACT_SUFX} Xerces-J-tools.${PORTVERSION}${EXTRACT_SUFX}
 
 MAINTAINER=	kevlo@FreeBSD.org
 COMMENT=	XML parser for Java
 
 BUILD_DEPENDS=	${ANT}:${PORTSDIR}/devel/apache-ant
 
-USE_JAVA=	1.3+
+USE_JAVA=	yes
+JAVA_VERSION=	1.3+
 
 WRKSRC=		${WRKDIR}/xerces-${PORTVERSION:S/./_/g}
+
+OPTIONS=	DEPRECATED_JARS "build/install the deprecated JARs" on \
+		SAMPLES_JAR "build/install the samples" off
+
+.include <bsd.port.pre.mk>
+
 ANT?=		${LOCALBASE}/bin/ant
-.if defined(NOPORTDOCS)
-ANT_TARGETS=	jar apijar
-.else
-ANT_TARGETS=	jar apijar javadocs
-# We should install other documentation too, but
-# we have no stylebook port yet
-#
-# ANT_TARGETS=	jar apijar docs javadocs
+ANT_TARGETS=	jars
+.if !defined(NOPORTDOCS)
+ANT_TARGETS+=	javadocs #docs
+PORTDOCS=	api dom3-api other xerces2 xni xs
+.endif
+
+JARFILES+=	xercesImpl.jar xml-apis.jar
+.if defined(WITH_DEPRECATED_JARS)
+ANT_TARGETS+=	deprecatedjars
+JARFILES+=	xerces.jar xmlParserAPIs.jar resolver.jar
+.endif
+.if defined(WITH_SAMPLES_JAR)
+JARFILES+=	xercesSamples.jar
 .endif
-JAVASHAREDIR=	${PREFIX}/share/java
-JARDIR=		${JAVASHAREDIR}/classes
-JARFILES=	xercesImpl.jar xmlParserAPIs.jar
+
+PLIST_FILES+=	${JARFILES:S,^,${JAVAJARDIR:S,${PREFIX},,}/,}
+
+TOOLS_JARFILES=	resolver.jar stylebook-1.0-b2.jar bin/xjavac.jar
+
+post-extract:
+	@cd ${WRKSRC} && ${MV} ../tools .
 
 do-build:
-	@cd ${WRKSRC} && ${ANT} ${ANT_TARGETS}
+	@cd ${WRKSRC} && ${SETENV} CLASSPATH=`echo ${TOOLS_JARFILES:S,^,tools/,} | ${TR} " " ":"` ${ANT} ${ANT_TARGETS}
 
 do-install:
-	@${ECHO} -n ">> Installing JAR files in ${JARDIR}..."
-	@cd ${WRKSRC}/build && ${CP} ${JARFILES} ${JARDIR}/
-	@${ECHO} " [ DONE ]"
+	@${ECHO_CMD} -n ">> Installing JAR files in ${JAVAJARDIR}..."
+	@${MKDIR} ${JAVAJARDIR}
+.for JARFILE in ${JARFILES}
+	@cd ${WRKSRC}/build && ${CP} ${JARFILE} ${JAVAJARDIR}/
+	@${ECHO_CMD} -n " ${JARFILE}"
+.endfor
+	@${ECHO_CMD} " [ DONE ]"
 .if !defined(NOPORTDOCS)
-	@${ECHO} -n ">> Installing documentation in ${DOCSDIR}..."
+	@${ECHO_CMD} -n ">> Installing documentation in ${DOCSDIR}..."
 	@${MKDIR} ${DOCSDIR}
-	@${CP} -r ${WRKSRC}/build/docs/javadocs/* ${DOCSDIR}
-	@${ECHO} " [ DONE ]"
+.for DOCFILE in ${PORTDOCS}
+	@cd ${WRKSRC}/build/docs/javadocs && ${CP} -r ${DOCFILE} ${DOCSDIR}/
+	@${ECHO_CMD} -n " ${DOCFILE}"
+.endfor
+	@${ECHO_CMD} " [ DONE ]"
 .endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ur xerces-j.original/distinfo xerces-j/distinfo
--- xerces-j.original/distinfo	Sat Apr  3 22:52:47 2004
+++ xerces-j/distinfo	Sat Apr  3 22:54:03 2004
@@ -1,2 +1,4 @@
-MD5 (Xerces-J-src.2.2.0.tar.gz) = a8ed81677a7f9c17160d4a9a6a5dcdc6
-SIZE (Xerces-J-src.2.2.0.tar.gz) = 1434016
+MD5 (Xerces-J-src.2.6.2.tar.gz) = cfd536b8d72f8ebe3465ae35f5e3775d
+SIZE (Xerces-J-src.2.6.2.tar.gz) = 1612086
+MD5 (Xerces-J-tools.2.6.2.tar.gz) = 55ba4b71ae95acf7d50c4bc0d796ee76
+SIZE (Xerces-J-tools.2.6.2.tar.gz) = 3713041
Only in xerces-j.original: pkg-plist
Comment 4 Hervé Quiroz 2004-04-08 13:37:39 UTC
Ernst,

Kevlo has just drop maintainership of this port [1]. I am willing to take
over this maintainership as I already provided this patch...

Herve


[1] http://www.freebsd.org/cgi/cvsweb.cgi/ports/textproc/xerces-j/Makefile
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2004-04-09 05:01:42 UTC
Responsible Changed
From-To: kevlo->linimon

Help this port to find a new maintainer.
Comment 6 Mark Linimon freebsd_committer freebsd_triage 2004-04-09 06:55:09 UTC
State Changed
From-To: open->closed

Committed, thanks.  Submitter is now the new maintainer.