-
Notifications
You must be signed in to change notification settings - Fork 309
/
crun.spec
143 lines (124 loc) · 3.4 KB
/
crun.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
%global krun_opts %{nil}
%global wasmedge_opts %{nil}
%global yajl_opts %{nil}
%if %{defined copr_username}
%define copr_build 1
%endif
# krun and wasm support only on aarch64 and x86_64
%ifarch aarch64 || x86_64
# Disable wasmedge on rhel 10 until EPEL10 is in place, otherwise it causes
# build issues on copr
%if %{defined fedora} || (%{defined copr_build} && %{defined rhel} && 0%{?rhel} < 10)
%global wasm_support 1
%global wasmedge_support 1
%global wasmedge_opts --with-wasmedge
%endif
# krun only exists on fedora
%if %{defined fedora}
%global krun_support 1
%global krun_opts --with-libkrun
%endif
%endif
%if %{defined fedora} || (%{defined rhel} && 0%{?rhel} < 10)
%global system_yajl 1
%else
%global yajl_opts --enable-embedded-yajl
%endif
Summary: OCI runtime written in C
Name: crun
%if %{defined copr_build}
Epoch: 102
%endif
# DO NOT TOUCH the Version string!
# The TRUE source of this specfile is:
# https://github.com/containers/crun/blob/main/rpm/crun.spec
# If that's what you're reading, Version must be 0, and will be updated by Packit for
# copr and koji builds.
# If you're reading this on dist-git, the version is automatically filled in by Packit.
Version: 0
Release: %autorelease
URL: https://github.com/containers/%{name}
Source0: %{url}/releases/download/%{version}/%{name}-%{version}.tar.zst
License: GPL-2.0-only
%if %{defined golang_arches_future}
ExclusiveArch: %{golang_arches_future}
%else
ExclusiveArch: aarch64 ppc64le riscv64 s390x x86_64
%endif
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: gcc
BuildRequires: git-core
BuildRequires: gperf
BuildRequires: libcap-devel
%if %{defined krun_support}
BuildRequires: libkrun-devel
%endif
BuildRequires: systemd-devel
%if %{defined system_yajl}
BuildRequires: yajl-devel
%endif
BuildRequires: libseccomp-devel
BuildRequires: python3-libmount
BuildRequires: libtool
BuildRequires: protobuf-c-devel
%ifnarch riscv64
BuildRequires: criu-devel >= 3.17.1-2
Recommends: criu >= 3.17.1
Recommends: criu-libs
%endif
%if %{defined wasmedge_support}
BuildRequires: wasmedge-devel
%endif
BuildRequires: python
Provides: oci-runtime
%description
%{name} is a OCI runtime
%if %{defined krun_support}
%package krun
Summary: %{name} with libkrun support
Requires: libkrun
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Provides: krun = %{?epoch:%{epoch}:}%{version}-%{release}
%description krun
krun is a symlink to the %{name} binary, with libkrun as an additional dependency.
%endif
%if %{defined wasm_support}
%package wasm
Summary: %{name} with wasm support
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
# wasm packages are not present on RHEL yet and are currently a PITA to test
# Best to only include wasmedge as weak dep on rhel
%if %{defined fedora}
Requires: wasm-library
%endif
Recommends: wasmedge
%description wasm
%{name}-wasm is a symlink to the %{name} binary, with wasm as an additional dependency.
%endif
%prep
%autosetup -Sgit -n %{name}-%{version}
%build
./autogen.sh
./configure --disable-silent-rules %{krun_opts} %{wasmedge_opts} %{yajl_opts}
%make_build
%install
%make_install prefix=%{_prefix}
rm -rf %{buildroot}%{_prefix}/lib*
%files
%license COPYING
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1.gz
%if %{defined krun_support}
%files krun
%license COPYING
%{_bindir}/krun
%{_mandir}/man1/krun.1.gz
%endif
%if %{defined wasm_support}
%files wasm
%license COPYING
%{_bindir}/%{name}-wasm
%endif
%changelog
%autochangelog