# -*- 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-backports-ssl_match_hostname
version             3.7.0.1
revision            0
categories-append   devel
platforms           darwin
license             PSF
supported_archs     noarch

# do not add subports for python > 3.4
python.versions     27

maintainers         {stromnov @stromnov} openmaintainer

description         The ssl.match_hostname() function from Python 3.7
long_description    ${description}

homepage            http://bitbucket.org/brandon/backports.ssl_match_hostname
master_sites        pypi:b/backports.ssl_match_hostname

distname            backports.ssl_match_hostname-${version}

checksums           rmd160  14e41e297c9560077ea2b5fcfc632345024aa7ea \
                    sha256  bb82e60f9fbf4c080eabd957c39f0641f0fc247d9a16e31e26d594d8f42b9fd2 \
                    size    5722

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

    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
} else {
    livecheck.regex     {backports\.ssl_match_hostname-(\d+(?:\.\d+)*)\.[tz]}
}