# Generate devel rpm %global with_devel 0 # Build with debug info rpm %global with_debug 0 # Run unit tests %global with_tests 0 # Build test binaries %global with_test_binaries 0 #Build stripped binaries %global with_stripped_binaries 1 %if 0%{?with_debug} %global _dwz_low_mem_die_limit 0 %else %global debug_package %{nil} %endif %global git_commit 27c2e1d138485e1b81a9719842b485132ed744d7 %global git_shortcommit %(c=%{git_commit}; echo ${c:0:7}) %global provider github %global provider_tld com %global project maistra %global repo istio-operator # https://github.com/maistra/istio-operator %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} # Use /usr/local as base dir, once upstream heavily depends on that %global _prefix /usr/local Name: istio-operator Version: 0.1.0 Release: 4%{?dist} Summary: A Kubernetes operator to manage Istio. License: ASL 2.0 URL: https://%{provider_prefix} Source0: https://%{provider_prefix}/archive/%{git_commit}/%{repo}-%{git_commit}.tar.gz # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. BuildRequires: golang >= 1.9 %description Istio-operator is a kubernetes operator to manage the lifecycle of Istio. %if 0%{?with_devel} %package devel Summary: %{summary} BuildArch: noarch %description devel Istio-operator is a kubernetes operator to manage the lifecycle of Istio. %endif %prep rm -rf OPERATOR mkdir -p OPERATOR/src/github.com/maistra/istio-operator tar zxf %{SOURCE0} -C OPERATOR/src/github.com/maistra/istio-operator --strip=1 %build cd OPERATOR export GOPATH=$(pwd):%{gopath} cd src/github.com/maistra/istio-operator/tmp/build/ ./build.sh %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_bindir} cd OPERATOR/src/github.com/maistra/istio-operator/tmp/build/ cd tmp/_output/bin/ %if 0%{?with_stripped_binaries} mkdir stripped strip -o stripped/istio-operator -s istio-operator cp -pav stripped/istio-operator $RPM_BUILD_ROOT%{_bindir}/ %else cp -pav istio-operator $RPM_BUILD_ROOT%{_bindir}/ %endif %files %{_bindir}/istio-operator %changelog * Fri Aug 31 2018 Brian Avery - 0.1.0 - Stripped binaries * Tue Aug 14 2018 Brian Avery - 0.1.0 - First package