# -*- 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 119970 2014-05-12 10:28:43Z stromnov@macports.org $

PortSystem          1.0
PortGroup           python 1.0

name                py-tornado
version             3.2.1
revision            0
categories-append   www
platforms           darwin
license             Apache-2

python.versions     26 27 32 33 34

maintainers         stromnov openmaintainer

description         Scalable, non-blocking web server and related tools

long_description    \
    Tornado is an open source version of the scalable, non-blocking web server \
    and tools that power FriendFeed. The FriendFeed application is written \
    using a web framework that looks a bit like web.py or Google's webapp, \
    but with additional tools and optimizations to take advantage of the \
    underlying non-blocking infrastructure.

homepage            http://www.tornadoweb.org/
master_sites        http://pypi.python.org/packages/source/t/tornado/

distname            tornado-${version}

checksums           rmd160  81016e74a17ee2aea40432128569693ced17b616 \
                    sha256  4a5f0b1b381d80ec320c7c8f3265e6008afc527cc35b6c36d03acf18c21fcac6

if {${name} ne ${subport} && [lsearch {26 32} ${python.version}] != -1} {
    version             3.1.1
    revision            0
    distname            tornado-${version}
    checksums           rmd160  36598ca25dcb47b6c27316f44cae3cea9b649136 \
                        sha256  345904bfe4a0ce5d687203f783986a73cfd7dc3a9957ee3342cd43d4e310fdc6
}

if {${name} ne ${subport}} {
    if {${python.version} == 27} {
        depends_lib-append  port:py${python.version}-backports-ssl_match_hostname
    }

    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       ${master_sites}
    livecheck.regex     "tornado-(\\d+(?:\\.\\d+)*)${extract.suffix}"
}
