# -*- 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
version             1.3.1
revision            0
categories          java www
maintainers         {thebishops.org:matt @mattbishop} openmaintainer
license             Apache-2

description         Tomcat 7+ HTTP Server native library support.
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  34aedc26eb546d663d687eb42c1f4ab95922bd8b \
                    sha256  dd7f4c8a9dbc2391a2aeb6068e42dfce5c912bf3cdcb262892b3dfc188f565f5 \
                    size    346588

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

depends_lib         port:apr \
                    path:lib/libssl.dylib:openssl

# java Portgroup settings
java.version        1.7+
java.fallback       openjdk8

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.

You then need to configure a Connector in server.xml with the appropriate apr protocol class for your use,\
for instance:
    protocol=\"org.apache.coyote.http11.Http11AprProtocol\",
    protocol=\"org.apache.coyote.ajp.AjpAprProtocol\"

As in:
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8081 using apr -->
    <Connector port=\"8081\" maxHttpHeaderSize=\"8192\"
               maxThreads=\"150\" minSpareThreads=\"25\" maxSpareThreads=\"75\"
               enableLookups=\"false\" redirectPort=\"8443\" acceptCount=\"100\"
               connectionTimeout=\"20000\" disableUploadTimeout=\"true\"
               protocol=\"org.apache.coyote.http11.Http11AprProtocol\" />

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