# -*- 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           OWSLib
set _n              [string index ${_name} 0]

name                py-owslib
version             0.16.0
revision            1
categories-append   gis science net
platforms           darwin
supported_archs     noarch
license             BSD
maintainers         {petr @petrrr} openmaintainer

description         OGC Web Service utility library
long_description    \
    OWSLib is a Python package for client programming with Open Geospatial \
    Consortium (OGC) web service (hence OWS) interface standards, and their \
    related content models. OWSLib provides a common API for accessing \
    service metadata and wrappers for numerous OGC Web Service interfaces.

homepage            https://pypi.python.org/pypi/${_name}
master_sites        pypi:${_n}/${_name}/
distname            ${_name}-${version}

checksums           md5     7ff9c9edde95eadeb27ea8d8fbd1a2cf \
                    rmd160  0c15e4a82ddf8b001c39937231da3145820434e4 \
                    sha256  ec95a5e93c145a5d84b0074b9ea27570943486552a669151140debf08a100554

python.versions     27 34 35 36

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

    depends_lib-append      port:py${python.version}-dateutil \
                            port:py${python.version}-pyproj \
                            port:py${python.version}-tz \
                            port:py${python.version}-requests

    # Adding documentation and examples
    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d  ${dest_doc}
        xinstall -m 755 -W ${worksrcpath} \
            CHANGES.txt \
            CREDITS.txt \
            FAQ.txt \
            HISTORY.txt \
            INSTALL.txt \
            LICENSE.txt \
            README.txt \
                ${dest_doc}
    }

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