# $Id: Portfile 85404 2011-10-13 10:20:08Z jmr@macports.org $

PortSystem 1.0

name				commons-digester
version				2.0

categories			java
license				Apache-2
maintainers			nomaintainer
platforms			darwin

description			Jakarta Commons-Digester
long_description	Commons-Digester is an XML-to-Java-object mapping utility \
					commonly used for parsing XML configuration files.
homepage			http://commons.apache.org/digester/
				
distname			${name}-${version}-src
master_sites		apache:commons/digester/source/

checksums           md5     75b3e880807844aba1695984587f97f3 \
                    sha1    6d6c978f00e7e12d24b5bb4548f66b7d2fad32f8 \
                    rmd160  08fdd7adf26303f8325c5afd4b6a54cb1776f07f

depends_build		bin:ant:apache-ant
depends_lib			bin:java:kaffe \
					port:junit \
					port:commons-beanutils \
					port:commons-collections \
					port:commons-logging

use_configure		no

build.cmd			ant
build.target		dist
build.args			-Djunit.jar=${prefix}/share/java/junit.jar \
					-Dcommons-beanutils.jar=${prefix}/share/java/commons-beanutils.jar \
					-Dcommons-collections.jar=${prefix}/share/java/commons-collections.jar \
					-Dcommons-logging.jar=${prefix}/share/java/commons-logging.jar
					
post-build {
	# Secondary ant build to build the digester rss jar
	system "cd ${worksrcpath}/src/examples/rss && ant ${build.args} \
		-Ddigester.home=${worksrcpath} dist"
}

destroot	{
	xinstall -m 755 -d ${destroot}${prefix}/share/java \
		${destroot}${prefix}/share/doc
	xinstall -m 644 ${worksrcpath}/dist/commons-digester.jar \
		${worksrcpath}/src/examples/rss/dist/commons-digester-rss.jar \
		${destroot}${prefix}/share/java/
	file copy ${worksrcpath}/dist/docs ${destroot}${prefix}/share/doc/${name}
}

livecheck.type  regex
livecheck.url   http://commons.apache.org/downloads/download_digester.cgi
livecheck.regex "${name}-(\\d+\\.\\d+(\\.\\d+)?)-src.tar.gz"
