# -*- 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.13.3
revision            0
checksums           rmd160  2124b722d2bc4da293141fdbdf7d21e9788b179b \
                    sha256  a66502ea76eadbe17f2cd6fd708946777253972d2ae8157dee1b23a2fb528171 \
                    size    795830

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
}
