# -*- 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-country
python.rootname     pycountry
version             20.7.3
revision            0

platforms           darwin
supported_archs     noarch
license             LGPL-2.1
maintainers         nomaintainer

description         ISO country, subdivision, language, currency and script definitions and their translations
long_description    {*}${description}.

homepage            https://github.com/flyingcircusio/pycountry

checksums           rmd160  945eb071b7769061343ed9f43b5388452ed457a5 \
                    sha256  81084a53d3454344c0292deebc20fcd0a1488c136d4900312cbd465cf552cb42 \
                    size    10137217

python.versions     27 35 36 37 38

if {${name} ne ${subport}} {
    if {${python.version} == 27} {
        version     18.12.8
        revision    0
        distname    ${python.rootname}-${version}
        checksums   rmd160  1aef86ce0594ec4f5b5f87cc56cf6c9e8c2be171 \
                    sha256  8ec4020b2b15cd410893d573820d42ee12fe50365332e58c0975c953b60a16de \
                    size    10026953
    }

    depends_build-append    port:py${python.version}-setuptools
    depends_test-append     port:py${python.version}-pytest

    test.run                yes
    test.cmd                py.test-${python.branch}
    test.env                PYTHONPATH=${worksrcpath}/build/lib
    test.args               -o addopts=''
    test.target

    post-destroot {
        xinstall -d ${destroot}${prefix}/share/doc/${subport}
        xinstall -m 0644 -W ${worksrcpath} TODO.txt LICENSE.txt \
            HISTORY.txt ${destroot}${prefix}/share/doc/${subport}

        if {${python.version} == 27} {
            xinstall -m 0644 -W ${worksrcpath} README \
                ${destroot}${prefix}/share/doc/${subport}
        } else {
            xinstall -m 0644 -W ${worksrcpath} README.rst \
                ${destroot}${prefix}/share/doc/${subport}
        }
    }

    livecheck.type      none
}

livecheck.type      pypi
