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

name                py-${_name}
version             3.5
categories-append   net
platforms           darwin
supported_archs     noarch
license             MIT
maintainers         {petr @petrrr} openmaintainer

description         Python packages for accessing the CKAN Action API

long_description    A command line interface and Python module for accessing \
                    the CKAN Action API

homepage            https://github.com/ckan/ckanapi

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

checksums           md5     2ab2508df730b0e7d84e13be74adc314 \
                    rmd160  98f6682c1ef512d3120833e0e7087ec26500ce44 \
                    sha256  47009c49cce783595c8c7bd089a7205b1b3c55d250eb049229a655fb07ca69ac

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}-docopt \
                            port:py${python.version}-requests

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