# -*- 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.18 v
go.offline_build    no
revision            0
categories          security
maintainers         {@sikmir disroot.org:sikmir} \
                    {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer
platforms           {darwin >= 23}
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  8b99677d50be90c00a0c658397710d1ef744817f \
                    sha256  46b197fd6d72305203bf342a88931a25366b7066801c0151ea01c2a4efed2f79 \
                    size    2356120

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