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

name                    commons-lang3
version                 3.21.0
revision                0

categories              java
license                 Apache-2
platforms               any
supported_archs         noarch
homepage                https://commons.apache.org/proper/commons-lang
maintainers             nomaintainer

description             Apache Commons Lang
long_description        The Lang Component provides a host of helper utilities \
                        for the java.lang API, notably String manipulation \
                        methods, basic numerical methods, object reflection, \
                        creation and serialization, and System properties. \
                        Additionally it contains an inheritable enum type, an \
                        exception structure that supports multiple types of \
                        nested-Exceptions, basic enhancements to \
                        java.util.Date and a series of utlities dedicated to \
                        help with building methods, such as hashCode, toString \
                        and equals.

java.version            1.8+

master_sites            apache:commons/lang/source/
distname                ${name}-${version}-src

checksums               rmd160  53a112520b6d7e3ab4f42d0bd9f79beaa509aaa8 \
                        sha256  fa013d1a23e95d248fdb86f19c3817bb3e5aa39c5255e3c5ce1cc70c8576aa67 \
                        size    1505249

build.args-append       --define=maven.javadoc.skip \
                        --define=maven.source.skip

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

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

    xinstall -d ${destdocdir}
    xinstall -W ${worksrcpath} -m 644 \
        CONTRIBUTING.md \
        LICENSE.txt \
        NOTICE.txt \
        README.md \
        RELEASE-NOTES.txt \
        ${destdocdir}

    if {[variant_isset doc]} {
        copy ${worksrcpath}/target/reports/apidocs ${destdocdir}/javadoc
    }
}

variant doc \
        description {Install javadoc} {
    build.args-delete   --define=maven.javadoc.skip
}

livecheck.type          regex
livecheck.url           https://commons.apache.org/proper/commons-lang/download_lang.cgi
livecheck.regex         "${name}-(\[0-9]+(\\.\[0-9]+)*)-src\\.tar\\.gz"
