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

github.setup            z3APA3A 3proxy 0.8.12
categories              net
platforms               darwin
license                 BSD GPL-2+ LGPL-2.1+ Apache
maintainers             {mail.ru:nano103 @nano103}

description             tiny free proxy server

long_description        3proxy 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  0b4552ae3dd1b0a299881233932c2faceffa8f68 \
                        sha256  73ba774233b8e1d099b0ad5174126cfc6f47d0ad322e835c253ea7d1568f36a7

patchfiles              patch-Makefile.unix-install.diff
post-patch {
    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Makefile.unix-install
    reinplace "s/-O2/-O2 ${configure.cc_archflags}/g" ${worksrcpath}/Makefile.unix
}

use_configure           no

build.args              -f Makefile.unix CC="${configure.cc}" \
                        LN="${configure.cc}"
destroot.args           -f Makefile.unix-install

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

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