2020-09-12 00:10:31 +02:00
|
|
|
#
|
|
|
|
# spec file for package kubevirt
|
|
|
|
#
|
2021-01-20 01:50:25 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2020-09-12 00:10:31 +02:00
|
|
|
#
|
|
|
|
# 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: kubevirt
|
2021-11-12 15:46:06 +01:00
|
|
|
Version: 0.47.1
|
2020-09-12 00:10:31 +02:00
|
|
|
Release: 0
|
|
|
|
Summary: Container native virtualization
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: System/Packages
|
|
|
|
URL: https://github.com/kubevirt/kubevirt
|
|
|
|
Source0: %{name}-%{version}.tar.gz
|
2020-11-06 22:27:48 +01:00
|
|
|
Source1: kubevirt-psp-caasp.yaml
|
2021-05-04 15:57:05 +02:00
|
|
|
Source2: kubevirt_containers_meta
|
|
|
|
Source3: kubevirt_containers_meta.service
|
2021-10-22 06:35:35 +02:00
|
|
|
Source4: https://github.com/kubevirt/kubevirt/releases/download/v%{version}/disks-images-provider.yaml
|
2020-11-10 01:12:14 +01:00
|
|
|
Source100: %{name}-rpmlintrc
|
2020-09-12 00:10:31 +02:00
|
|
|
BuildRequires: glibc-devel-static
|
|
|
|
BuildRequires: golang-packaging
|
|
|
|
BuildRequires: pkgconfig
|
|
|
|
BuildRequires: rsync
|
|
|
|
BuildRequires: sed
|
2021-06-15 15:54:05 +02:00
|
|
|
BuildRequires: golang(API) = 1.16
|
2020-09-12 00:10:31 +02:00
|
|
|
BuildRequires: pkgconfig(libvirt)
|
|
|
|
ExclusiveArch: x86_64
|
|
|
|
|
|
|
|
%description
|
|
|
|
Kubevirt is a virtual machine management add-on for Kubernetes
|
|
|
|
|
|
|
|
%package virtctl
|
|
|
|
Summary: Client for managing kubevirt
|
2020-09-16 19:35:17 +02:00
|
|
|
Group: System/Packages
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%description virtctl
|
|
|
|
The virtctl client is a command-line utility for managing container native virtualization resources
|
|
|
|
|
|
|
|
%package virt-api
|
|
|
|
Summary: Kubevirt API server
|
2020-09-16 19:35:17 +02:00
|
|
|
Group: System/Packages
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%description virt-api
|
|
|
|
The virt-api package provides the kubernetes API extension for kubevirt
|
|
|
|
|
|
|
|
%package container-disk
|
|
|
|
Summary: Container disk for kubevirt
|
2020-09-16 19:35:17 +02:00
|
|
|
Group: System/Packages
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%description container-disk
|
|
|
|
The containter-disk package provides a container disk functionality for kubevirt
|
|
|
|
|
|
|
|
%package virt-controller
|
|
|
|
Summary: Controller for kubevirt
|
2020-09-16 19:35:17 +02:00
|
|
|
Group: System/Packages
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%description virt-controller
|
|
|
|
The virt-controller package provides a controller for kubevirt
|
|
|
|
|
|
|
|
%package virt-handler
|
|
|
|
Summary: Handler component for kubevirt
|
2020-09-16 19:35:17 +02:00
|
|
|
Group: System/Packages
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%description virt-handler
|
|
|
|
The virt-handler package provides a handler for kubevirt
|
|
|
|
|
|
|
|
%package virt-launcher
|
|
|
|
Summary: Launcher component for kubevirt
|
2020-09-16 19:35:17 +02:00
|
|
|
Group: System/Packages
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%description virt-launcher
|
|
|
|
The virt-launcher package provides a launcher for kubevirt
|
|
|
|
|
|
|
|
%package virt-operator
|
|
|
|
Summary: Operator component for kubevirt
|
2020-09-16 19:35:17 +02:00
|
|
|
Group: System/Packages
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%description virt-operator
|
|
|
|
The virt-opertor package provides an operator for kubevirt CRD
|
|
|
|
|
2020-11-02 15:45:47 +01:00
|
|
|
%package manifests
|
|
|
|
Summary: YAML manifests used to install kubevirt
|
|
|
|
Group: System/Packages
|
|
|
|
|
|
|
|
%description manifests
|
|
|
|
This contains the built YAML manifests used to install kubevirt into a
|
|
|
|
kubernetes installation with kubectl apply.
|
|
|
|
|
2021-02-17 12:55:54 +01:00
|
|
|
%package tests
|
|
|
|
Summary: Kubevirt functional tests
|
|
|
|
Group: System/Packages
|
|
|
|
|
|
|
|
%description tests
|
|
|
|
The package provides Kubevirt end-to-end tests.
|
|
|
|
|
2021-05-04 15:57:05 +02:00
|
|
|
%package -n obs-service-kubevirt_containers_meta
|
|
|
|
Summary: Kubevirt containers meta information (build service)
|
|
|
|
Group: System/Packages
|
|
|
|
|
|
|
|
%description -n obs-service-kubevirt_containers_meta
|
|
|
|
The package provides meta information that is used during the build of
|
|
|
|
the Kubevirt container images.
|
|
|
|
|
2020-09-12 00:10:31 +02:00
|
|
|
%prep
|
|
|
|
%autosetup -p1
|
|
|
|
|
|
|
|
%build
|
2020-11-06 22:27:48 +01:00
|
|
|
# Hackery to determine which registry path to use in kubevirt-operator.yaml
|
|
|
|
# when building the manifests
|
|
|
|
#
|
2021-06-15 15:54:05 +02:00
|
|
|
# The 'kubevirt_registry_path' macro can be used to define an explicit path in
|
|
|
|
# the project config, e.g.
|
2020-11-06 22:27:48 +01:00
|
|
|
#
|
|
|
|
# Macros:
|
2021-06-15 15:54:05 +02:00
|
|
|
# %kubevirt_registry_path registry.opensuse.org/Virtualization/container
|
2020-11-06 22:27:48 +01:00
|
|
|
# :Macros
|
|
|
|
#
|
2021-06-15 15:54:05 +02:00
|
|
|
# 'kubevirt_registry_path' can also be defined when building locally, e.g.
|
2020-11-06 22:27:48 +01:00
|
|
|
#
|
2021-06-15 15:54:05 +02:00
|
|
|
# osc build --define='kubevirt_registry_path registry.opensuse.org/foo/bar/baz' ...
|
2020-11-06 22:27:48 +01:00
|
|
|
#
|
2021-06-15 15:54:05 +02:00
|
|
|
# If 'kubevirt_registry_path' is not specified, the standard publish location
|
|
|
|
# for SLE and openSUSE-based containers is used.
|
2020-11-06 22:27:48 +01:00
|
|
|
#
|
2021-07-05 06:56:36 +02:00
|
|
|
distro='%{?sle_version}:%{?is_opensuse}%{!?is_opensuse:0}'
|
2020-11-06 22:27:48 +01:00
|
|
|
case "${distro}" in
|
2021-06-15 15:54:05 +02:00
|
|
|
150200:0)
|
2021-07-05 06:56:36 +02:00
|
|
|
tagprefix=suse/sles/15.2
|
|
|
|
labelprefix=com.suse.kubevirt
|
|
|
|
registry=registry.suse.com
|
|
|
|
;;
|
2021-06-15 15:54:05 +02:00
|
|
|
150300:0)
|
2021-07-05 06:56:36 +02:00
|
|
|
tagprefix=suse/sles/15.3
|
|
|
|
labelprefix=com.suse.kubevirt
|
|
|
|
registry=registry.suse.com
|
|
|
|
;;
|
2021-06-15 15:54:05 +02:00
|
|
|
*)
|
2021-07-05 06:56:36 +02:00
|
|
|
tagprefix=kubevirt
|
|
|
|
labelprefix=org.opensuse.kubevirt
|
|
|
|
registry=registry.opensuse.org
|
|
|
|
;;
|
2020-11-06 22:27:48 +01:00
|
|
|
esac
|
2021-07-05 06:56:36 +02:00
|
|
|
|
|
|
|
%if "%{?kubevirt_registry_path}" == ""
|
|
|
|
reg_path="${registry}/${tagprefix}"
|
2020-11-06 22:27:48 +01:00
|
|
|
%else
|
2021-07-05 06:56:36 +02:00
|
|
|
reg_path='%{kubevirt_registry_path}'
|
2020-11-06 22:27:48 +01:00
|
|
|
%endif
|
|
|
|
|
2021-07-05 06:56:36 +02:00
|
|
|
sed -i"" \
|
|
|
|
-e "s#_TAGPREFIX_#${tagprefix}#g" \
|
|
|
|
-e "s#_LABELPREFIX_#${labelprefix}#g" \
|
|
|
|
-e "s#_REGISTRY_#${registry}#g" \
|
|
|
|
-e "s#_PKG_VERSION_#%{version}#g" \
|
|
|
|
-e "s#_PKG_RELEASE_#%{release}#g" \
|
|
|
|
%{S:2}
|
|
|
|
|
2020-09-12 00:10:31 +02:00
|
|
|
mkdir -p go/src/kubevirt.io go/pkg
|
|
|
|
ln -s ../../../ go/src/kubevirt.io/kubevirt
|
|
|
|
export GOPATH=${PWD}/go
|
2020-09-16 19:35:17 +02:00
|
|
|
export GOFLAGS="-buildmode=pie"
|
2020-09-12 00:10:31 +02:00
|
|
|
cd ${GOPATH}/src/kubevirt.io/kubevirt
|
|
|
|
env \
|
|
|
|
KUBEVIRT_GO_BASE_PKGDIR="${GOPATH}/pkg" \
|
|
|
|
KUBEVIRT_VERSION=%{version} \
|
2020-10-23 21:46:08 +02:00
|
|
|
KUBEVIRT_SOURCE_DATE_EPOCH="$(date -r LICENSE +%s)" \
|
2020-09-12 00:10:31 +02:00
|
|
|
KUBEVIRT_GIT_COMMIT='v%{version}' \
|
|
|
|
KUBEVIRT_GIT_VERSION='v%{version}' \
|
|
|
|
KUBEVIRT_GIT_TREE_STATE="clean" \
|
2021-02-17 12:55:54 +01:00
|
|
|
build_tests="true" \
|
2020-09-12 00:10:31 +02:00
|
|
|
./hack/build-go.sh install \
|
|
|
|
cmd/virtctl \
|
|
|
|
cmd/virt-api \
|
|
|
|
cmd/virt-controller \
|
|
|
|
cmd/virt-chroot \
|
|
|
|
cmd/virt-handler \
|
|
|
|
cmd/virt-launcher \
|
|
|
|
cmd/virt-operator \
|
|
|
|
%{nil}
|
2020-11-06 22:27:48 +01:00
|
|
|
|
2021-11-12 15:46:06 +01:00
|
|
|
env DOCKER_PREFIX=$reg_path DOCKER_TAG=%{version}-%{release} KUBEVIRT_NO_BAZEL=true GO_BUILD=true ./hack/build-manifests.sh
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%install
|
|
|
|
mkdir -p %{buildroot}%{_bindir}
|
|
|
|
|
|
|
|
install -p -m 0755 _out/cmd/container-disk-v2alpha/container-disk %{buildroot}%{_bindir}/
|
|
|
|
install -p -m 0755 _out/cmd/virtctl/virtctl %{buildroot}%{_bindir}/
|
|
|
|
install -p -m 0755 _out/cmd/virt-api/virt-api %{buildroot}%{_bindir}/
|
|
|
|
install -p -m 0755 _out/cmd/virt-controller/virt-controller %{buildroot}%{_bindir}/
|
|
|
|
install -p -m 0755 _out/cmd/virt-chroot/virt-chroot %{buildroot}%{_bindir}/
|
|
|
|
install -p -m 0755 _out/cmd/virt-handler/virt-handler %{buildroot}%{_bindir}/
|
|
|
|
install -p -m 0755 _out/cmd/virt-launcher/virt-launcher %{buildroot}%{_bindir}/
|
|
|
|
install -p -m 0755 _out/cmd/virt-operator/virt-operator %{buildroot}%{_bindir}/
|
2021-02-17 12:55:54 +01:00
|
|
|
install -p -m 0755 _out/tests/tests.test %{buildroot}%{_bindir}/virt-tests
|
2021-07-13 07:36:49 +02:00
|
|
|
install -p -m 0755 cmd/virt-launcher/node-labeller/node-labeller.sh %{buildroot}%{_bindir}/
|
2021-04-21 17:24:29 +02:00
|
|
|
|
2021-05-06 17:38:50 +02:00
|
|
|
# virt-launcher SELinux policy needs to land in virt-handler container
|
|
|
|
install -p -m 0644 cmd/virt-handler/virt_launcher.cil %{buildroot}/
|
|
|
|
|
2021-10-22 06:35:35 +02:00
|
|
|
# Install release manifests
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/kube-virt/manifests/release
|
|
|
|
install -m 0644 _out/manifests/release/kubevirt-operator.yaml %{buildroot}%{_datadir}/kube-virt/manifests/release/
|
|
|
|
install -m 0644 _out/manifests/release/kubevirt-cr.yaml %{buildroot}%{_datadir}/kube-virt/manifests/release/
|
2020-11-06 22:27:48 +01:00
|
|
|
# TODO:
|
|
|
|
# Create a proper Pod Security Policy (PSP) for KubeVirt. For now, add one
|
|
|
|
# that uses the CaaSP privileged PSP. It can be used with CaaSP-based
|
|
|
|
# Kubernetes clusters.
|
|
|
|
install -m 644 %{S:1} %{buildroot}/%{_datadir}/kube-virt/manifests/release/
|
2021-10-22 06:35:35 +02:00
|
|
|
|
|
|
|
# Install manifests for testing
|
|
|
|
mkdir -p %{buildroot}%{_datadir}/kube-virt/manifests/testing
|
|
|
|
install -m 0644 _out/manifests/testing/* %{buildroot}%{_datadir}/kube-virt/manifests/testing/
|
|
|
|
# The generated disks-images-provider.yaml refers to nonexistent container
|
|
|
|
# images. Overwrite it with the upstream version for testing.
|
|
|
|
install -m 0644 %{S:4} %{buildroot}/%{_datadir}/kube-virt/manifests/testing/
|
|
|
|
install -m 0644 tests/default-config.json %{buildroot}%{_datadir}/kube-virt/manifests/testing/
|
2020-11-02 15:45:47 +01:00
|
|
|
|
2021-05-04 15:57:05 +02:00
|
|
|
# Install kubevirt_containers_meta build service
|
|
|
|
mkdir -p %{buildroot}%{_prefix}/lib/obs/service
|
|
|
|
install -m 0755 %{S:2} %{buildroot}%{_prefix}/lib/obs/service
|
|
|
|
install -m 0644 %{S:3} %{buildroot}%{_prefix}/lib/obs/service
|
|
|
|
|
2020-09-12 00:10:31 +02:00
|
|
|
%files virtctl
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{_bindir}/virtctl
|
|
|
|
|
|
|
|
%files virt-api
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{_bindir}/virt-api
|
|
|
|
|
|
|
|
%files container-disk
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{_bindir}/container-disk
|
|
|
|
|
|
|
|
%files virt-controller
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{_bindir}/virt-controller
|
|
|
|
|
|
|
|
%files virt-handler
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{_bindir}/virt-handler
|
|
|
|
%{_bindir}/virt-chroot
|
2021-05-06 17:38:50 +02:00
|
|
|
/virt_launcher.cil
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%files virt-launcher
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{_bindir}/virt-launcher
|
2021-07-13 07:36:49 +02:00
|
|
|
%{_bindir}/node-labeller.sh
|
2020-09-12 00:10:31 +02:00
|
|
|
|
|
|
|
%files virt-operator
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%{_bindir}/virt-operator
|
|
|
|
|
2020-11-02 15:45:47 +01:00
|
|
|
%files manifests
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%dir %{_datadir}/kube-virt
|
2021-10-26 06:40:18 +02:00
|
|
|
%dir %{_datadir}/kube-virt/manifests
|
2021-10-22 06:35:35 +02:00
|
|
|
%{_datadir}/kube-virt/manifests/release
|
2020-11-02 15:45:47 +01:00
|
|
|
|
2021-02-17 12:55:54 +01:00
|
|
|
%files tests
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%dir %{_datadir}/kube-virt
|
2021-10-26 06:40:18 +02:00
|
|
|
%dir %{_datadir}/kube-virt/manifests
|
2021-02-17 12:55:54 +01:00
|
|
|
%{_bindir}/virt-tests
|
2021-10-22 06:35:35 +02:00
|
|
|
%{_datadir}/kube-virt/manifests/testing
|
2021-02-17 12:55:54 +01:00
|
|
|
|
2021-05-04 15:57:05 +02:00
|
|
|
%files -n obs-service-kubevirt_containers_meta
|
|
|
|
%license LICENSE
|
|
|
|
%doc README.md
|
|
|
|
%dir %{_prefix}/lib/obs
|
|
|
|
%{_prefix}/lib/obs/service
|
|
|
|
|
2020-09-12 00:10:31 +02:00
|
|
|
%changelog
|