Skip to content

Commit 5181390

Browse files
committed
Add package for AlmaLinux EL compatible
Should be compatible with CentOS and RHEL Remove dependency for libcgroup, on .el9
1 parent 6cea4d4 commit 5181390

File tree

5 files changed

+61
-4
lines changed

5 files changed

+61
-4
lines changed

packaging/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ The scripts will build for this list of packages types:
1313
* DEB packages for Debian 9 Stretch
1414
* RPM packages for Fedora 40
1515
* RPM packages for Fedora 39
16+
* RPM packages for AlmaLinux 8
17+
* RPM packages for AlmaLinux 9
1618
* TGZ and ZIP files with static binaries

packaging/rpm/Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ SOURCES=$(addprefix rpmbuild/SOURCES/, $(SOURCE_FILES))
4444

4545
FEDORA_RELEASES := fedora-39 fedora-40
4646
CENTOS_RELEASES :=
47+
ALMALINUX_RELEASES := almalinux-8 almalinux-9
4748

4849
.PHONY: help
4950
help: ## show make targets
@@ -55,16 +56,19 @@ clean: ## remove build artifacts
5556
$(RM) -r rpmbuild/
5657

5758
.PHONY: rpm
58-
rpm: fedora centos ## build all rpm packages
59+
rpm: fedora centos almalinux ## build all rpm packages
5960

6061
.PHONY: fedora
6162
fedora: $(FEDORA_RELEASES) ## build all fedora rpm packages
6263

6364
.PHONY: centos
64-
centos: $(CENTOS_RELEASES) ## build all centos rpm packages
65+
centos: $(CENTOS_RELEASES) ## build all centos stream rpm packages
6566

66-
.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES)
67-
$(FEDORA_RELEASES) $(CENTOS_RELEASES): $(SOURCES)
67+
.PHONY: almalinux
68+
almalinux: $(ALMALINUX_RELEASES) ## build all almalinux rpm packages
69+
70+
.PHONY: $(FEDORA_RELEASES) $(CENTOS_RELEASES) $(ALMALINUX_RELEASES)
71+
$(FEDORA_RELEASES) $(CENTOS_RELEASES) $(ALMALINUX_RELEASES): $(SOURCES)
6872
@echo "${APP_DIR}"
6973
@echo "${VERSION}"
7074
@echo "$(shell ./gen-rpm-ver $(APP_DIR) $(VERSION))"

packaging/rpm/SPECS/cri-dockerd.spec

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ Requires: (iptables or nftables)
2525
Requires: iptables
2626
%endif
2727
%if %{undefined suse_version}
28+
%if %{undefined rhel} || 0%{?rhel} < 9
29+
# Libcgroup is no longer available in RHEL/CentOS >= 9 distros.
2830
Requires: libcgroup
2931
%endif
32+
%endif
3033
Requires: containerd.io >= 1.2.2-3
3134
Requires: tar
3235
Requires: xz
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG GO_IMAGE
2+
ARG DISTRO=almalinux
3+
ARG SUITE=8
4+
ARG BUILD_IMAGE=${DISTRO}:${SUITE}
5+
6+
FROM ${GO_IMAGE} AS golang
7+
8+
FROM ${BUILD_IMAGE}
9+
ARG DISTRO
10+
ARG SUITE
11+
ENV DISTRO ${DISTRO}
12+
ENV SUITE ${SUITE}
13+
ENV GOPROXY=direct
14+
ENV GOPATH=/go
15+
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
16+
ENV AUTO_GOPATH 1
17+
ENV DOCKER_BUILDTAGS seccomp selinux
18+
ENV RUNC_BUILDTAGS seccomp selinux
19+
RUN yum install -y rpm-build rpmlint
20+
COPY SPECS /root/rpmbuild/SPECS
21+
RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec
22+
COPY --from=golang /usr/local/go /usr/local/go/
23+
WORKDIR /root/rpmbuild
24+
ENTRYPOINT ["/bin/rpmbuild"]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG GO_IMAGE
2+
ARG DISTRO=almalinux
3+
ARG SUITE=9
4+
ARG BUILD_IMAGE=${DISTRO}:${SUITE}
5+
6+
FROM ${GO_IMAGE} AS golang
7+
8+
FROM ${BUILD_IMAGE}
9+
ARG DISTRO
10+
ARG SUITE
11+
ENV DISTRO ${DISTRO}
12+
ENV SUITE ${SUITE}
13+
ENV GOPROXY=direct
14+
ENV GOPATH=/go
15+
ENV PATH $PATH:/usr/local/go/bin:$GOPATH/bin
16+
ENV AUTO_GOPATH 1
17+
ENV DOCKER_BUILDTAGS seccomp selinux
18+
ENV RUNC_BUILDTAGS seccomp selinux
19+
RUN yum install -y rpm-build rpmlint
20+
COPY SPECS /root/rpmbuild/SPECS
21+
RUN yum-builddep -y /root/rpmbuild/SPECS/*.spec
22+
COPY --from=golang /usr/local/go /usr/local/go/
23+
WORKDIR /root/rpmbuild
24+
ENTRYPOINT ["/bin/rpmbuild"]

0 commit comments

Comments
 (0)