# -*- 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 81104 2011-07-25 17:01:53Z stromnov@macports.org $

PortSystem          1.0

name                tokyocabinet
version             1.4.47
revision            1
categories          databases
maintainers         stromnov openmaintainer
platforms           darwin

description         Tokyo Cabinet is a library of routines for managing   \
                    a database.

long_description    \
    Tokyo Cabinet is a library of routines for managing a database.  The  \
    database is a simple data file containing records, each is a pair of  \
    a key and a value.  Every key and value is serial bytes with variable \
    length.  Both binary data and character string can be used as a key   \
    and a value.  There is neither concept of data tables nor data types. \
    Records are organized in hash table or B+ tree.

homepage            http://fallabs.com/tokyocabinet/
master_sites        ${homepage}

checksums           md5     3d94fe2aebf5d9ff0478ed895bc46fc9 \
                    sha1    18608ac2e6e469e20d1c36ae1117661bb47901c4 \
                    rmd160  50c6ca7d1c24ebe5b59c84a5ae46f8949258d3d7

patchfiles          patch-configure.diff

depends_lib         port:zlib \
                    port:bzip2

# To avoid linking against a previously installed version, remove the default
# CPPFLAGS and LDFLAGS. The build scripts already add the
# destination include and lib directories.
configure.cppflags
configure.ldflags

configure.args      --mandir=${prefix}/share/man \
                    --datadir=${prefix}/share/doc

test.run            yes
test.target         check

# broken on snow leopard, ticket #25513
if {${os.major} < 10 || ${os.platform} != "darwin"} {
variant debug conflicts devel profile fastest description {build for debugging} {
    configure.args-append   --enable-debug
}
}

variant devel conflicts profile fastest description {build for development} {
    configure.args-append   --enable-devel
}

variant profile conflicts devel fastest description {build for profiling} {
    configure.args-append   --enable-profile
}

variant fastest conflicts devel profile description {build for fastest run} {
    configure.args-append   --enable-fastest
}

variant off64 description {build with 64-bit file offset on 32-bit system} {
    configure.args-append   --enable-off64
}

variant swap description {build for swapping byte-orders} {
    configure.args-append   --enable-swap
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     "Latest Source Package \\(version (\\d+(?:\\.\\d+)*)\\)"
