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

name                unicodeconverter-java
version             2.1
categories          java textproc
maintainers         nomaintainer
license             GPL-2

description         Convert various encodings to UTF-8
long_description \
    UnicodeConverter is a Java program that converts text and HTML files in \
    VNI, VISCII, VPS, TCVN, or VIQR/Vietnet format to Unicode UTF-8. The \
    program, executable in both graphic user interface (GUI) and command-line \
    modes, is capable of converting multiple files in a directory, or an \
    entire directory, including its subdirectories. In effect, this enhanced \
    capability enables conversion of an entire website to Unicode UTF-8 \
    format with one single command or a few mouse clicks.

platforms           any
supported_archs     noarch

homepage            https://unicodeconvert.sourceforge.net
master_sites        sourceforge:unicodeconvert
distname            UnicodeConverter-${version}
use_zip             yes

livecheck.name      unicodeconvert
livecheck.distname  UnicodeConverter

worksrcdir          UnicodeConverter

checksums           rmd160  9db45eda96796332cf588e1d93985bf7561fedb7 \
                    sha256  ff99ea3c9071ba8dc3182e5db5b04bbda1819225189135b11f00358c6191d904 \
                    size    278610

java.version        1.6+
java.fallback       openjdk11

post-patch {
    reinplace "s|^PROGDIR=.*|PROGDIR=\"${prefix}/share/java\"|" \
        ${worksrcpath}/Uni
}

use_configure       no

build               {}

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/java \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -W ${worksrcpath} Uni ${destroot}${prefix}/bin
    xinstall -m 644 -W ${worksrcpath} UnicodeConverter.jar ${destroot}${prefix}/share/java
    xinstall -m 644 -W ${worksrcpath} readme.html versionchanges.html \
        ${destroot}${prefix}/share/doc/${name}
}
