# $Id: Portfile,v 1.10 2006/03/03 22:14:44 jberry Exp $

PortSystem 1.0

name				spring-framework
version				1.2.7

categories			java
maintainers			jberry@opendarwin.org
platforms			darwin

description			Spring application framework for Java
long_description	Spring is a layered Java/J2EE application framework.
homepage			http://www.springframework.org/

distname			${name}-${version}-with-dependencies
master_sites		sourceforge:springframework
checksums			md5 ee81fc7c7faa742152cbf92a9c4cc75f

use_zip				yes

depends_build		bin:ant:apache-ant
depends_lib			bin:java:kaffe
				
use_configure		no

worksrcdir			${name}-${version}

build.cmd			ant
build.target		alljars

# This variant builds spring with debug information -- useful if you're tracing into it in a debugger
variant debug {
	build.args-append	-Ddebug=true
}

destroot	{
	# Ensure needed directories
	xinstall -m 755 -d ${destroot}${prefix}/share/java \
		${destroot}${prefix}/share/doc \
		${destroot}${prefix}/share/examples
		
	# Install the framework
	file copy ${worksrcpath}/dist \
		${destroot}${prefix}/share/java/${name}
		
	# Add symlinks to jars
	foreach f [glob -tails -directory ${destroot}${prefix}/share/java ${name}/*.jar] {
		system "cd ${destroot}${prefix}/share/java && ln -s ${f}"
	}
	
	# Install the docs
	file copy ${worksrcpath}/docs \
		${destroot}${prefix}/share/doc/${name}

	# Install samples
	file copy ${worksrcpath}/samples \
		${destroot}${prefix}/share/examples/${name}
}
