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

name                jtidy
github.setup        ${name} ${name} 1.0.5 ${name}-
github.tarball_from archive

categories          java devel textproc
# Looks equivalent to zlib license but uses different wording
license             Permissive
platforms           any
supported_archs     noarch
maintainers         nomaintainer
description         Java library for syntax checking and pretty printing HTML
long_description    jtidy is a Java port of HTML Tidy, a HTML syntax \
                    checker and pretty printer. Like its non-Java cousin, \
                    jtidy can be used as a tool for cleaning up malformed \
                    and faulty HTML. In addition, jtidy provides a DOM \
                    interface to the document that is being processed, \
                    which effectively makes you able to use jtidy as a DOM \
                    parser for real-world HTML.

homepage            https://jtidy.sourceforge.net/
checksums           rmd160  d650722022af74f79ef60b1129d61f290ca190de \
                    sha256  6a7447f1f91fe5e27bc3e1cbd2c86fb06d6a4762202e43275bd74292de865edb \
                    size    685248

java.version        1.8+
java.fallback       openjdk11

destroot {
    set destbindir  ${destroot}${prefix}/bin
    set destdocdir  ${destroot}${prefix}/share/doc/${name}
    set destjavadir ${destroot}${prefix}/share/java

    xinstall -d ${destjavadir}
    xinstall -m 644 \
        ${worksrcpath}/target/${name}-${version}.jar \
        ${destjavadir}/${name}.jar

    xinstall -d ${destdocdir}
    xinstall -m 644 \
        ${worksrcpath}/LICENSE.txt \
        ${worksrcpath}/README.md \
        ${destdocdir}

    xinstall -d ${destbindir}
    xinstall ${filespath}/${name} ${destbindir}
    reinplace "s|@@PREFIX@@|${prefix}|g" ${destbindir}/${name}
}
