Blob Blame History Raw
%global krun_opts %{nil}

%if 0%{?fedora} >= 37
%ifarch aarch64 || x86_64
%global krun_support enabled
%global krun_opts --with-libkrun

# wasmedge built only for aarch64 and x86_64
%ifarch aarch64 || x86_64
%global wasm_support enabled
%global wasm_opts --with-wasmedge

%global built_tag 1.7.2
%global gen_version %(b=%{built_tag}; echo ${b/-/"~"})

Summary: OCI runtime written in C
Name: crun
Version: %{gen_version}
# Fetched from upstream
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.xz
License: GPLv2+
Release: %autorelease
ExclusiveArch: %{golang_arches}
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: go-md2man
BuildRequires: libtool
BuildRequires: gcc
BuildRequires: git-core
BuildRequires: python3
BuildRequires: libcap-devel
BuildRequires: systemd-devel
BuildRequires: yajl-devel
%if "%{krun_support}" == "enabled"
BuildRequires: libkrun-devel
%if "%{wasm_support}" == "enabled"
BuildRequires: wasmedge-devel
BuildRequires: libseccomp-devel
BuildRequires: libselinux-devel
BuildRequires: python3-libmount
BuildRequires: make
BuildRequires: glibc-static
BuildRequires: protobuf-c-devel
%ifnarch %ix86
BuildRequires: criu-devel >= 3.17.1-2
Requires: criu >= 3.17.1
Provides: oci-runtime

%{name} is a runtime for running OCI containers

%autosetup -Sgit %{name}-%{built_tag}

%configure --disable-silent-rules %{krun_opts} %{wasm_opts}

rm -rf %{buildroot}%{_prefix}/lib*
%if "%{krun_support}" == "enabled"
ln -s ../bin/%{name} %{buildroot}%{_bindir}/krun

%if "%{wasm_support}" == "enabled"
ln -s ../bin/%{name} %{buildroot}%{_bindir}/%{name}-wasm

%license COPYING

%if "%{krun_support}" == "enabled"
%package krun
Summary: OCI Runtime providing Virtualization-based process isolation capabilities.
Provides: krun
Requires: %{name} = %{version}-%{release}
Requires: libkrun

%description krun
%{name}-krun OCI Runtime providing Virtualization-based process isolation capabilities.

%files krun

%if "%{wasm_support}" == "enabled"
%package wasm
Summary: wasm support for %{name}
Requires: wasm-library
Recommends: wasmedge
Requires: %{name} = %{version}-%{release}

%description wasm
%{name}-wasm provides %{name} built with wasm support

%files wasm