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

python.versions     27 310 311 312 313

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  ca9c19f7df577ac39b78ff510c8b57e626d2e411 \
                    sha256  b629cc8ae916e3afbd36d1b3d093f34193d851e11998920fdcfc4552218b7b70 \
                    size    51273

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
}
