#debuginfo not supported with Go %global debug_package %{nil} # modifying the Go binaries breaks the DWARF debugging %global __os_install_post %{_rpmconfigdir}/brp-compress %global gopath %{_datadir}/gocode %global import_path github.com/openshift/oc %global golang_version 1.20 %{!?commit:%global commit 7693229513083646fe3a83a0fec6e651e4866d8d} %if ! 0%{?os_git_vars:1} # DO NOT MODIFY: the value on the line below is sed-like replaced by openshift/doozer %global os_git_vars OS_GIT_VERSION='4.15.0' OS_GIT_COMMIT='7693229' OS_GIT_MAJOR='4' OS_GIT_MINOR='15' OS_GIT_TREE_STATE='clean' %endif %if "%{os_git_vars}" == "ignore" %global make make %else %global make %{os_git_vars} && make SOURCE_GIT_TAG:="${OS_GIT_VERSION}" SOURCE_GIT_COMMIT:="${OS_GIT_COMMIT}" SOURCE_GIT_MAJOR:="${OS_GIT_MAJOR}" SOURCE_GIT_MINOR:="${OS_GIT_MINOR}" SOURCE_GIT_TREE_STATE:="${OS_GIT_TREE_STATE}" %endif Name: openshift-clients Version: 4.15.0 Release: 1%{dist} Summary: OpenShift client binaries License: ASL 2.0 URL: https://%{import_path} Source0: https://%{import_path}/archive/%{commit}/oc-%{commit}.tar.gz ExclusiveArch: %{go_arches} BuildRequires: golang >= %{golang_version} BuildRequires: krb5-devel BuildRequires: make BuildRequires: rsync Provides: atomic-openshift-clients = %{version} Obsoletes: atomic-openshift-clients <= %{version} Provides: kubernetes-client = 1.29.1 Conflicts: kubernetes-client %description %{summary} %prep %setup -q -n oc-%{commit} %build %{make} build GO_BUILD_PACKAGES:='./cmd/oc ./tools/genman' %install install -d %{buildroot}%{_bindir} # Install for the local platform install -p -m 755 ./oc %{buildroot}%{_bindir}/oc ln -s ./oc %{buildroot}%{_bindir}/kubectl [[ -e %{buildroot}%{_bindir}/kubectl ]] # Install man1 man pages install -d -m 0755 %{buildroot}%{_mandir}/man1 ./genman %{buildroot}%{_mandir}/man1 oc # Install bash completions install -d -m 755 %{buildroot}%{bash_completions_dir} %{buildroot}%{zsh_completions_dir} for bin in oc kubectl do echo "+++ INSTALLING BASH COMPLETIONS FOR ${bin} " %{buildroot}%{_bindir}/${bin} completion bash > %{buildroot}%{bash_completions_dir}/${bin} echo "+++ INSTALLING ZSH COMPLETIONS FOR ${bin} " %{buildroot}%{_bindir}/${bin} completion zsh > %{buildroot}%{zsh_completions_dir}/${bin} done %files %license LICENSE %license vendor/modules.txt %{_bindir}/oc %{_bindir}/kubectl %{bash_completions_dir}/oc %{bash_completions_dir}/kubectl %{zsh_completions_dir}/oc %{zsh_completions_dir}/kubectl %{_mandir}/man1/oc* %changelog