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

go.setup            github.com/go-gost/gost 3.2.6 v
go.toolchain_min    1.26.3
revision            0

categories          net
license             MIT
maintainers         {judaew @judaew} openmaintainer

description         GO Simple Tunnel - a simple tunnel written in golang.
long_description    ${description}
homepage            https://gost.run/en/

checksums           rmd160  2c4c39920514bf57592eda81d674226114a3c05a \
                    sha256  79874354530b899576dd4866d3b1400651d0b17c1e7a90ad30c44686a0642600 \
                    size    31234

# FIXME: This port currently can't be built without allowing go mod to fetch
go.offline_build    no

build.args          -o ${name} ./cmd/gost

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
    xinstall -m 0644 ${worksrcpath}/${name}.yml ${destroot}${prefix}/etc/${name}.yml.example
}

startupitem.create  yes
startupitem.name    ${name}
startupitem.logfile ${prefix}/var/log/${name}.log
startupitem.start   "${prefix}/bin/${name} -C ${prefix}/etc/${name}.yml"
startupitem.stop    "kill \$(cat ${prefix}/var/run/${name}.pid)"
startupitem.pidfile auto ${prefix}/var/run/${name}.pid

notes-append "
A configuration must be created at
    ${prefix}/etc/${name}.yml

An example configuration is located at
    ${prefix}/etc/${name}.yml.example
"

# Ignore nightly releases
livecheck.url       ${github.homepage}/releases
