# -*- 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            3proxy 3proxy 0.9.4
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
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  86010866b0a75d2fc3adaac1dd47645714e245dd \
                        sha256  55bad855d6851e85e4d7a5d6d8a14f98c5dc754fa6a4e0c512682f95259bf5d1 \
                        size    610421

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