# -*- 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

PortSystem          1.0

name                tokyocabinet
version             1.4.48
revision            0
categories          databases
license             LGPL
platforms           darwin

maintainers         nomaintainer

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           rmd160  8fb3c2f2e424a2135cb021d46905a783a1032a7b \
                    sha256  a003f47c39a91e22d76bc4fe68b9b3de0f38851b160bbb1ca07a4f6441de1f90

patchfiles          patch-configure.diff \
                    patch-tokyocabinet-no-static.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

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-swab
}

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