# -*- 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
# $Id: Portfile 117271 2014-02-21 02:55:07Z jmr@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-backports-ssl_match_hostname
version             3.4.0.2
revision            0
categories-append   devel
platforms           darwin
license             PSF
supported_archs     noarch

python.versions     27 33

maintainers         stromnov openmaintainer

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

homepage            http://bitbucket.org/brandon/backports.ssl_match_hostname
master_sites        https://pypi.python.org/packages/source/b/backports.ssl_match_hostname/

distname            backports.ssl_match_hostname-${version}

checksums           rmd160  4f87ff790bdd53b4095ffc4b9e214d4ffc9bb41d \
                    sha256  07410e7fb09aab7bdaf5e618de66c3dac84e2e3d628352814dc4c37de321d6ae

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