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

set _name           geojson
set _n              [string index ${_name} 0]

name                py-${_name}
version             1.3.1
categories-append   gis
platforms           darwin
supported_archs     noarch
license             BSD

maintainers         {petr @petrrr} openmaintainer

description         Python bindings and utilities for GeoJSON

long_description    \
    This library implements all the GeoJSON objects described in The GeoJSON \
    Format Specification. It provides functions encoding and decoding GeoJSON \
    formatted data and is an implementation of the Python __geo_interface__ \
    Specification.

homepage            https://github.com/frewsxcv/python-geojson

distname            ${_name}-${version}
master_sites        pypi:${_n}/${_name}/

checksums           md5     2131dfaf4546db43f64d9c98d443b48c \
                    rmd160  e7a6622856f9418bced6ef0602e90a7d7a819ae2 \
                    sha256  72541ca29b4b6bf93deb61b4719499c3c346f1a82c1c3edb31c6ae2fde1dec8e

python.versions     27 34 35 36

if {${name} ne ${subport}} {
    depends_build-append    port:py${python.version}-setuptools

    test.run        yes
    if {${test.run}} {
        depends_build-append    port:py${python.version}-nose \
                                port:py${python.version}-coverage
    }

    # Adding documents
    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d  ${dest_doc}
        xinstall -m 755 -W ${worksrcpath} \
            CHANGELOG.rst \
            LICENSE.rst \
            README.rst \
                ${dest_doc}
    }

    livecheck.type  none
} else {
    livecheck.type  regex
    livecheck.url   https://pypi.python.org/pypi/${_name}/json
    livecheck.regex "\"${_name}-(\[.\\d\]+)\\${extract.suffix}\""
}