# $Id: Portfile 62063 2009-12-28 16:36:23Z nox@macports.org $

PortSystem 1.0

name				jakarta-taglibs-standard-11
version				1.1.2
revision			1

categories			java
maintainers			jberry openmaintainer
platforms			darwin

description			Jakarta JSP Standard Tag Library (JSTL) v1.1
long_description	A version of the JSP Standard Tag Library (JSTL) adhering \
					to the JSP JSTL 1.1 specification. Requires a JSP 2.0 \
					compatible web container, such as Tomcat5.
homepage			http://tomcat.apache.org/taglibs/standard/

distname			jakarta-taglibs-standard-${version}-src
master_sites		apache:jakarta/taglibs/standard/source/
checksums			md5 42a65b8bd2dede333e4fdfa029f557c2

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

use_configure		no

worksrcdir			${distname}/standard

build.cmd			ant
build.target		dist
build.args			-Dbuild.dir=${worksrcpath}/build \
					-Ddist.dir=${worksrcpath}/dist \
					-Djunit.jar=${prefix}/share/java/junit.jar \
					-Dservlet24.jar=${prefix}/share/java/servlet24-api.jar \
					-Djsp20.jar=${prefix}/share/java/jsp2-api.jar \
					-Dxalan.jar=${prefix}/share/java/xalan.jar
					
variant debug {
	build.args-append	-Dcompile.debug=true
}

post-patch {
	# The following line is incorrect for Mac OS Java only, so we replace it
	# with the correct value in that environment. Our presence check for
	# Mac OS is to look for the specific file in the JavaVM framework.
	#
	# This isn't perfect: what if the user is running kaffe under Mac OS X,
	# (which they shouldn't be, but...)?
	#
	# Note also that the entire line (in build.xml) may apparently be deleted
	# if a JDK greater than v1.4.2 or greater is used: |/lib/rt.jar|d
	
	if [file exists "/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar"] {
		reinplace s|/lib/rt.jar|/../Classes/classes.jar| ${worksrcpath}/build.xml
	}
}

destroot {
	# Ensure needed directories
	xinstall -d \
		${destroot}${prefix}/share/java \
		${destroot}${prefix}/share/doc \
		${destroot}${prefix}/share/examples
	
	# Install the jars
	xinstall -m 644 \
		${worksrcpath}/dist/standard/lib/jstl.jar \
		${worksrcpath}/dist/standard/lib/standard.jar \
		${destroot}${prefix}/share/java
		
	# Install the docs
	file copy ${worksrcpath}/dist/doc/doc/standard-doc \
		${destroot}${prefix}/share/doc/${name}	
	file copy ${worksrcpath}/dist/standard/javadoc \
		${destroot}${prefix}/share/doc/${name}	
		
	# Install the examples
	file copy \
		${worksrcpath}/examples \
		${destroot}${prefix}/share/examples/${name}	
}

platform darwin 10 {
	patchfiles-append patch-JDK-1.6.diff
}

livecheck.type  regex
livecheck.url   http://apache.crihan.fr/dist/jakarta/taglibs/standard/source/
livecheck.regex {standard-(1\.1(?:\.\d+)*)}
