# $Id: Portfile 35275 2008-03-23 15:54:42Z jberry@macports.org $

PortSystem 1.0

name				jakarta-taglibs-string
version				1.1.0

categories			java
maintainers			jberry openmaintainer
platforms			darwin

description			Jakarta Strings Taglib -- taglib for manipulating Java strings
long_description	The String taglibrary provides a host of tags for manipulating \
					java.lang.Strings. The style is that the String to act upon is \
					the body of the tag, and attributes are used as parameters for \
					the manipulation.
homepage			http://jakarta.apache.org/taglibs/doc/string-doc/intro.html
				
master_sites		apache:jakarta/taglibs/string/source/
checksums			md5 db5dc75c89e794f794be92d10df6be1b

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

fetch.type			cvs
cvs.root			:pserver:anoncvs@cvs.apache.org:/home/cvspublic
cvs.module			jakarta-taglibs/string
cvs.args			-d ${distname}	
cvs.tag				string-1-1_POSTRELEASE

post-fetch {
	# Fetch the common doc directory -- ugly, ugly cvs hacks stolen from portfetch.tcl
	# We fetch this from cvs head, since we don't have much choice, and it's just for doc anyway
	system -notty "cd ${workpath} && echo | /usr/bin/env ${cvs.env} cvs ${cvs.pre_args} login"
	system "cd ${workpath} && /usr/bin/env ${cvs.env} cvs -d ${cvs.root} co -d src jakarta-taglibs/src"
	
	# Copy in the common stuff needed by the build
	file copy ${filespath}/common.xml \
		${filespath}/common.properties \
		${filespath}/LICENSE \
		${workpath}
		
	# Create the dist directory
	file mkdir ${workpath}/dist ${workpath}/build
	
	# Create some files that we don't have
	system "cd ${workpath} && touch NOTICE"
}
				
use_configure		no

build.cmd			ant
build.target		dist
build.env			CLASSPATH=${prefix}/share/java/jsp2-api.jar
build.args			-Ddist.dir=${workpath}/dist \
					-Dbuild.dir=${workpath}/build \
					-Dcommons-lang.jar=${prefix}/share/java/commons-lang.jar \
					-Dservlet.jar=${prefix}/share/java/servlet24-api.jar

destroot {
	set dist ${workpath}/dist/string
	
	# Ensure needed directories
	xinstall -m 755 -d \
		${destroot}${prefix}/share/java \
		${destroot}${prefix}/share/doc/${name} \
		${destroot}${prefix}/share/examples/${name}
		
	# Install jars
	xinstall -m 644 ${dist}/taglibs-string.jar \
		${destroot}${prefix}/share/java
		
	# Install docs
	system "cd ${destroot}${prefix}/share/doc/${name} && /usr/bin/env jar fx ${dist}/string-doc.war"
		
	# Install examples
	system "cd ${destroot}${prefix}/share/examples/${name} && /usr/bin/env jar fx ${dist}/string-examples.war"
}
