# -*- 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.13
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  0d476c8b81c3db77f11c6df1251e123467a6b637 \
                    sha256  4f002c493c5020279acaa761a989964ba56954793a5c0718bc70969c8bb11dd5 \
                    size    474267

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+)/}
