# -*- 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/ahmetb/kubectx 0.11.0 v
revision            2
categories          sysutils
maintainers         {breun @breun} @gearnode openmaintainer
license             Apache-2

description         Power tools for kubectl
long_description    kubectx helps you switch between clusters back and forth. \
                    kubens helps you switch between Kubernetes namespaces smoothly.

checksums           ${distname}${extract.suffix} \
                    rmd160  130fcd0e86b278cfd4f9fade7eaa9a08985d8fa3 \
                    sha256  1c8eb6b30c0067f89e5b2f9480865b0e3229a221fadddb644ce192d663c63907 \
                    size    527548

go.vendors          sigs.k8s.io/yaml \
                        repo    github.com/kubernetes-sigs/yaml \
                        lock    v1.6.0 \
                        rmd160  96ccc8baaea4be9ba6f528e8442fd945f44111dc \
                        sha256  c00dfd6327572c286ca8bb3893da521ad524be34d70d2a4ff88c894a144dca45 \
                        size    50736 \
                    sigs.k8s.io/structured-merge-diff/v6 \
                        repo    github.com/kubernetes-sigs/structured-merge-diff \
                        lock    v6.3.0 \
                        rmd160  edb2cdd7f5b865e96be7afe07ca55849b95b907b \
                        sha256  3ace9bd2a9cbac2df362d050f09801c42226425e09c0d0efbcb643e645844d14 \
                        size    257515 \
                    sigs.k8s.io/randfill \
                        repo    github.com/kubernetes-sigs/randfill \
                        lock    v1.0.0 \
                        rmd160  e00fcdf1c0e0850961c83325a882d10153b783e8 \
                        sha256  a837c57b4dd941105cc566a5d2386152ff4ae5522103fba6137006e2d2a91cbb \
                        size    20824 \
                    sigs.k8s.io/kustomize/kyaml \
                        repo    github.com/kubernetes-sigs/kustomize \
                        lock    kyaml/v0.21.1 \
                        rmd160  e95510e53ca39c26e212621df69fedd508ce90bf \
                        sha256  e87550fcc9232209c914ba93f9f1c59852a1e93376de5924e168691e9fc8553a \
                        size    3573505 \
                    sigs.k8s.io/json \
                        repo    github.com/kubernetes-sigs/json \
                        lock    2d320260d730 \
                        rmd160  ccf090503488b5b56478f5c02c0595123a6a6283 \
                        sha256  9689b461506b4a5db179cdb9de4cf029c0a6a60dd91f14a2e0fa2b30271da2c0 \
                        size    210689 \
                    k8s.io/utils \
                        repo    github.com/kubernetes/utils \
                        lock    bc988d571ff4 \
                        rmd160  a3efffdde8c4e8a9cf6070d75212610976e19597 \
                        sha256  5d7d1b9de1b92df0adcf9969f3ba63d0fe992daba89bc17afd3e2a6fdf6ef0e2 \
                        size    127248 \
                    k8s.io/kube-openapi \
                        repo    github.com/kubernetes/kube-openapi \
                        lock    589584f1c912 \
                        rmd160  f6c40a8f4b5758d213f36dfd046ce8ed5ee5d37b \
                        sha256  1a6de87d8cec9a5816830c03a488019546d10fa414b87d5b99d6c657a851a106 \
                        size    2552211 \
                    k8s.io/klog/v2 \
                        repo    github.com/kubernetes/klog \
                        lock    v2.130.1 \
                        rmd160  b25b5e65d09778c7186ccf5814fc46d790bbabbe \
                        sha256  9f3c740ec0644919ef97ebf913efcfe1637790e095985c7e30f4b4b248e339a4 \
                        size    107018 \
                    k8s.io/client-go \
                        repo    github.com/kubernetes/client-go \
                        lock    v0.35.3 \
                        rmd160  7ffdd63702b22f33043964e320de01ce300dfa5e \
                        sha256  c2be7102fbcbf65a4329bc0a8ad1855c5bfa2e3cc1512c055880a49843081aa4 \
                        size    1931565 \
                    k8s.io/apimachinery \
                        repo    github.com/kubernetes/apimachinery \
                        lock    v0.35.3 \
                        rmd160  8399c6c0031cd079cfce420ccdf03ab164331ca8 \
                        sha256  44d7bc375fe43dae871287f7f6e92eb7f52a62b6c7418a9153e025d826d1df7f \
                        size    804817 \
                    k8s.io/api \
                        repo    github.com/kubernetes/api \
                        lock    v0.35.3 \
                        rmd160  14382b6d8146a8e71452cc8ba9958788fb5928f7 \
                        sha256  59d87346b326760967b10d07e871a6f3c48a893be296fcda3d2181a567170a95 \
                        size    2307486 \
                    gopkg.in/yaml.v3 \
                        lock    v3.0.1 \
                        rmd160  e85ac1368fb7f9ef945b7fd7bd608a1f0d261c12 \
                        sha256  f3ea6be3f405ec25f8799773355aba54f8831d11f5315a01155bdc69b92eca7b \
                        size    91208 \
                    gopkg.in/inf.v0 \
                        lock    v0.9.1 \
                        rmd160  ffe5850db548c2f54472facadcd35d2d2d33a74c \
                        sha256  5aa9ba7d33226f4833d55ee9e30e21a601e14961d793007e3aaa2ac6aab500c0 \
                        size    13076 \
                    gopkg.in/evanphx/json-patch.v4 \
                        lock    v4.13.0 \
                        rmd160  93e55c1a29c947bb4ca0d5f85cb55c38355883c0 \
                        sha256  ae4c32da96aba5e5cf3c28f5b882adf5d10f096ca9999a8732d9b6bde2eecb69 \
                        size    224707 \
                    google.golang.org/protobuf \
                        repo    github.com/protocolbuffers/protobuf-go \
                        lock    v1.36.8 \
                        rmd160  6af48fd45a40b9fcc6c7fb35730d3cf9f4c728df \
                        sha256  034f623d0db3977202545f740aba56eb642c2f9d5baabe9162c8fb5c19fb3850 \
                        size    1807280 \
                    golang.org/x/time \
                        lock    v0.9.0 \
                        rmd160  79f740b038827adb161f7773151e4494ccef724a \
                        sha256  9b95f8e278be42dc7d3312ce5d8cb926787db0e4e74d665da6d6f71aa72df400 \
                        size    12283 \
                    golang.org/x/text \
                        lock    v0.31.0 \
                        rmd160  4739b997f583cd40e344ce91f5882f4bfef04ac3 \
                        sha256  11465ea85289ec2c719b442b3fba63c92a8fe01aa67ee2ea5e4f2723540b8809 \
                        size    8971076 \
                    golang.org/x/term \
                        lock    v0.37.0 \
                        rmd160  3759f4d1753501eddc200d9470abbc5532628b4d \
                        sha256  5c843cde30cc5db1f4f91029922acfef7ef7b2f25e8de668a9810bb6eb6b8920 \
                        size    15933 \
                    golang.org/x/sys \
                        lock    v0.42.0 \
                        rmd160  9bf28fd4fb2566093e52db9828dace0cad68ece6 \
                        sha256  95cce678922f8cd653b53365de74085c97ca91d3f0c1ac20d96df2f0657d4e02 \
                        size    1540175 \
                    golang.org/x/oauth2 \
                        lock    v0.30.0 \
                        rmd160  63353a82f136c21da2c2613e3393b724d52b6f92 \
                        sha256  259d504972689aef6ba45f2ca479d462524e0803a0104735262c94a5ad3b1da2 \
                        size    100393 \
                    golang.org/x/net \
                        lock    v0.47.0 \
                        rmd160  cb483619404f77c733aae4a9529fd361c54dfd5b \
                        sha256  9921f979b5c270685d3728525236060bd55a1d84c7915ea4bda29503f7465497 \
                        size    1526927 \
                    go.yaml.in/yaml/v3 \
                        repo    github.com/yaml/go-yaml \
                        lock    v3.0.4 \
                        rmd160  ff5bc97155b2782fe3dfa394c8be1f8e71cee5ab \
                        sha256  6dc0cc7a57fb7bc812563a18a71aee2a08d866adc4415cd7eba2bafc3c6185e3 \
                        size    92702 \
                    go.yaml.in/yaml/v2 \
                        repo    github.com/yaml/go-yaml \
                        lock    v2.4.3 \
                        rmd160  efcb4aad6dfd846d5966034299875b1732c52361 \
                        sha256  79fddf802c465f75d9aacbb1e84516173d3437ad7e8ebc7f24e84039ceabb7b6 \
                        size    73320 \
                    github.com/x448/float16 \
                        lock    v0.8.4 \
                        rmd160  21b735f1bde517216d8a47db4bd7ee450136c230 \
                        sha256  16f51a49934264475113239764c6cfe83c7ecac550f2bd968b6e0e8c10d4c3e2 \
                        size    13102 \
                    github.com/spf13/pflag \
                        lock    v1.0.9 \
                        rmd160  d4d57de66f1e75d7398a6d6a703c2050454b24ba \
                        sha256  afc6ee76d0a69c8761f339ac7916c38d997b19c50627ceb9d69df89d8de9e543 \
                        size    63041 \
                    github.com/munnerz/goautoneg \
                        lock    a7dc8b61c822 \
                        rmd160  5d779614a17cd75c1ca4294a004c487ca3d152bf \
                        sha256  eb0c0a7182feac6df955be4b48525840f491febd3ddb3f1febd0806cc54d5c09 \
                        size    2817 \
                    github.com/modern-go/reflect2 \
                        lock    35a7c28c31ee \
                        rmd160  0aa759ef869a73efa4614300b8b3b6df0ce10a01 \
                        sha256  45f9ebfa1a1cb5527fb741e225fd8146bc0b08c07c247ffc9cfb5563b2471687 \
                        size    14099 \
                    github.com/modern-go/concurrent \
                        lock    bacd9c7ef1dd \
                        rmd160  b039328d6fd40b97513dea8bf5b00adfdd53f14b \
                        sha256  2f3333805bef60544e64ac9a734522205b513f5c461ba19f3d557510bb205afb \
                        size    7533 \
                    github.com/mattn/go-isatty \
                        lock    v0.0.20 \
                        rmd160  ef20ccdf87de8b704c0c7118625b2beb31d8f1b4 \
                        sha256  397549e98cf5d40df585f31dc7902f017c37be88c64311dd2b4aeccab4009949 \
                        size    4717 \
                    github.com/mattn/go-colorable \
                        lock    v0.1.14 \
                        rmd160  5b6117d2728f6478faf0be5b8790425fed6c4ad8 \
                        sha256  6661917405b168f0c8b92a2be524e668ee1c29b393353639453cb8f9c2f7eff8 \
                        size    9806 \
                    github.com/mailru/easyjson \
                        lock    v0.7.7 \
                        rmd160  f40deae988781d59d399784445dc89fe84d69e37 \
                        sha256  05481ab8b5f3709d4bd49b5459159b32856f426f021225774db000ec15792f2e \
                        size    81411 \
                    github.com/json-iterator/go \
                        lock    v1.1.12 \
                        rmd160  7b530ae077fa1fa5db7b7e228e92dd39c79c4a4d \
                        sha256  e0ec0450ef7ecedf0dfc1b5c430324fd0e8aedc18bddd0bd730e5a6cb35c41a8 \
                        size    84301 \
                    github.com/josharian/intern \
                        lock    v1.0.0 \
                        rmd160  44b878d7ae64491cd10e1508f8e11b8c0d145798 \
                        sha256  608fe46ccfa229b67317171cbaf8be29afc1b6f3187447946351f10e4d496143 \
                        size    1930 \
                    github.com/google/uuid \
                        lock    v1.6.0 \
                        rmd160  3d4f6f95018c6313f7258805845eb2a7e717850c \
                        sha256  72700459e75cad2b36586e8a13aa12c2d6248c45db24d1eebf41e18b1ec1c811 \
                        size    20895 \
                    github.com/google/go-cmp \
                        lock    v0.7.0 \
                        rmd160  3f04a79c291d786f9c69c2944bdd521402052a5c \
                        sha256  b621b304b529134076c9ebe09343aea7add039cd98e68be7e5a616245b0c3d03 \
                        size    105180 \
                    github.com/google/gnostic-models \
                        lock    v0.7.0 \
                        rmd160  fb3e4174cb596cbb12675d295d3ab54d3d620390 \
                        sha256  6d167577c962468d86924d2e30f0897cad58202e2bc6c1f585498e87def03a8f \
                        size    184506 \
                    github.com/go-openapi/swag \
                        lock    v0.23.0 \
                        rmd160  8d45fc4ff405932f509a30ab3767873268a74393 \
                        sha256  e8369ecb0d631606dbc319b127293f635124d0930c1285160983202b4abeb350 \
                        size    43294 \
                    github.com/go-openapi/jsonreference \
                        lock    v0.20.2 \
                        rmd160  f9dc56064097542aef0121a42f8014cf6411927d \
                        sha256  963488f5c3f5424885c1e04365f71a6c01d0727df0f41f563d75ecafff438db0 \
                        size    14034 \
                    github.com/go-openapi/jsonpointer \
                        lock    v0.21.0 \
                        rmd160  da43616f18a3c1e8f867f2fe5f6f769f6c6c197b \
                        sha256  09182f20994bf9e70b6cf46022f1a9b2b82ad6346234554a52f144be0663905b \
                        size    17860 \
                    github.com/go-logr/logr \
                        lock    v1.4.3 \
                        rmd160  fa3f731e260c24f2630f1733e655d29efeab318a \
                        sha256  97ad1e0983d04469a87355e1e6d463dd752e31e768d6350a0f81accaf506bdbf \
                        size    57736 \
                    github.com/go-errors/errors \
                        lock    v1.4.2 \
                        rmd160  ed53d1065e59d0cbac890a8460ab8403c4590843 \
                        sha256  44fe48c250d2b8e623684ca0f781562eadb23994237206be43a47a9c702c5e74 \
                        size    9180 \
                    github.com/fxamacker/cbor/v2 \
                        repo    github.com/fxamacker/cbor \
                        lock    v2.9.0 \
                        rmd160  16be2c8b94c61e259c825d8b45419a4aed837467 \
                        sha256  86e0714839b0cb1c6e0737787b28a79ad31d2cdf1af68c5b11170e85bf620304 \
                        size    181584 \
                    github.com/fatih/color \
                        lock    v1.19.0 \
                        rmd160  a64620e5587b3d1eb425e15d7fc1ccc7b0a280f2 \
                        sha256  1203fa77d5f8d487636a021778e626c37c37e4eeb103c580f722339c400ae039 \
                        size    13341 \
                    github.com/emicklei/go-restful/v3 \
                        repo    github.com/emicklei/go-restful \
                        lock    v3.12.2 \
                        rmd160  beb50fc2f188727bfc17fb535e82765fd95f8286 \
                        sha256  510f7f9c624343691007a08d91eb2d2f74409da83602ae751ad345b3e9d33dfa \
                        size    87095 \
                    github.com/davecgh/go-spew \
                        lock    v1.1.1 \
                        rmd160  7c02883aa81f81aca14e13a27fdca9e7fbc136f7 \
                        sha256  e85d6afa83e64962e0d63dd4812971eccf2b9b5445eda93f46a4406f0c177d5f \
                        size    42171 \
                    facette.io/natsort \
                        repo    github.com/facette/natsort \
                        lock    2cd4dd1e2dcb \
                        rmd160  4a611235a575e18fbbc8e2ff0cdccdc1a981f1de \
                        sha256  812511163baf5bf7a0c2a39c624d3a0a085aa6ed14227dc1b7f8043d0ca8f569 \
                        size    2889

