Skip to content

Commit 8d03a90

Browse files
Don't package runc for RHEL/CentOS >= 8
Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
1 parent b79cc82 commit 8d03a90

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

rpm/containerd.spec

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,22 @@ AutoReq: no
3030

3131
Name: containerd.io
3232
Provides: containerd
33-
# For some reason on rhel >= 8 if we "provide" runc then it makes this package unsearchable
33+
# On RHEL >= 8 OS, runc is packaged by Red Hat so it won't be provided by this package.
3434
%if 0%{?rhel} <= 7
3535
Provides: runc
3636
%endif
3737

3838
# Obsolete packages
3939
Obsoletes: containerd
40+
%if 0%{?rhel} <= 7
4041
Obsoletes: runc
42+
%endif
4143

4244
# Conflicting packages
4345
Conflicts: containerd
46+
%if 0%{?rhel} <= 7
4447
Conflicts: runc
48+
%endif
4549

4650
Version: %{getenv:RPM_VERSION}
4751
Release: %{getenv:RPM_RELEASE_VERSION}%{?dist}
@@ -51,7 +55,9 @@ URL: https://containerd.io
5155
Source0: containerd
5256
Source1: containerd.service
5357
Source2: containerd.toml
58+
%if 0%{?rhel} <= 7
5459
Source3: runc
60+
%endif
5561
# container-selinux isn't a thing in suse flavors
5662
%if %{undefined suse_version}
5763
# amazonlinux2 doesn't have container-selinux either
@@ -64,6 +70,9 @@ Requires: libseccomp
6470
# and libseccomp is named libseccomp2
6571
Requires: libseccomp2
6672
%endif
73+
%if 0%{?rhel} >= 8
74+
Requires: runc
75+
%endif
6776
BuildRequires: make
6877
BuildRequires: gcc
6978
BuildRequires: systemd
@@ -88,10 +97,12 @@ fi
8897
# symlink the go source path to our build directory
8998
ln -s /go/src/%{import_path} %{_topdir}/BUILD
9099

100+
%if 0%{?rhel} <= 7
91101
if [ ! -d %{_topdir}/SOURCES/runc ]; then
92102
# Copy over our source code from our gopath to our source directory
93103
cp -rf /go/src/github.com/opencontainers/runc %{_topdir}/SOURCES/runc
94104
fi
105+
%endif
95106
cd %{_topdir}/BUILD/
96107

97108

@@ -108,7 +119,9 @@ rm -f bin/containerd-stress
108119
bin/containerd --version
109120
bin/ctr --version
110121

122+
%if 0%{?rhel} <= 7
111123
GO111MODULE=auto make -C /go/src/github.com/opencontainers/runc BINDIR=%{_topdir}/BUILD/bin BUILDTAGS='seccomp apparmor selinux %{runc_nokmem}' runc install
124+
%endif
112125

113126

114127
%install

0 commit comments

Comments
 (0)