# Generated by go2rpm 1.8.2
%bcond_without check
%bcond_with bootstrap
%if %{with bootstrap}
%global debug_package %{nil}
%endif

# https://github.com/kubernetes/sample-cli-plugin
%global goipath         k8s.io/sample-cli-plugin
%global forgeurl        https://github.com/kubernetes/sample-cli-plugin
Version:                1.26.0~rc.0
%global tag             kubernetes-1.26.0-rc.0
%global distprefix      %{nil}

%gometa

%global common_description %{expand:
This package implements a single kubectl plugin for switching the namespace that
the current KUBECONFIG context points to. In order to remain as indestructive as
possible, no existing contexts are modified.}

%global golicenses      LICENSE
%global godocs          CONTRIBUTING.md README.md code-of-conduct.md

# This package uses gold. Tell package-notes implementation about this.
%global _package_note_linker gold

Name:           %{goname}
Release:        %autorelease
Summary:        Sample kubectl plugin

License:        Apache-2.0
URL:            %{gourl}
Source:         %{gosource}

%description %{common_description}

%gopkg

%prep
%goprep

%if %{without bootstrap}
%generate_buildrequires
%go_generate_buildrequires
%endif

%if %{without bootstrap}
%build
%gobuild -o %{gobuilddir}/bin/kubectl-ns %{goipath}/cmd/
%endif

%install
%gopkginstall
%if %{without bootstrap}
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
%endif

%if %{without bootstrap}
%if %{with check}
%check
%gocheck
%endif
%endif

%if %{without bootstrap}
%files
%license LICENSE
%doc CONTRIBUTING.md README.md code-of-conduct.md
%{_bindir}/*
%endif

%gopkgfiles

%changelog
%autochangelog