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

homepage            https://manfred.life/assh

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  3a7f999816cea8e1dd72ae70d0e77e568888e689 \
                    sha256  9635d4123d344779728299627be57ee7ca26aa3ca65ed2fd4510a4fdd508b3cf \
                    size    377261

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}
"
