File helm.spec of Package helm
#
# spec file for package helm
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define git_commit 618447cbf203d147601b4b9bd7f8c37a5d39fbb4
Name: helm
Version: 2.13.1
Release: 0
Summary: The Kubernetes Package Manager
License: Apache-2.0
Group: Development/Languages/Other
URL: https://github.com/kubernetes/helm
Source: %{name}-%{version}.tar.xz
Source1: vendor.tar.xz
Source2: helm-serve.service
BuildRequires: go1.11
Source99: README.packaging
BuildRequires: golang-packaging
BuildRequires: systemd-rpm-macros
BuildRequires: xz
%{?systemd_requires}
%{go_nostrip}
%{go_provides}
%description
Helm is a tool for managing Kubernetes charts. Charts are packages of pre-configured Kubernetes resources.
%prep
%setup -q
tar xJf %{SOURCE1}
%{goprep} k8s.io/helm
%build
export GOPATH="%{_builddir}/go:$GOPATH"
GOBIN=$PWD/bin go install -tags '' -ldflags ' -X k8s.io/helm/pkg/version.Version=v%{version} -X k8s.io/helm/pkg/version.BuildMetadata= -X k8s.io/helm/pkg/version.GitCommit=%{git_commit} -X k8s.io/helm/pkg/version.GitTreeState=clean' k8s.io/helm/cmd/...
%install
mkdir -p %{buildroot}%{_bindir}
install -m755 bin/helm %{buildroot}/%{_bindir}/helm
install -m755 bin/tiller %{buildroot}/%{_bindir}/tiller
mkdir -p %{buildroot}%{_sbindir} %{buildroot}%{_unitdir}
install -p -D -m 444 %{SOURCE2} %{buildroot}%{_unitdir}/helm-serve.service
%pre
%service_add_pre helm-serve.service
%post
%service_add_post helm-serve.service
%preun
%service_del_preun helm-serve.service
%postun
%restart_on_update helm-serve.service
%service_del_postun helm-serve.service
%files
%doc README.md
%license LICENSE
%{_bindir}/helm
%{_bindir}/tiller
%{_unitdir}/helm-serve.service
%changelog