# $Id: Portfile 36872 2008-05-17 03:31:07Z ryandesign@macports.org $

PortSystem 1.0
name			db43
version			4.3.29
revision		1
categories		databases
maintainers		nomaintainer
platforms		darwin
use_parallel_build	yes
description		The Berkeley DB package, version 4.3
long_description	\
			Version 4.3 of the Berkeley Data Base library which \
			offers (key/value) storage with optional concurrent \
			access or transactions interface.  This port will \
			install the AES (American Encryption Standard) \
			enabled version.  Utilities are included in the \
			distribution to convert v1.85 databases to v4.3 \
			databases, and a backwards compatible API is \
			provided to maintain compatibility with programs \
			using the v1.85 interface.

homepage		http://www.oracle.com/database/berkeley-db/
master_sites		http://download-west.oracle.com/berkeley-db/ \
			http://download-east.oracle.com/berkeley-db/ \
			http://download-uk.oracle.com/berkeley-db/
patch_sites		http://www.oracle.com/technology/products/berkeley-db/db/update/${version}/
patchfiles		patch.${version}.1
distname		db-${version}
patch.dir               ${workpath}/${distname}
dist_subdir		db4
checksums		${distname}${extract.suffix} \
			  sha1 49c31bb12144e3a8fb8b7f64e7bf989b72f2981a \
			patch.${version}.1 \
			  sha1 264edf4ebcd45f9373e4ea3a190506a0505969da

worksrcdir		${distname}/build_unix

configure.cmd		../dist/configure
configure.args		--enable-cxx --enable-compat185 --enable-dump185 \
				--includedir=\\\${prefix}/include/db43 \
				--libdir=\\\${prefix}/lib/db43 \
				--program-transform-name="s,^db,db43," \
				--disable-tcl

destroot.destdir	prefix=${destroot}${prefix} \
				docdir=${destroot}${prefix}/share/${name}-${version}/

post-destroot {
	delete ${destroot}${prefix}/share
	foreach lib { libdb.a libdb_cxx.a } {
		delete ${destroot}${prefix}/lib/db43/${lib}
	}
	foreach bin { archive dump dump185 printlog upgrade checkpoint recover verify deadlock load stat } {
		file rename ${destroot}${prefix}/bin/db_${bin} \
			${destroot}${prefix}/bin/db43_${bin}
	}
}

variant java {
	configure.args-append --enable-java
}

