# -*- 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/glasskube/glasskube 0.20.1 v
go.offline_build    no
revision            0

homepage            https://glasskube.dev/

categories          devel
installs_libs       no
maintainers         {gmail.com:esafak @esafak} openmaintainer
description         Missing Package Manager for Kubernetes
long_description    Deploy, configure and update Kubernetes packages 20x faster than with Helm
license             Apache-2

checksums           rmd160 031de1377e9c0a98512d376eccc03fca702df7a8 \
                    sha256 c47510a1d7f0909d77f36f048c45ba09d3f8bfc9fc23f8beec0b35c2a297c6ec \
                    size   805297

patchfiles-append   patch-Makefile.diff

depends_build-append \
                    bin:npm:npm10

build.cmd           make
build.target        build-cli
build.args-append   VERSION=${github.version}

use_parallel_build  no

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

    # generate and install the completion scripts
    file mkdir ${destroot}${prefix}/share/bash-completion/completions
    file mkdir ${destroot}${prefix}/share/fish/vendor_completions.d
    file mkdir ${destroot}${prefix}/share/zsh/site-functions
    system "${destroot}${prefix}/bin/glasskube completion bash > ${destroot}${prefix}/share/bash-completion/completions/glasskube"
    system "${destroot}${prefix}/bin/glasskube completion fish > ${destroot}${prefix}/share/fish/vendor_completions.d/glasskube"
    system "${destroot}${prefix}/bin/glasskube completion zsh > ${destroot}${prefix}/share/zsh/site-functions/_glasskube"
}
