PortSystem 1.0

name            	maven2
version         	2.0.4

categories      	java devel
maintainers     	gk5885@kickstyle.net
platforms       	darwin

description    		A java-based build and project management environment.
long_description	Maven is a Java project management and project comprehension \
				tool. Maven is based on the concept of a project object model (POM) \
				in that all the artifacts produced by Maven are a result of consulting \
				a well defined model for your project. Builds, documentation, source \
				metrics, and source  cross-references are all controlled by your POM.  \
				Maven 2.0 is a complete rewrite of Maven 1.0 and as such is better organized, \
				faster and easier to use. 
homepage		http://maven.apache.org/

master_sites		apache:maven/binaries
checksums       	md5 864c36071e043d243c84355c0d7c2929

distname			maven-${version}-bin
worksrcdir			maven-${version}

depends_build		bin:java:kaffe
					
use_configure		no
use_bzip2			yes

# Source builds of maven are not possible. So, the default build is a binary 
# install of the jars.
build.cmd		true

destroot {
	# Create the target java directory exists
	xinstall -m 755 -d ${destroot}${prefix}/share/java/${name}
	
	# Copy over the needed elements of our directory tree
	file copy \
		${worksrcpath}/bin \
		${worksrcpath}/lib \
		${worksrcpath}/core \
		${worksrcpath}/conf \
		${destroot}${prefix}/share/java/${name}
		
	# Remove extraneous bat files
	foreach f [glob -directory ${destroot}${prefix}/share/java/${name}/bin *.bat] {
		file delete $f
	}
	
	# Fix permissions on shell scripts
	foreach f { maven install_repo.sh } {
		if [file exists ${destroot}${prefix}/share/java/${name}/bin/$f] {
			file attributes ${destroot}${prefix}/share/java/${name}/bin/$f -permissions +x
		}
	}
	
	# Symlink maven into the bin directory
	system "cd ${destroot}${prefix}/bin && ln -s ${prefix}/share/java/${name}/bin/mvn"
}

