Files
kata-containers/obs-packaging/runtime/kata-runtime.spec-template
Marco Vedovati 3084801cd8 runtime: skip golang version check in OBS pkg
Skip the golang version check when building the runtime, passing to make
`SKIP_GO_VERSION_CHECK=1`. This check requires yq, that's not packaged
for most distributions and it can't be downloaded at build time on OBS.
It is the responsibility of the package maintainer to verify that the
correct golang version is used.

Fixes: #242

Signed-off-by: Marco Vedovati <mvedovati@suse.com>
2018-11-20 11:47:35 +01:00

111 lines
2.9 KiB
Plaintext

%global PREFIX /usr/
%global BINDIR %{PREFIX}/bin
%global DOMAIN github.com
%global ORG kata-containers
%global PROJECT runtime
%global IMPORTNAME %{DOMAIN}/%{ORG}/%{PROJECT}
%global GO_VERSION @GO_VERSION@
%global DEFAULT_QEMU qemu-lite-system-x86_64
%define LIBEXECDIR /usr/libexec
%undefine _missing_build_ids_terminate_build
%define debug_package %{nil}
Name: kata-runtime
# Version is expected to be started with a digit following by an alphanumeric string
# e.g. 1.0.0+git.1234567
Version: @VERSION@+git.@HASH@
Release: @RELEASE@.<B_CNT>
Source0: %{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Summary : No detailed summary available
Group : Development/Tools
License : Apache-2.0
BuildRequires: git
%if 0%{?suse_version} && 0%{?is_opensuse}
BuildRequires: openSUSE-release
%endif
%{!?el7 || !?suse_version:Requires: qemu-lite >= @qemu_lite_obs_fedora_version@ }
Requires: kata-containers-image >= @kata_osbuilder_version@
Requires: kata-linux-container >= @linux_container_version@
Requires: kata-proxy >= @kata_proxy_version@
Requires: kata-shim >= @kata_shim_version@
Requires: kata-ksm-throttler >= @ksm_throttler_version@
Requires: qemu-vanilla >= @qemu_vanilla_version@
%ifarch x86_64
Requires: qemu-lite >= @qemu_lite_version@
%endif
# Patches
@RPM_PATCH_LIST@
%description
.. contents::
.. sectnum::
``kata-runtime``
===================
Overview
--------
%prep
mkdir local
tar -C local -xzf ../SOURCES/go%{GO_VERSION}.linux-@GO_ARCH@.tar.gz
# Patches
@RPM_APPLY_PATCHES@
%setup -q
%autosetup -S git
%build
export GOROOT=$HOME/rpmbuild/BUILD/local/go
export PATH=$PATH:$HOME/rpmbuild/BUILD/local/go/bin
export GOPATH=$HOME/rpmbuild/BUILD/go/
mkdir -p $HOME/rpmbuild/BUILD/go/src/%{DOMAIN}/%{ORG}
ln -s $HOME/rpmbuild/BUILD/kata-runtime-%{version} $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME}
cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME}
make \
QEMUPATH=/usr/bin/%{DEFAULT_QEMU} \
COMMIT=@HASH@ \
SKIP_GO_VERSION_CHECK=1
%check
export http_proxy=http://127.0.0.1:9/
export https_proxy=http://127.0.0.1:9/
export no_proxy=localhost
%install
export GOROOT=$HOME/rpmbuild/BUILD/local/go
export PATH=$PATH:$HOME/rpmbuild/BUILD/local/go/bin
export GOPATH=$HOME/rpmbuild/BUILD/go/
cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME}
make \
DESTDIR=%{buildroot} \
PREFIX=/usr \
QEMUPATH=/usr/bin/%{DEFAULT_QEMU} \
COMMIT=@HASH@ \
SKIP_GO_VERSION_CHECK=1 \
install
sed -i -e '/^initrd =/d' %{buildroot}/usr/share/defaults/kata-containers/configuration.toml
%files
%defattr(-,root,root,-)
/usr/bin/kata-runtime
%{LIBEXECDIR}
%{LIBEXECDIR}/kata-containers
%{LIBEXECDIR}/kata-containers/kata-netmon
/usr/bin/kata-collect-data.sh
/usr/share/defaults/
/usr/share/defaults/kata-containers/
/usr/share/defaults/kata-containers/configuration.toml
/usr/share/bash-completion
/usr/share/bash-completion/completions
/usr/share/bash-completion/completions/kata-runtime