# -*- 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
PortGroup           github 1.0

github.setup        maxmind libmaxminddb 1.9.1
revision            0
checksums           rmd160  a08bd3e8381316f2f6bd44517361da269e49cba5 \
                    sha256  a80682a89d915fdf60b35d316232fb04ebf36fff27fda9bd39fe8a38d3cd3f12 \
                    size    612652

categories          devel net
license             Apache-2
maintainers         nomaintainer

description         The libmaxminddb library provides a C library for reading \
                    MaxMind DB files, including the GeoIP2 databases from MaxMind.

long_description    {*}${description} This is a custom binary format designed to facilitate \
                    fast lookups of IP addresses while allowing for great flexibility \
                    in the type of data associated with an address.\n\n\The \
                    MaxMind DB format is an open format. The spec is available at \
                    http://maxmind.github.io/MaxMind-DB/. This spec is licensed under the \
                    Creative Commons Attribution-ShareAlike 3.0 Unported License.\n\n\See \
                    http://dev.maxmind.com/ for more details about MaxMind's \
                    GeoIP2 products.\n

homepage            https://maxmind.github.io/libmaxminddb/
github.tarball_from releases

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool

# For the t/libtap subdirectory.
build.env-append    CC=${configure.cc} \
                    "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"

test.run            yes
test.target         check

post-destroot {
    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}/doc
    xinstall -m 0644 -W ${worksrcpath} AUTHORS Changes.md \
        LICENSE NOTICE README.md ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 -W ${worksrcpath}/doc libmaxminddb.md mmdblookup.md \
        ${destroot}${prefix}/share/doc/${name}/doc
}
