# -*- 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.7.12 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  472972fc2af74b7d16eb1e9fdb8cec4fdf203710 \
                    sha256  87d50a784acf8f056ddaf42439bb414d300322ad661a866153e964b03a9a4e93 \
                    size    81394

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.]+)}
