# -*- 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
PortGroup           github 1.0

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

github.setup        yrutschle sslh 2.1.3 v
revision            0
epoch               1
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

checksums           rmd160  52d841836f2e9a793883d2e56267d0415cea7e20 \
                    sha256  75c6447c1986ed799570cc3c784a1a712fd2c67cf27b7a96a791037d5c813274 \
                    size    462043

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}
}
