PortSystem 1.0
PortGroup java 1.0

name                commons-logging
version             1.2

categories          java
license             Apache-2
maintainers         nomaintainer
platforms           darwin

description         Apache Commons-Logging
long_description    Commons-Logging is a wrapper around a variety of \
                    logging API implementations.
homepage            https://commons.apache.org/logging/

distname            ${name}-${version}-src
master_sites        apache:commons/logging/source/
checksums           rmd160  ff628c8de57f7da8572de3554196ee033e255312 \
                    sha256  49665da5a60d033e6dff40fe0a7f9173e886ae859ce6096c1afe34c48b677c81 \
                    size    188536

# This port would normally be compatible with Java 1.2+,
# but because it doesn't build with JDK 9 or higher,
# and there is currently no way to specify a maximum JDK version
# for the Java portgroup, force JDK 8 to be used.
#java.version       1.2+
java.version        1.8
java.fallback       openjdk8

depends_build       bin:ant:apache-ant \
                    port:junit
depends_lib         port:jakarta-log4j \
                    port:servlet23-api

use_configure       no

build.cmd           ant
build.target        all
build.args          -lib ${prefix}/share/java/junit.jar \
                    -Dcomponent.version=${version} \
                    -Dlog4j12.jar=${prefix}/share/java/jakarta-log4j.jar \
                    -Dlogkit.jar=NONE \
                    -Davalon-framework.jar=NONE \
                    -Dservletapi.jar=${prefix}/share/java/servlet23-api.jar

destroot    {
    xinstall -m 755 -d ${destroot}${prefix}/share/java \
        ${destroot}${prefix}/share/doc
    xinstall -m 644 ${worksrcpath}/target/commons-logging-${version}.jar \
        ${destroot}${prefix}/share/java/commons-logging.jar
    xinstall -m 644 ${worksrcpath}/target/commons-logging-api-${version}.jar \
        ${destroot}${prefix}/share/java/commons-logging-api.jar
}

livecheck.type  regex
livecheck.url   https://commons.apache.org/proper/commons-logging/download_logging.cgi
livecheck.regex "${name}-(\\d+\\.\\d+(\\.\\d+)?)-src.tar.gz"
