# -*- 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           legacysupport 1.1
PortGroup           makefile 1.0

# Missing compatibility implementation of memmem.
# https://github.com/yrutschle/sslh/issues/278
legacysupport.newest_darwin_requires_legacy 10

name                sslh
epoch               1
version             2.2.4
revision            0
categories          net security www
platforms           darwin
maintainers         {amake @amake} openmaintainer
license             GPL-2+

description         ssl/ssh multiplexer

long_description    sslh lets one accept both HTTPS and SSH connections \
                    on the same port. It makes it possible to connect \
                    to an SSH server on port 443 (e.g. from inside a \
                    corporate firewall) while still serving HTTPS on \
                    that port.

homepage            https://rutschle.net/tech/sslh/README.html
master_sites        https://rutschle.net/tech/sslh/

distname            ${name}-v${version}

checksums           rmd160  8a2bab137d44a3f2b8175eb6929e8d796a93c6da \
                    sha256  696edac467111d0c1353a4ff32ed8dfa33bc914036644c69a7b9506b7ee49115 \
                    size    514930

depends_lib         port:libconfig-hr \
                    port:pcre2 \
                    port:libev

depends_build-append \
                    port:conf2struct

# gap.h:18: error: redefinition of typedef ‘gap_array’
compiler.blacklist-append \
                    {*gcc-[34].*}

use_parallel_build  no

use_configure       yes

destroot {
    xinstall -W ${worksrcpath} sslh-fork sslh-select sslh-ev ${destroot}${prefix}/sbin/
    ln -s sslh-fork ${destroot}${prefix}/sbin/sslh

    xinstall -m 0644 ${worksrcpath}/sslh.8.gz ${destroot}${prefix}/share/man/man8/

    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} ChangeLog README.md example.cfg ${destroot}${docdir}
    copy ${worksrcpath}/doc ${destroot}${docdir}
}

livecheck.type      regex
livecheck.url       https://rutschle.net/tech/sslh/download.html
livecheck.regex     ${name}-v(\[0-9.\]+\[a-z\]?)${extract.suffix}
