# -*- 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
PortGroup           select 1.0

set realname        html2text
name                py-${realname}
version             2018.1.9

categories-append   textproc
platforms           darwin
license             GPL-3+
supported_archs     noarch
maintainers         {khindenburg @kurthindenburg} openmaintainer

description         Script to turn HTML into equivalent Markdown-structured text.
long_description \
    html2text is a Python script that converts a page of HTML into clean, \
    easy-to-read plain ASCII text. Better yet, that ASCII also happens to be \
    valid Markdown (a text-to-HTML format).

homepage            https://pypi.python.org/pypi/${realname}
master_sites        pypi:[string index ${realname} 0]/${realname}/
distname            ${realname}-${version}

checksums           rmd160  fc0d10a31cd78d1ca34d8de1a4d12e503acecae6 \
                    sha256  627514fb30e7566b37be6900df26c2c78a030cc9e6211bda604d8181233bcdd4 \
                    size    52211

python.versions     27 34 35 36 37

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

    depends_run-append  port:py-html2text_select

    select.group        py-html2text
    select.file         ${filespath}/py${python.version}-html2text

    test.run            yes
    test.env            PYTHONPATH=${worksrcpath}/build/lib

    livecheck.type  none

    notes "
To make the Python ${python.branch} version of py-html2text the one that is run\
when you execute the commands without a version suffix, e.g. 'html2text', run:

port select --set ${select.group} [file tail ${select.file}]
"
} else {
    livecheck.type  pypi
}