# -*- 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/tailscale/tailscale 1.80.3 v
go.package          tailscale.com
go.offline_build    no
github.tarball_from archive
revision            0

homepage            https://tailscale.com

description         The easiest, most secure way to use WireGuard and 2FA.

long_description    {*}${description}. A secure network that just works. \
                    Zero config VPN. Installs on any device in minutes, \
                    manages firewall rules for you, and works from anywhere.

categories          net
installs_libs       no
license             BSD
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

checksums           rmd160  9d9a5887468a706a6b503fb9f7ffe8460901430c \
                    sha256  4ea7d4c1a4e86905f330f5d5f5288488cb29d6c586d5bcabf9d02c5481ba740d \
                    size    3528273

startupitem.create  yes
startupitem.executable \
                    ${prefix}/bin/${name}d

build.pre_args-append \
    -ldflags \" \
        -X tailscale.com/version.Long=${version}    \
        -X tailscale.com/version.Short=${version}   \
        -X tailscale.com/version.GitCommit=non-git  \
    \"

build.args-append   -o _build ./cmd/${name} ./cmd/${name}d

post-extract {
    file mkdir ${worksrcpath}/_build
}

destroot {
    xinstall -m 0755 \
        {*}[glob ${worksrcpath}/_build/*] ${destroot}${prefix}/bin/
}

notes "
After launching the Tailscale service for the first time using the steps below (port load), run:

    ${name} up
"

github.livecheck.regex {([0-9.]+)}
