# -*- 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/ByteNess/aws-vault 7.6.0 v
go.offline_build    no
go.package          github.com/ByteNess/aws-vault
revision            0

description         \
    A vault for securely storing and accessing AWS credentials in \
    development environments.

long_description    \
    AWS Vault is a tool to securely store and access AWS credentials in a \
    development environment.  AWS Vault stores IAM credentials in your \
    operating system's secure keystore and then generates temporary \
    credentials from those to expose to your shell and applications. It's \
    designed to be complementary to the AWS CLI tools, and is aware of your \
    profiles and configuration in ~/.aws/config.

checksums           rmd160  8b3b23ab58947144084bee0940d7096cb2361423 \
                    sha256  9f8b27cad594cf42f41b9adaf92de6d69e4c73ab2d9e122eb1dff075de00a48f \
                    size    77650

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

build.cmd           make
build.pre_args      VERSION=${version}
build.args          aws-vault-darwin-${goarch}

use_xcode           yes

post-extract {
    file mkdir ${gopath}/src/github.com/keybase
    ln -s   ${gopath}/src/github.com/99designs/go-keychain \
            ${gopath}/src/github.com/keybase/go-keychain
}

destroot {
    xinstall -m 0755 \
        ${worksrcpath}/aws-vault-darwin-${goarch} \
        ${destroot}${prefix}/bin/${name}

    # Bash completions
    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    copy ${worksrcpath}/contrib/completions/bash/${name}.bash \
         ${destroot}${prefix}/share/bash-completion/completions/${name}

    # Zsh completions
    xinstall -d ${destroot}${prefix}/share/zsh/site-functions
    copy ${worksrcpath}/contrib/completions/zsh/${name}.zsh \
        ${destroot}${prefix}/share/zsh/site-functions/_${name}

    # Fish completions
    xinstall -d ${destroot}${prefix}/share/fish/vendor_completions.d
    copy ${worksrcpath}/contrib/completions/fish/${name}.fish \
        ${destroot}${prefix}/share/fish/vendor_completions.d/${name}.fish
}

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