# -*- 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

set _name           http-parser
set _n              [string index ${_name} 0]

name                py-${_name}
version             0.8.3
categories          python www
license             MIT PSF
platforms           darwin
maintainers         {petr @petrrr} openmaintainer

description         HTTP request/response parser

long_description    HTTP request/response parser for Python. If possible a \
                    C parser based on http-parser from Ryan Dahl will be used.

homepage            https://github.com/benoitc/http-parser

master_sites        pypi:${_n}/${_name}/
distname            ${_name}-${version}

checksums           md5 751967e2785c829dffebdc9a511e0eec \
                    sha1 de2509e6b62d6beb191e0953d3b098ffac27fedd \
                    rmd160 5953b6a238917e14b1bf6c1e4f995fbac03463b5

python.versions     27 34 35 36

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

    # Adding documentation and examples
    post-destroot {
        set dest_doc ${destroot}${prefix}/share/doc/${subport}
        xinstall -d  ${dest_doc}
        xinstall -m 755 -W ${worksrcpath} \
            README.rst \
            LICENSE \
            NOTICE \
            THANKS \
                ${dest_doc}

        delete ${dest_doc}/examples
        copy ${worksrcpath}/examples ${dest_doc}/examples
    }

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