mockbuild.sh: add workarounds for c10s and el10

Add workarounds needed for mockbuild.sh to work on c10s / el10, due to
non-existent EPEL-10 and issues on c10s.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2024-07-18 22:26:50 +02:00 committed by Achilleas Koutsou
parent c9e9027faa
commit 9c9a3b7937

View file

@ -100,13 +100,27 @@ if curl --silent --fail --head --output /dev/null "${REPO_URL}/repodata/repomd.x
fi
# Mock and s3cmd is only available in EPEL for RHEL.
if [[ $ID == rhel || $ID == centos ]] && ! rpm -q epel-release; then
# TODO: Adjust this condition, once EPEL-10 is enabled
if [[ ($ID == rhel || $ID == centos) && ${VERSION_ID%.*} -lt 10 ]] && ! rpm -q epel-release; then
greenprint "📦 Setting up EPEL repository"
curl -Ls --retry 5 --output /tmp/epel.rpm \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-"${VERSION_ID%.*}".noarch.rpm
sudo dnf install -y /tmp/epel.rpm
fi
# TODO: Remove this workaround, once EPEL-10 is enabled
if [[ ($ID == rhel || $ID == centos) && ${VERSION_ID%.*} == 10 ]]; then
sudo dnf copr enable -y @osbuild/centpkg "centos-stream-10-$(uname -m)"
fi
# TODO: Remove this workaround, once https://issues.redhat.com/browse/RHEL-49567 is fixed
# We can't workaround this in mock config due to https://github.com/rpm-software-management/mock/pull/1410
if [[ $ID == centos && ${VERSION_ID%.*} == 10 ]]; then
sudo setenforce 0
sudo systemctl restart systemd-machined.service
sudo setenforce 1
fi
# Install requirements for building RPMs in mock.
greenprint "📦 Installing mock requirements"
sudo dnf -y install createrepo_c mock s3cmd podman