# -*- 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-cherrypy
python.rootname     CherryPy
version             18.3.0
revision            0
categories-append   www
platforms           darwin
supported_archs     noarch
license             BSD

maintainers         {gmail.com:freespace @freespace} \
                    openmaintainer

description         Object-Oriented HTTP framework
long_description    CherryPy is a pythonic, object-oriented web \
                    development framework. CherryPy allows developers \
                    to build web applications in much the same way \
                    they would build any other object-oriented Python \
                    program. This usually results in smaller source \
                    code developed in less time.

homepage            https://www.cherrypy.org/

distname            CherryPy-${version}
master_sites        pypi:[string index ${python.rootname} 0]/${python.rootname}

checksums           rmd160  71b02055af4fda92b928977643525db456591ed5 \
                    sha256  683e687e7c7b1ba31ef86a113b1eafd0407269fed175bf488d3c839d37d1cc60 \
                    size    685192

python.versions     27 35 36 37 38

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

    depends_lib-append      port:py${python.version}-cheroot \
                            port:py${python.version}-contextlib2 \
                            port:py${python.version}-more-itertools \
                            port:py${python.version}-portend \
                            port:py${python.version}-setuptools \
                            port:py${python.version}-zc-lockfile

    if {${python.version} eq 27} {
        # Last version that will support python 2.7
        version             17.4.2
        revision            0
        # Need to set distname again for some reason
        distname            CherryPy-${version}

        checksums           rmd160  67837d0f745052f156843df9fa48b75c4cf449a4 \
                            sha256  ef1619ad161f526745d4f0e4e517753d9d985814f1280e330661333d2ba05cdf \
                            size    684366

        depends_lib-append  port:py${python.version}-six
    }

    post-destroot {
        xinstall -m 644 -W ${worksrcpath} \
            CHANGES.rst README.rst \
            ${destroot}${prefix}/share/doc/${subport}
        move ${destroot}${python.pkgd}/cherrypy/tutorial \
            ${destroot}${prefix}/share/doc/${subport}
    }

    livecheck.type  none
}
