# $Id: Portfile 48654 2009-03-26 20:25:41Z mcalhoun@macports.org $

PortSystem 1.0
name			db45
version			4.5.20
revision		4
categories		databases
maintainers		nomaintainer
platforms		darwin
use_parallel_build	yes
description		The Berkeley DB package, version 4.5
long_description	\
			Version 4.5 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.5 \
			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/index.html
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 \
			patch.${version}.2
distname		db-${version}
patch.dir               ${workpath}/${distname}
dist_subdir		db4
checksums		${distname}${extract.suffix} \
			  md5 b0f1c777708cb8e9d37fb47e7ed3312d \
			patch.${version}.1 \
			  md5 a571e239b9041d7990df287cbc59ad6f \
			patch.${version}.2 \
			  md5 b7a7086a067ba116f5a8464362c9a9a7

worksrcdir		${distname}/build_unix

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

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

variant tcl description {build Tcl API} {
    depends_lib-append     port:tcl
    configure.args-delete  --disable-tcl
    configure.args-append  --enable-tcl --with-tcl=${prefix}/lib
}

post-destroot {
	delete ${destroot}${prefix}/share
	foreach bin { archive hotbackup dump dump185 printlog upgrade checkpoint recover verify deadlock load stat } {
		file rename ${destroot}${prefix}/bin/db_${bin} \
			${destroot}${prefix}/bin/db45_${bin}
	}
}
