# -*- 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 92897 2012-05-10 13:50:38Z stromnov@macports.org $

PortSystem          1.0

name                kyotocabinet
version             1.2.75
revision            0
categories          databases
license             GPL
platforms           darwin

maintainers         stromnov openmaintainer

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

long_description    \
    Kyoto 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.  Each key must be unique within a database.   There is \
    neither concept of data tables nor data types.

homepage            http://fallabs.com/${name}/
master_sites        http://fallabs.com/${name}/pkg/

checksums           rmd160  b04a07cfa070727d91b8568b5ece46bb37c38981 \
                    sha256  66c2d8c2b3ba269b4c33114974226de114047121d67cc4f749307e210e89597b

dist_subdir         ${name}/${version}_${revision}

patchfiles          patch-configure.diff

depends_lib         port:zlib

# 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

if {${configure.compiler} == "clang"} {
    configure.compiler llvm-gcc-4.2
}

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

universal_variant   no

test.run            yes
test.target         check

variant debug conflicts devel profile description {build for debugging} {
    configure.args-append   --enable-debug
}

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

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

variant lzo description {build with LZO compression} {
    configure.args-delete   --disable-lzo
    configure.args-append   --enable-lzo
    depends_lib-append      port:lzo2
}

variant lzma description {build with LZMA compression} {
    configure.args-delete   --disable-lzma
    configure.args-append   --enable-lzma
    depends_lib-append      port:liblzma
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
