126 lines
3.6 KiB
RPMSpec
126 lines
3.6 KiB
RPMSpec
#needsrootforbuild
|
|
%global debug_package %{nil}
|
|
%global kernel_version 4.19.36
|
|
|
|
%define VERSION v1.11.1
|
|
%define RELEASE 3
|
|
|
|
Name: kata-containers
|
|
Version: %{VERSION}
|
|
Release: %{RELEASE}
|
|
Summary: Kata Container integration
|
|
License: Apache 2.0
|
|
URL: https://gitee.com/src-openeuler/kata_integration
|
|
Source0: kata_integration-v1.0.0.tar.gz
|
|
Source1: kata-runtime-%{version}.tar.gz
|
|
Source2: kata-agent-%{version}.tar.gz
|
|
Source3: kata-proxy-%{version}.tar.gz
|
|
Source4: kata-shim-%{version}.tar.gz
|
|
Source5: linux-%{kernel_version}.tar.gz
|
|
|
|
BuildRoot: %_topdir/BUILDROOT
|
|
BuildRequires: automake golang gcc bc glibc-devel glibc-static busybox glib2-devel glib2 ipvsadm conntrack-tools nfs-utils
|
|
BuildRequires: patch elfutils-libelf-devel openssl-devel bison flex
|
|
|
|
%description
|
|
This is core component of Kata Container, to make it work, you need a docker engine.
|
|
|
|
%prep
|
|
%setup -q -c -a 0 -n %{name}-%{version}
|
|
%setup -q -c -a 1 -n %{name}-%{version}/runtime
|
|
%setup -q -c -a 2 -n %{name}-%{version}/agent
|
|
%setup -q -c -a 3 -n %{name}-%{version}/proxy
|
|
%setup -q -c -a 4 -n %{name}-%{version}/shim
|
|
%setup -q -c -a 5 -n kernel
|
|
|
|
# extract the kata_integration.tar.gz file
|
|
cd %{_builddir}/%{name}-%{version}
|
|
tar -xzf kata_integration-v1.0.0.tar.gz
|
|
|
|
# build kernel
|
|
cd %{_builddir}/kernel
|
|
mv kernel linux
|
|
if ls patches.tar.* >/dev/null 2>&1;then
|
|
tar -xf patches.tar.*
|
|
fi
|
|
cd %{_builddir}/kernel/linux/
|
|
%ifarch %{ix86} x86_64
|
|
cp %{_builddir}/%{name}-%{version}/hack/config-kata-x86_64 ./.config
|
|
%else
|
|
cp %{_builddir}/%{name}-%{version}/hack/config-kata-arm64 ./.config
|
|
%endif
|
|
|
|
patch_list="%{_builddir}/kernel/series.conf"
|
|
IFS=$'\n'
|
|
for patch_name in `cat $patch_list`
|
|
do
|
|
echo $patch_name
|
|
if [ "${patch_name:0:1}" != "#" ]; then
|
|
patch -p1 -F1 -s < %{_builddir}/kernel/${patch_name}
|
|
echo "add patch done : $patch_name"
|
|
fi
|
|
done
|
|
|
|
%build
|
|
cd %{_builddir}/kernel/linux/
|
|
make %{?_smp_mflags}
|
|
|
|
cd %{_builddir}/%{name}-%{version}
|
|
mkdir -p -m 750 build
|
|
make runtime
|
|
make proxy
|
|
make shim
|
|
%if 0%{?integrate_driver}
|
|
make initrd INTEGRATE_DRIVER=true
|
|
%else
|
|
make initrd
|
|
%endif
|
|
|
|
%install
|
|
mkdir -p -m 755 %{buildroot}/var/lib/kata
|
|
%ifarch %{ix86} x86_64
|
|
install -p -m 755 -D %{_builddir}/kernel/linux/arch/x86_64/boot/bzImage %{buildroot}/var/lib/kata/kernel
|
|
%else
|
|
install -p -m 755 -D %{_builddir}/kernel/linux/arch/arm64/boot/Image %{buildroot}/var/lib/kata/kernel
|
|
%endif
|
|
|
|
cd %{_builddir}/%{name}-%{version}
|
|
mkdir -p -m 750 %{buildroot}/usr/bin
|
|
install -p -m 750 ./build/kata-runtime ./build/kata-proxy ./build/kata-shim ./build/kata-netmon %{buildroot}/usr/bin/
|
|
install -p -m 640 ./build/kata-containers-initrd.img %{buildroot}/var/lib/kata/
|
|
mkdir -p -m 750 %{buildroot}/usr/share/defaults/kata-containers/
|
|
install -p -m 640 -D ./runtime/cli/config/configuration-qemu.toml %{buildroot}/usr/share/defaults/kata-containers/configuration.toml
|
|
|
|
%clean
|
|
|
|
%files
|
|
/usr/bin/kata-runtime
|
|
/usr/bin/kata-proxy
|
|
/usr/bin/kata-shim
|
|
/usr/bin/kata-netmon
|
|
/var/lib/kata/kernel
|
|
/var/lib/kata/kata-containers-initrd.img
|
|
/usr/share/defaults/kata-containers/configuration.toml
|
|
|
|
%doc
|
|
|
|
|
|
%changelog
|
|
* Sun Sep 27 2020 LiangZhang<zhangliang5@Huawei.com> - 1.11.1-3
|
|
- Type:bugfix
|
|
- ID:NA
|
|
- SUG:NA
|
|
- DESC:fix cmd params of direct use stratovirt binary
|
|
|
|
* Thu Sep 20 2020 jiangpengf<jiangpengfei9@huawei.com> - 1.1.1-2
|
|
- Type:bugfix
|
|
- ID:NA
|
|
- SUG:NA
|
|
- DESC:fix del-iface doesn't delete the tap interface in the host problem
|
|
|
|
* Thu Aug 27 2020 jiangpengf<jiangpengfei9@huawei.com> - 1.1.1-1
|
|
- Type:enhancement
|
|
- ID:NA
|
|
- SUG:NA
|
|
- DESC:update kata-containers version to v1.11.1-1
|