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

github.setup            qos-ch slf4j 2.0.20 v_
github.tarball_from     archive
github.livecheck.regex  {([0-9.]+)}

categories              java
license                 MIT
platforms               any
supported_archs         noarch
homepage                https://www.slf4j.org
maintainers             {sethm.id.au:dev @McDaMastR} \
                        openmaintainer

description             Simple Logging Facade for Java (SLF4J)
long_description        The Simple Logging Facade for Java or (SLF4J) is \
                        intended to serve as a simple facade for various \
                        logging APIs allowing to the end-user to plug in the \
                        desired implementation at deployment time.  SLF4J also \
                        supports a bridging legacy APIs as well as a source \
                        code migration tool.  SLF4J API offers an advanced \
                        abstraction of various logging systems, including JDK \
                        1.4 logging, log4j and logback.  Features include \
                        parameterized logging and MDC support.

checksums               rmd160  e3cb0600b29862d58af63d717be4d9df8c0678b7 \
                        sha256  843a728aace3c454e08bb1574c470a06551256e6f0389ced7bc520740d9667e9 \
                        size    386595

# Building requires Java >= 9
# Running requires Java >= 8
java.version            9+

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

    set modules {
        jcl-over-slf4j
        jul-to-slf4j
        log4j-over-slf4j
        osgi-over-slf4j
        slf4j-api
        slf4j-ext
        slf4j-jdk-platform-logging
        slf4j-jdk14
        slf4j-migrator
        slf4j-nop
        slf4j-reload4j
        slf4j-simple
    }

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

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

    if {[variant_isset doc]} {
        xinstall -d ${destdocdir}/javadoc
        foreach module ${modules} {
            copy \
                ${worksrcpath}/${module}/target/site/apidocs \
                ${destdocdir}/javadoc/${module}
        }
    }
}

variant doc \
        description {Install javadoc} {
    build.target-append javadoc:javadoc
}
