# -*- 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                tomcat-native-2
version             2.0.15
revision            0
categories          java www
maintainers         nomaintainer
license             Apache-2

description         Tomcat 9+ HTTP Server native library support version 2.
long_description    This port provides access to native apr and other \
                    functions utilized by tomcat.

homepage            https://tomcat.apache.org/
master_sites        apache:tomcat/tomcat-connectors/native/${version}/source/

checksums           rmd160  d5bbfa344da8d51277c7bfd5af2b782e9481c714 \
                    sha256  8dab09f21ad519c9e49e5287f8d8de89bb176a5e3968479f27948c31b2a3b6b4 \
                    size    476797

distname            tomcat-native-${version}-src
worksrcdir          ${distname}/native

depends_lib         port:apr \
                    port:openssl

# java Portgroup settings
java.version        11+
java.fallback       openjdk11

configure.args      --with-apr=${prefix} \
                    --with-ssl=${prefix}

build.args          EXTRA_LDFLAGS="-shrext .jnilib"

notes "
To integrate this into tomcat, add -Djava.library.path=${prefix} to the tomcat options or\
to CATALINA_OPTS.

Make sure the AprLifecycleListener is enabled in your server.xml like so:
    <Listener className=\"org.apache.catalina.core.AprLifecycleListener\" />

For further information please see https://tomcat.apache.org/native-doc/index.html
"

livecheck.type      regex
livecheck.url       https://archive.apache.org/dist/tomcat/tomcat-connectors/native/
livecheck.regex     {(\d+\.\d+\.\d+)/}
