From 3ab3561ed0ae1f3d64d5a816b52313e9408a0190 Mon Sep 17 00:00:00 2001 From: Romain Geissler Date: Mon, 7 Mar 2022 09:32:40 +0000 Subject: [PATCH] Also build for CentOS 9. - do not "provide" runc on CentOS/RHEL >= 8 - do not build btrfs on CentOS/RHEL >= 8 - set the correct build-dependency for BTRFS on SUSE flavors and "others" Signed-off-by: Romain Geissler Signed-off-by: Sebastiaan van Stijn --- Jenkinsfile | 1 + rpm/containerd.spec | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 24d0bcb1..f900e3ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,6 +9,7 @@ def images = [ [image: "docker.io/library/amazonlinux:2", arches: ["aarch64"]], [image: "docker.io/library/centos:7", arches: ["amd64", "aarch64"]], [image: "quay.io/centos/centos:stream8", arches: ["amd64", "aarch64"]], + [image: "quay.io/centos/centos:stream9", arches: ["amd64", "aarch64"]], [image: "docker.io/library/debian:buster", arches: ["amd64", "aarch64", "armhf"]], // Debian 10 (EOL: 2024) [image: "docker.io/library/debian:bullseye", arches: ["amd64", "aarch64", "armhf"]], // Debian 11 (Next stable) [image: "docker.io/library/fedora:34", arches: ["amd64", "aarch64"]], // EOL: May 17, 2022 diff --git a/rpm/containerd.spec b/rpm/containerd.spec index 1092e748..891a3804 100644 --- a/rpm/containerd.spec +++ b/rpm/containerd.spec @@ -30,8 +30,8 @@ AutoReq: no Name: containerd.io Provides: containerd -# For some reason on rhel 8 if we "provide" runc then it makes this package unsearchable -%if 0%{!?el8:1} +# For some reason on rhel >= 8 if we "provide" runc then it makes this package unsearchable +%if %{undefined rhel} || 0%{?rhel} >= 8 Provides: runc %endif @@ -69,11 +69,17 @@ BuildRequires: gcc BuildRequires: systemd BuildRequires: libseccomp-devel -# Should only return true if `el8` (rhel8) is NOT defined -%if 0%{!?el8:1} -%if 0%{?suse_version} -BuildRequires: libbtrfs-devel +%if %{defined rhel} +%if %{rhel} < 8 +# CentOS/RHEL < 8 have btrfs support, which was removed in CentOS/RHEL 8 +BuildRequires: btrfs-progs-devel +%endif +%else +%if %{defined suse_version} +# SUSE flavors use btrfsprogs +BuildRequires: btrfsprogs %else +# Fedora / others BuildRequires: btrfs-progs-devel %endif %endif @@ -109,7 +115,8 @@ cd %{_topdir}/BUILD GO111MODULE=auto make man BUILDTAGS="seccomp selinux" -%if 1%{!?el8:1} +%if %{defined rhel} && %{?rhel} >= 8 +# btrfs support was removed in CentOS/RHEL 8 BUILDTAGS="${BUILDTAGS} no_btrfs" %endif