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

github.setup            3proxy 3proxy 0.9.7
revision                0
categories              net
license                 BSD GPL-2+ LGPL-2.1+ Apache
maintainers             {mail.ru:nano103 @nano103} openmaintainer

description             Tiny free proxy server
long_description        ${name} is a universal proxy server. It can be used \
                        to provide internal users with fully controllable \
                        access to external resources or to provide external \
                        users with access to internal resources.

homepage                https://3proxy.ru

checksums               rmd160  5a1098da56e5b7d515c17587cd40728db0280aa9 \
                        sha256  efe862ef8b7c0ddf7b1c45d6b5d72f0b7cd0a3c54447419c7f1bd2239a06fc30 \
                        size    414994
github.tarball_from     archive

depends_lib-append      port:pcre2

configure.args-append   -DCMAKE_INSTALL_SYSCONFDIR=${prefix}/etc

# https://github.com/3proxy/3proxy/issues/1250
patchfiles              patch-IPV6_BOUND_IF.diff
# TODO: verify if correct (suggestion from the upstream):
configure.cppflags-append \
                        -DIPV6_BOUND_IF=125

post-destroot {
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} copying README.md \
        ${destroot}${prefix}/share/doc/${name}
}

github.livecheck.regex  {(\d+(?:.\d+)*)}
