# -*- coding: utf-8; mode: tcl; tab-width: 4; truncate-lines: t; 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

set _name           bottle
set _n              [string index ${_name} 0]

name                py-${_name}
version             0.12.17

categories-append   devel
license             MIT
maintainers         nomaintainer

description         Fast, simple and lightweight WSGI micro web-framework for python
long_description    Bottle is a fast, simple and lightweight WSGI micro web-framework \
                    with no dependencies other than the Python Standard Library. It \
                    supports routing, templates and has a built-in HTTP development server. \
                    It supports paste, fapws3, bjoern, Google App Engine, cheerypy or \
                    any other WSGI capable HTTP server

platforms           darwin
supported_archs     noarch

homepage            http://bottlepy.org/
master_sites        pypi:${_n}/${_name}/
distname            ${_name}-${version}

python.versions     27 37

checksums           rmd160  54922ff4be3b2964f0e67234d49cb7c8085335f4 \
                    sha256  e9eaa412a60cc3d42ceb42f58d15864d9ed1b92e9d630b8130c871c5bb16107c \
                    size    72283

# https://github.com/bottlepy/bottle/pull/795
patchfiles-append   patch-fix-tests.diff

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

    test.run        yes
    test.cmd        python${python.branch}
    test.target     test/testall.py

    livecheck.type  none
} else {
    livecheck.url   https://pypi.python.org/pypi/${_name}/json
    livecheck.regex "\"${_name}-(\[.\\d\]+)\\${extract.suffix}\""
}

foreach {old new} {34 37 35 37 36 37} {
    subport py${old}-${python.rootname} "
        replaced_by py${new}-${python.rootname}
        PortGroup obsolete 1.0
    "
}