# -*- 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-configparser
epoch               1
version             6.0.1
revision            0
categories-append   devel
license             MIT
supported_archs     noarch
platforms           {darwin any}

python.versions     27 39 310 311 312

maintainers         {stromnov @stromnov} openmaintainer

description         Configparser from Python 3.8 to Python 2.6-3.7
long_description    {*}${description}

homepage            https://github.com/jaraco/configparser

checksums           rmd160  e4b8b957d56c40619afe387f3e7d1589038ca6cb \
                    sha256  db45513e971e509496b150be31bd67b0e14ab20b78a383b677e4b158e2c682d8 \
                    size    68618

if {${name} ne ${subport}} {

    # 4.0.2 is the last py27-compatible version
    if {${python.version} == 27} {
        python.pep517       no

        version             4.0.2

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

        depends_lib-append  port:py${python.version}-backports

        distname            ${python.rootname}-${version}

        checksums           rmd160  9b6a5b12490e72c47ce2b1d190a35687c2d2c7eb \
                            sha256  c7d282687a5308319bf3d2e7706e575c635b0a470342641c93bea0ea3b5331df \
                            size    72498
    } else {
        depends_build-append \
                            port:py${python.version}-toml
    }

    depends_build-append \
                        port:py${python.version}-setuptools_scm

    post-destroot {
        foreach f {__init__.py __init__.pyc __init__.pyo __pycache__} {
            set fp "${destroot}${python.pkgd}/backports/$f"
            if {[file exists ${fp}]} {
                file delete -force ${fp}
            }
        }
    }

    livecheck.type      none
}