# -*- 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.6.3 v
go.offline_build        no
revision                0
name                    flux

checksums               rmd160  2f9f8c5d514b5b0fdf35bf83745a849d567afa45 \
                        sha256  2b1b7101904d7b1c37730047043faf5b285619114daf140b0774e546dcaf12a6 \
                        size    1355690

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
}
