Portfile

# $Id: Portfile 23053 2007-03-23 20:35:47Z pipping@macports.org $

PortSystem 1.0
name db45
version 4.5.20
revision 2
categories databases
maintainers nomaintainer@macports.org
platforms darwin
description The Berkely 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

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/db45/${lib}
}
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}
}
}

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

platform darwin 8 {
configure.env CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}