# -*- 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.17.2 v
go.toolchain_min    1.25.0
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  e1046cfbea0a9dab8a277134897ac2160ff08c47 \
                    sha256  27a2fd9039d535282b3fb9160644dea97366c7c4e4d3dccc2706e20732b7ad67 \
                    size    3157408

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

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