depends_run         path:bin/kubectl:kubectl-1.35

build.cmd           ${go.bin} build -ldflags="-s -w -X main.version=v${version}" -o bin/kubectx ./cmd/kubectx && \
                    ${go.bin} build -ldflags="-s -w -X main.version=v${version}" -o bin/kubens ./cmd/kubens

destroot    {
    set doc_dir ${destroot}${prefix}/share/${name}
    xinstall -d ${doc_dir}
    xinstall -m 644 -W ${worksrcpath} \
        CONTRIBUTING.md \
        LICENSE \
        README.md \
        ${doc_dir}

    set bin_dir ${destroot}${prefix}/bin
    xinstall -m 755 -W ${worksrcpath}/bin \
        kubectx \
        kubens \
        ${bin_dir}

    set src_completion_dir ${worksrcpath}/completion

    set zsh_completion_dir ${destroot}${prefix}/share/zsh/site-functions
    xinstall -d ${zsh_completion_dir}
    xinstall -m 644 ${src_completion_dir}/_kubectx.zsh ${zsh_completion_dir}/_kubectx
    xinstall -m 644 ${src_completion_dir}/_kubens.zsh ${zsh_completion_dir}/_kubens

    set bash_completion_dir ${destroot}${prefix}/etc/bash_completion.d
    xinstall -d ${bash_completion_dir}
    xinstall -m 644 ${src_completion_dir}/kubectx.bash ${bash_completion_dir}/kubectx
    xinstall -m 644 ${src_completion_dir}/kubens.bash ${bash_completion_dir}/kubens

    set fish_completion_dir ${destroot}${prefix}/share/fish/vendor_completions.d
    xinstall -d ${fish_completion_dir}
    xinstall -m 644 ${src_completion_dir}/kubectx.fish ${fish_completion_dir}/
    xinstall -m 644 ${src_completion_dir}/kubens.fish ${fish_completion_dir}/
}
