# -*- 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
PortGroup               legacysupport 1.1

go.setup                github.com/openshift/oc 4.21.0-202601121715 openshift-clients-
revision                0

description             OpenShift cluster CLI
long_description        Command line interface for running commands against \
                        OpenShift clusters

categories              sysutils
license                 Apache-2
homepage                https://kubectl.docs.kubernetes.io/
installs_libs           no

maintainers             {danchr @danchr} \
                        openmaintainer
checksums               rmd160  0b5db2fc98b5454e8beaf6935b18a8aa519809ab \
                        sha256  5f2e3c7e4ed25a68c4c049d0141e67966ecbcb416992efeed545149e3f3ab054 \
                        size    17862878


build.cmd               make
build.target            oc

go.package              github.com/openshift/oc
go.offline_build        no

use_parallel_build      no

depends_build-append    port:bash \
                        port:kerberos5

destroot {
    xinstall ${worksrcpath}/oc ${destroot}${prefix}/bin/oc
}

post-destroot {
    set bash_completions_dir ${destroot}${prefix}/share/bash-completion/completions
    set fish_completions_dir ${destroot}${prefix}/share/fish/vendor_completions.d
    set zsh_completions_dir ${destroot}${prefix}/share/zsh/site-functions

    xinstall -d ${bash_completions_dir} ${fish_completions_dir} ${zsh_completions_dir}

    exec ${destroot}${prefix}/bin/oc completion bash \
            > ${bash_completions_dir}/${name}
    exec ${destroot}${prefix}/bin/oc completion fish \
            > ${fish_completions_dir}/${name}.fish
    exec ${destroot}${prefix}/bin/oc completion zsh \
            > ${zsh_completions_dir}/_${name}
}
