# -*- 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/moul/assh 2.17.0 v
go.package          moul.io/assh/v2
go.offline_build    no
revision            0

homepage            https://v1.manfred.life/assh-intro

description         Make your ssh client smarter

long_description    {*}${description}. ${name} is a transparent wrapper that \
                    adds support for regex, aliases, gateways, dynamic \
                    hostnames, graphviz, json output, yaml configuration, and \
                    more to SSH.

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

checksums           rmd160  225f9b10b89e492ec3fc5469a7a081eebeea24b4 \
                    sha256  7640558e6ce57a2c90b628cedd2f639647e4845538e3aa261870098dfdf95445 \
                    size    363569

build.cmd           \
    "make generate && \
        ${build.cmd} \
            -v \
            -ldflags=\"-X moul.io/assh/v2/pkg/version.Version=${version}\""
build.pre_args
build.args
build.jobs          0

set assh_examples_dir ${prefix}/share/${name}/examples

destroot {

    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/

    xinstall -d ${destroot}${assh_examples_dir}

    file copy {*}[glob ${worksrcpath}/examples/*] \
        ${destroot}${assh_examples_dir}

    # Shell completions
    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    xinstall ${worksrcpath}/contrib/completion/bash_autocomplete \
        ${destroot}${prefix}/share/bash-completion/completions/${name}

    xinstall -d ${destroot}${prefix}/share/zsh/site-functions
    xinstall ${worksrcpath}/contrib/completion/zsh_autocomplete \
        ${destroot}${prefix}/share/zsh/site-functions/_${name}
}

notes "
  Example configuration can be found in:

    ${assh_examples_dir}
"
