Skip to content

Commit

Permalink
Don't package runc for RHEL/CentOS >= 8
Browse files Browse the repository at this point in the history
Signed-off-by: Romain Geissler <romain.geissler@amadeus.com>
  • Loading branch information
Romain-Geissler-1A committed May 1, 2022
1 parent ee47082 commit 913c7d7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion rpm/containerd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,22 @@ AutoReq: no

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

# Obsolete packages
Obsoletes: containerd
%if 0%{?rhel} <= 7
Obsoletes: runc
%endif

# Conflicting packages
Conflicts: containerd
%if 0%{?rhel} <= 7
Conflicts: runc
%endif

Version: %{getenv:RPM_VERSION}
Release: %{getenv:RPM_RELEASE_VERSION}%{?dist}
Expand All @@ -51,7 +55,9 @@ URL: https://containerd.io
Source0: containerd
Source1: containerd.service
Source2: containerd.toml
%if 0%{?rhel} <= 7
Source3: runc
%endif
# container-selinux isn't a thing in suse flavors
%if %{undefined suse_version}
# amazonlinux2 doesn't have container-selinux either
Expand All @@ -64,6 +70,9 @@ Requires: libseccomp
# and libseccomp is named libseccomp2
Requires: libseccomp2
%endif
%if 0%{?rhel} >= 8
Requires: runc
%endif
BuildRequires: make
BuildRequires: gcc
BuildRequires: systemd
Expand All @@ -88,10 +97,12 @@ fi
# symlink the go source path to our build directory
ln -s /go/src/%{import_path} %{_topdir}/BUILD

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


Expand All @@ -108,7 +119,9 @@ rm -f bin/containerd-stress
bin/containerd --version
bin/ctr --version

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


%install
Expand Down

0 comments on commit 913c7d7

Please sign in to comment.