# -*- 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-dispatcher
set real_name       PyDispatcher
version             2.0.5
categories-append   devel
license             BSD
platforms           darwin
supported_archs     noarch
maintainers         dh openmaintainer
description         python dispatcher mechanism for creating event models
long_description    PyDispatcher provides the Python programmer with a \
                    multiple-producer-multiple-consumer \
                    signal-registration and routing infrastructure for use \
                    in multiple contexts.

homepage            https://pypi.python.org/pypi/${real_name}
master_sites        pypi:P/${real_name}

distname            ${real_name}-${version}

checksums           rmd160  1b74f1ee498bd4b2806076994a8d543d58bd6734 \
                    sha256  5570069e1b1769af1fe481de6dd1d3a388492acddd2cdad7a3bde145615d5caf

python.versions     27 34 35 36

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

    test.run            yes
    test.cmd            ${python.bin} tests/test_dispatcher.py && ${python.bin} tests/test_robustapply.py && ${python.bin} tests/test_saferef.py
    test.env            PYTHONPATH=${worksrcpath}/build/lib
    test.target

    post-destroot   {
        file delete -force ${destroot}${prefix}/share/doc/${subport}
        file copy ${worksrcpath}/docs ${destroot}${prefix}/share/doc/${subport}
    }
    livecheck.type      none
} else {
    livecheck.type      regex
    livecheck.url       https://pypi.python.org/pypi/${real_name}/json
    livecheck.regex     ${real_name}-(\[0-9\.\]+)${extract.suffix}
}