# -*- 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        yggdrasil-network yggdrasil-go 0.3.11 v
revision            0
categories          net
platforms           darwin
maintainers         {l2dy @l2dy} openmaintainer
license             LGPL-3

description         An experiment in scalable routing as an encrypted IPv6 overlay network

long_description    Yggdrasil is an early-stage implementation of a fully \
                    end-to-end encrypted IPv6 network. It is lightweight, self-arranging, \
                    supported on multiple platforms and allows pretty much any \
                    IPv6-capable application to communicate securely with other Yggdrasil \
                    nodes.

checksums           rmd160  fd0c3d3ce4b57dbf1aa4d169df4e2acb4dc01c0b \
                    sha256  9582287d7f2782e3af71fe1576565cf2a6bb91654de4adbe797edd6745882ed6 \
                    size    161612

depends_build       port:go

use_configure       no

build.cmd           "./build"
build.target
build.env-append    PKGNAME=yggdrasil PKGVER=${version}

destroot {
        xinstall -m 755 -d ${destroot}${prefix}/bin
        xinstall -m 755 -W ${worksrcpath} {*}[glob -tails -directory ${worksrcpath}/cmd/ *] ${destroot}${prefix}/bin
}

startupitem.create      yes
startupitem.name        yggdrasil
startupitem.executable  ${prefix}/bin/yggdrasil -useconffile ${prefix}/etc/yggdrasil.conf

notes "
To launch yggdrasil at startup, first generate default config with the following command:
umask 0077 && yggdrasil -genconf | sudo tee ${prefix}/etc/yggdrasil.conf >/dev/null
"