# $Id: Portfile 50682 2009-05-06 21:29:56Z blair@macports.org $

PortSystem 1.0

name			derby
version			10.5.1.1

categories		java
maintainers		blair
platforms		darwin

description		Relational database implemented entirely in Java
long_description	Apache Derby, an Apache DB subproject, is an open \
			source relational database implemented entirely in \
			Java and available under the Apache License, Version \
			2.0.  Some key advantages include:  1) Derby has a \
			small footprint -- about 2 megabytes for the base \
			engine and embedded JDBC driver.  2) Derby is based \
			on the Java, JDBC, and SQL standards.  3) Derby \
			provides an embedded JDBC driver that lets you \
			embed Derby in any Java-based solution.  4) Derby \
			also supports the more familiar client/server mode \
			with the Derby Network Client JDBC driver and Derby \
			Network Server.  5) Derby is easy to install, deploy, \
			and use.
homepage		http://db.apache.org/derby/

master_sites		apache:db/derby/db-${name}-${version}
distname		db-${name}-${version}-bin
checksums		md5 62fa34609e6a5abdda2c20667d06b9e5 \
			sha1 5f09e51a80b80225946306bcd7985dea6d1cb42b \
			rmd160  6ba07921acb3f0a639ac4b905dfba1398ee00a03

depends_lib		bin:java:kaffe

use_configure		no

build.cmd		true

destroot {
	# Ensure needed directories
	xinstall -m 755 -d ${destroot}${prefix}/share \
		${destroot}${prefix}/share/doc/${name}

	foreach f { dblook derby_common.sh ij sysinfo } {
		file copy ${worksrcpath}/bin/$f ${destroot}${prefix}/bin
	}

	foreach f { KEYS LICENSE NOTICE RELEASE-NOTES.html } {
		file copy ${worksrcpath}/$f \
			${destroot}${prefix}/share/doc/${name}
	}

	file copy ${worksrcpath}/lib ${destroot}${prefix}/share/java
}

variant doc description {Install HTML and PDF documentation and javadocs} {
	post-destroot {
		foreach f { docs javadoc } {
			file copy ${worksrcpath}/$f \
				${destroot}${prefix}/share/doc/${name}
		}
	}
}

livecheck.check		regex
livecheck.url		"http://db.apache.org/derby/releases/?C=N;O=D"
livecheck.regex		release-(\[0-9.\]+)\.html
