# -*- 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                xalanj
version             2.7.1

categories          java textproc
license             Apache-2 W3C
maintainers         nomaintainer
platforms           any
supported_archs     noarch

description         Apache Xerces 2 Java XML Parser
long_description    Xalan-Java is an XSLT processor for transforming XML documents \
                    into HTML, text, or other XML document types. It implements \
                    XSL Transformations (XSLT) Version 1.0 and  XML Path Language \
                    (XPath) Version 1.0. It can be used from the command line, \
                    in an applet or a servlet, or as a module in other program.
homepage            https://xml.apache.org/xalan-j/

set ver2            [string map ". _" $version]
distname            xalan-j_${ver2}-src
master_sites        apache:xml/xalan-j/source/

checksums           rmd160  021c239122b6b3d0bc9781abd9675c7cb5951b13 \
                    sha256  fa52aa629bb882335d45d67401d270c3f21b5131aaea005ac0d4590f2ce8b043 \
                    size    6284437

depends_build       bin:ant:apache-ant
depends_run         port:xercesj

java.version        1.3.1+
java.fallback       openjdk11

worksrcdir          xalan-j_${ver2}

patchfiles          remove-bootclasspath.diff \
                    build.xml.diff

use_configure       no

build.cmd           ant
build.target        jar

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

    xinstall -d ${destjavadir}
    xinstall -m 644 \
        ${worksrcpath}/build/xalan.jar \
        ${worksrcpath}/build/serializer.jar \
        ${destjavadir}

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

livecheck.type      regex
livecheck.url       ${homepage}whatsnew.html
livecheck.regex     {Version (\d+(?:\.\d+)*)}
