# -*- 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/fluxcd/flux2 2.7.5 v
go.offline_build        no
revision                0
name                    flux

checksums               rmd160  9eb9d244e2d9415f46d925a43e5eca0f05e5a110 \
                        sha256  ceb37d65c614fe074e526ea9569ccf4bf8dd8c9421782e191a97ec514aa2821c \
                        size    1372353

homepage                https://fluxcd.io/
description             Flux CLI
long_description        Flux is a tool for keeping Kubernetes clusters in sync \
                        with sources of configuration (like Git repositories), \
                        and automating updates to configuration when there is  \
                        new code to deploy.

categories              sysutils
license                 Apache-2
maintainers             nomaintainer

depends_build-append    port:kustomize \
                        port:realpath

build.env-append        VERSION=${version}
build.cmd               make
build.target            build

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

    set bash_completion ${destroot}${prefix}/share/bash-completion/completions
    xinstall -m 0755 -d ${bash_completion}
    exec ${bin_path} completion bash > ${bash_completion}/${name}

    set zsh_completion ${destroot}${prefix}/share/zsh/site-functions
    xinstall -m 0755 -d ${zsh_completion}
    exec ${bin_path} completion zsh > ${zsh_completion}/_${name}

    set fish_completion ${destroot}${prefix}/share/fish/vendor_completions.d
    xinstall -m 0755 -d ${fish_completion}
    exec ${bin_path} completion fish > ${fish_completion}/${name}.fish
}
