# $Id: Portfile 92044 2012-04-16 19:07:16Z jmr@macports.org $

PortSystem 1.0

name				commons-el
version				1.0
revision			1

categories			java
license				Apache-1.1
maintainers			nomaintainer
platforms			darwin

description			Jakarta Commons-Expression Language
long_description	Commons-EL provides an interpreter for the Expression \
					Language which is  defined by the JavaServer Pages(TM) \
					specification, version 2.0.
homepage			http://commons.apache.org/el/
				
distname			${name}-${version}-src
master_sites		apache:commons/el/source/
checksums			md5 25038283a0b5f638db5e891295d20020

depends_build		bin:ant:apache-ant
depends_lib			bin:java:kaffe \
					port:junit \
					port:servlet24-api

use_configure		no

build.cmd			ant
build.target		jar javadoc
build.args			-Djunit.jar=${prefix}/share/java/junit.jar \
					-Dservlet-api.jar=${prefix}/share/java/servlet24-api.jar \
					-Djsp-api.jar=${prefix}/share/java/jsp2-api.jar \
					-Dservletapi.build.notrequired=true \
					-Djspapi.build.notrequired=true

post-patch {
	# Force source 1.4 so javac doesn't blow up on variables named enum
	reinplace {s|<javac |<javac source="1.4" |} ${worksrcpath}/build.xml
}

pre-build {
	system "touch ${workpath}/LICENSE"
}

destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/java \
		${destroot}${prefix}/share/doc
	xinstall -m 644 ${worksrcpath}/dist/commons-el.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_el.cgi
livecheck.regex "${name}-(\\d+\\.\\d+(\\.\\d+)?)-src.tar.gz"
