# -*- 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.26.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  7e8874e08312876d202336a356a8d6097531031a \
                    sha256  c044187e49683b39aa89c26bc02dab38781578c24b6ab277c0a58ae811066996 \
                    size    357245

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