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

name                py-geoip
version             1.3.2
revision            0

categories-append   net
license             LGPL-2.1+
platforms           darwin
maintainers         nomaintainer

description         Python module for accessing the GeoIP C library
long_description    ${description}

homepage            https://dev.maxmind.com/geoip/legacy/downloadable/
master_sites        pypi:g/geoip
distname            GeoIP-${version}

checksums           rmd160  f5cf7a7f767d748827f432ab892bfa0b4d1272f4 \
                    sha256  a890da6a21574050692198f14b07aa4268a01371278dfc24f71cd9bc87ebf0e6 \
                    size    20127

python.versions     27 35 36 37 38 39

if {${name} ne ${subport}} {
    depends_lib-append  port:libgeoip

    post-destroot   {
        xinstall -m 644 -W ${worksrcpath} LICENSE README.rst \
            ${destroot}${prefix}/share/doc/${subport}
        foreach f [glob -type f -dir ${worksrcpath}/examples *] {
            reinplace "s+/usr/bin/python$+/usr/bin/env python${python.branch}+g" ${f}
            reinplace "s+/usr/local+${prefix}+g" ${f}
            xinstall -m 755 ${f} ${destroot}${prefix}/share/doc/${subport}/examples
        }
    }
    livecheck.type  none
}
