# -*- 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/gopasspw/gopass 1.15.15 v
go.offline_build    no
revision            0
categories          security
maintainers         {@sikmir disroot.org:sikmir} \
                    {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer
license             MIT

description         The slightly more awesome Standard Unix Password Manager for Teams
long_description    {*}${description}
homepage            https://www.gopass.pw

depends_lib-append  port:gnupg2

checksums           rmd160  7747b448fc6ea9389dbccb4fcc3b7ad9c8250251 \
                    sha256  00ad6a32f89fe64760b70b9424af19b88d671673a66424d59d80cfa97deb75d3 \
                    size    2335086

set go_ldflags      "-s -w -X main.version=${version}"
build.args          -ldflags \"${go_ldflags}\" -tags=netgo

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

    # Install shell completions
    xinstall -d ${destroot}${prefix}/share/bash-completion/completions
    xinstall -m 0644 ${worksrcpath}/bash.completion \
        ${destroot}${prefix}/share/bash-completion/completions/${name}

    xinstall -d ${destroot}${prefix}/share/fish/vendor_completions.d/
    xinstall -m 0644 ${worksrcpath}/fish.completion \
        ${destroot}${prefix}/share/fish/vendor_completions.d/${name}.fish

    xinstall -d ${destroot}${prefix}/share/zsh/site-functions
    xinstall -m 0644 ${worksrcpath}/zsh.completion \
        ${destroot}${prefix}/share/zsh/site-functions/_${name}


}