manibuilder: Add official AlmaLinux images

The dockerfile is a mix from the CentOS and the Fedora one. For Meson,
we require an additional repository, `powertools` in AlmaLinux 8 and
`crb` in AlmaLinux 9. As `ccache` is missing, we have to override $(CC).

Change-Id: I33c62a5cc9bf05c626179acb35250a8a3293f8c1
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/73473
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/util/manibuilder/Dockerfile.almalinux b/util/manibuilder/Dockerfile.almalinux
new file mode 100644
index 0000000..5904f45
--- /dev/null
+++ b/util/manibuilder/Dockerfile.almalinux
@@ -0,0 +1,29 @@
+FROM manibase
+
+RUN \
+	useradd -p locked -m mani && \
+	if dnf repolist powertools | grep -q powertools; then \
+		powertools=powertools; \
+	else \
+		powertools=crb; \
+	fi && \
+	dnf install -y --enablerepo=${powertools} \
+		ca-certificates shadow-utils \
+		git gcc make systemd-devel meson \
+		pciutils-devel libusbx-devel && \
+	{ dnf install -y libgpiod-devel || true; } && \
+	dnf clean -y all
+
+RUN mkdir -p -m 1777 /ccache
+
+ENV GIT_SSL_NO_VERIFY=1
+USER mani
+
+ARG ORIGIN=https://review.coreboot.org/flashrom-stable.git
+RUN \
+	cd && \
+	git clone ${ORIGIN} flashrom
+
+ENV DEVSHELL /bin/bash
+COPY mani-wrapper.sh /home/mani/
+ENTRYPOINT ["/bin/sh", "/home/mani/mani-wrapper.sh"]
diff --git a/util/manibuilder/Makefile b/util/manibuilder/Makefile
index 0aa503c..b81d93b 100644
--- a/util/manibuilder/Makefile
+++ b/util/manibuilder/Makefile
@@ -45,7 +45,7 @@
 	[ $$(docker image ls -q mani/$*) ] \
 		|| $(MAKE) $*-build $(if $(QUIET_SETUP),>/dev/null 2>/dev/null)
 
-$(filter centos%,$(MULTIARCH_TAGS)) anita\:7.1-sparc: CC=cc
+$(ALMALINUX_TAGS) $(filter centos%,$(MULTIARCH_TAGS)) anita\:7.1-sparc: CC=cc
 djgpp\:6.1.0: CC=ccache i586-pc-msdosdjgpp-gcc
 djgpp\:6.1.0: STRIP=i586-pc-msdosdjgpp-strip
 djgpp\:6.1.0: LIBS_BASE=../
diff --git a/util/manibuilder/Makefile.targets b/util/manibuilder/Makefile.targets
index eddfcb3..e16edef 100644
--- a/util/manibuilder/Makefile.targets
+++ b/util/manibuilder/Makefile.targets
@@ -34,6 +34,11 @@
 	  $(foreach v,v3.14 v3.13 v3.12 v3.11 v3.10 v3.9 v3.8 v3.7 v3.6, \
 	    alpine\:$(a)-$(v))) \
 
+ALMALINUX_TAGS := \
+	$(foreach a,amd64 arm64v8 ppc64le s390x, \
+	  $(foreach v,8 9, \
+	    $(a)/almalinux\:$(v)))
+
 OFFICIAL_TAGS := \
 	$(foreach a,ppc64le s390x arm64v8 amd64, \
 	  $(foreach v,37 36 35, \
@@ -44,6 +49,7 @@
 	$(foreach a,ppc64le s390x arm64v8 arm32v7 arm32v6 amd64 i386, \
 	  $(foreach v,3.17 3.16 3.15, \
 	    $(a)/alpine\:$(v))) \
+	$(ALMALINUX_TAGS)
 
 OTHER_TAGS := djgpp\:6.1.0