# -*- 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 base_name       isodate
name                py-$base_name
version             0.6.0
python.versions     27 35 36 37 38 39

license             BSD
platforms           darwin
maintainers         {gmail.com:esafak @esafak}

description         An ISO 8601 date/time/duration parser and formatter
long_description    This module implements ISO 8601 date, time and duration \
                    parsing. The implementation follows ISO8601:2004 standard, \
                    and implements only date/time representations mentioned in \
                    the standard. If something is not mentioned there, then it \
                    is treated as non existent, and not as an allowed option.

homepage            https://pypi.python.org/pypi/$base_name
master_sites        pypi:i/$base_name

checksums           rmd160  caa3c15705b67d1e8fbcc18536643818affbb306 \
                    sha256  2e364a3d5759479cdb2d37cce6b9376ea504db2ff90252a2e5b7cc89cc9ff2d8 \
                    size    28480

distname            $base_name-${version}

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

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

# silence warnings for py37 py38
# https://github.com/gweis/isodate/pull/60
    patchfiles      patch-avoid-unclosed-file-warning.diff \
                    patch-fix-py38-deprecationwarning.diff

    test.run        yes
    test.cmd        ${python.bin} setup.py test
    test.target

    post-destroot {
        xinstall -m 644 -W ${worksrcpath} CHANGES.txt MANIFEST.in \
            README.rst TODO.txt ${destroot}${prefix}/share/doc/${subport}
    }

    livecheck.type  none
} else {
    livecheck.type  regex
    livecheck.url   ${homepage}
    livecheck.regex $base_name (\\d+(\\.\\d+)+)
}
