# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 117009 2014-02-12 19:34:32Z devans@macports.org $

PortSystem              1.0
PortGroup               python 1.0

name                    py-bsddb3
set real_name           bsddb3
version                 6.0.1
categories-append       databases
platforms               darwin
license                 MIT
maintainers             nomaintainer
description             Python 3 bindings for Oracle Berkeley DB
long_description        This port provides a nearly complete wrapping of the Oracle/Sleepycat C API \
                        for the Database Environment, Database, Cursor, Log Cursor, Sequence \
                        and Transaction objects. Each of these is exposed as a Python type in the \
                        bsddb3.db module.

homepage                http://pypi.python.org/pypi/${real_name}
master_sites            http://pypi.python.org/packages/source/b/${real_name}
distname                ${real_name}-${version}

checksums               rmd160  ede4858b3bd004653fe024b2eaa97dfb5ab93770 \
                        sha256  abc34d83d6cbb40f1626ecc2b62e8163ba204f4bb6a65c23b125a171d224bf6d

python.versions         31 32 33
python.default_version  33
python.link_binaries    no
python.move_binaries    no

# replication requires Berkeley DB >= 5.1
# use with Oracle Berkeley DB >= 6.0 has licensing issues
# http://www.jcea.es/programacion/pybsddb.htm

set db_version          53

if {${name} ne ${subport}} {
    depends_lib         port:py${python.version}-setuptools \
                        port:db${db_version}

    build.env-append    BERKELEYDB_INCDIR=${prefix}/include/db${db_version} \
                        BERKELEYDB_LIBDIR=${prefix}/lib/db${db_version}
    
    destroot.env-append BERKELEYDB_INCDIR=${prefix}/include/db${db_version} \
                        BERKELEYDB_LIBDIR=${prefix}/lib/db${db_version}
    
    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${homepage}
    livecheck.regex     bsddb3 (\\d+(\\.\\d+)+)
}
