Files
kata-containers/runtime/kata-runtime.spec-template
Erick Cardona 235276fbff packages: Add spec files and update scripts
This commit adds the necessary spec files and scripts in order to be able to create
packages in OBS (Open Build System) and locally.

Fixes #15

Signed-off-by: Erick Cardona <erick.cardona.ruiz@intel.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
2018-05-14 16:13:59 -05:00

103 lines
2.8 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
%if 0%{?suse_version}
%define LIBEXECDIR %{_libdir}
%else
%define LIBEXECDIR %{_libexecdir}
%endif
%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-lite >= @qemu_lite_version@
Requires: qemu-vanilla >= @qemu_vanilla_version@
# 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}
%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 \
DESTTARGET=%{buildroot}/usr/bin/kata-runtime \
DESTCONFIG=%{buildroot}/usr/share/defaults/kata-containers/configuration.toml \
SCRIPTS_DIR=%{buildroot}/usr/bin \
QEMUPATH=/usr/bin/%{DEFAULT_QEMU} \
install
sed -i -e '/^initrd =/d' %{buildroot}/usr/share/defaults/kata-containers/configuration.toml
%files
%defattr(-,root,root,-)
/usr/bin/kata-runtime
/usr/bin/kata-collect-data.sh
/usr/share/defaults/
/usr/share/defaults/kata-containers/
/usr/share/defaults/kata-containers/configuration.toml