File kubermatic.spec of Package kubermatic

# Copyright (c) 2020 SUSE LLC
#
# 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/
# 


Name:           kubermatic
Version:        2.26.2+git.0.69018f2
Release:        0
License:        Apache-2.0
Summary:        Virtual Machine Management for Kubernetes
Url:            https://github.com/kubermatic/kubermatic
Group:          System/Management
Source0:        %{name}-%{version}.tar.gz
Source1:        vendor.tar.gz
BuildRequires:  golang-packaging
BuildRequires:  xz
BuildRequires:  git-core
BuildRequires:  glibc-devel
Requires(post): %fillup_prereq

%{go_nostrip}
%{go_provides}

%description
KubeVirt is a virtual machine management add-on for Kubernetes. The aim is to provide a common ground for virtualization solutions on top of Kubernetes.

%prep
%autosetup -a1

%build
export REV="%{version}"
export REV="${REV##*.}"
GOTOOLFLAGS_EXTRA="-mod vendor" \
DOCKERTAGS=$(echo %{version} | sed 's/\+/\ /;s/\(.*\) \(.*\)/\1/') \
GIT_VERSION=$(echo %{version} | sed 's/\+/\ /;s/\(.*\) \(.*\)/\2/') \
KUBERMATICDOCKERTAG="${DOCKERTAGS}" make build
#go build \
#  -mod=vendor \
#  -buildmode=pie \
#  -ldflags "-X main.VERSION=%{version}"

%install
mkdir -p %{buildroot}/usr/bin/
cp _build/* %{buildroot}/usr/bin/
chmod 755 %{buildroot}/usr/bin/*
mkdir -p %{buildroot}/usr/lib/kubermatic
cp -a charts %{buildroot}/usr/lib/kubermatic
mkdir -p %{buildroot}/usr/lib/kubermatic/hack
cp -a hack/test-chart-rendering.sh %{buildroot}/usr/lib/kubermatic/hack

%files
%doc README.md
%license LICENSE
%{_bindir}/*
/usr/lib/kubermatic

%changelog
openSUSE Build Service is sponsored by