PortSystem 1.0

name				javasqlite
version				20100131
categories			java databases
license				Tcl/Tk
platforms			darwin

maintainers			nomaintainer
description			Java wrapper for sqlite
long_description	Java wrapper including a basic JDBC driver for the SQLite \
					2/3 database engine. It is designed using JNI to \
					interface to the SQLite API.
homepage			http://www.ch-werner.de/javasqlite/
master_sites		${homepage}

checksums			md5     aa0c89534045f08e72f7b2d9538bb164 \
					sha1    7aade6951dfb0b94368e8e5d6ac4e12d1a904899 \
					rmd160  447252c09af76968bf76bf086eb58a946e855199

patchfiles			patch-configure

depends_lib			port:sqlite2 \
					port:sqlite3

universal_variant	no

configure.args-append	--with-jardir=${prefix}/share/java/ \
						--with-sqlite=${prefix} \
						--with-sqlite3=${prefix}

test.run			yes
post-test {
	# This test function could be improved. We probably want a diff method
	# in base/
	system "cd ${worksrcpath} && java test > ${worksrcpath}/test.output 2>&1"
	system "exit `diff ${filespath}/test.output ${worksrcpath}/test.output | wc -l`"
}

platform darwin {
	patchfiles-append patch-Makefile.in-jnilib
}

livecheck.url	${homepage}overview-summary.html
livecheck.type	regexm
livecheck.regex	{<H1>\s+SQLite Java Wrapper/JDBC Driver\s+<br><small>\s+(.*)\s+</small>\s+</H1>}
livecheck.version	[regsub {(....)(..)(..)} ${version} {\1-\2-\3}]
