diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2022-11-25 08:01:41 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2022-11-25 08:01:41 +0100 |
commit | 0e8469a75c355d16dae78b2f37f77c6c6923a447 (patch) | |
tree | ec9c9c8e468085520fa53926de656838846685d8 | |
download | rpm-package-builder-0e8469a75c355d16dae78b2f37f77c6c6923a447.tar.gz |
add el9
-rw-r--r-- | .gitlab-ci.yml | 12 | ||||
-rw-r--r-- | Dockerfile | 31 | ||||
-rwxr-xr-x | configure-mirror | 50 |
3 files changed, 93 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f4e7be1 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,12 @@ +variables: + BUILD_AARCH64: "yes" + +include: + - project: 'kraxel/podman-docker-builder' + file: 'gitlab-ci-template-multiarch.yml' + +boot-aarch64: + stage: build + trigger: + project: kraxel/ec2-init-scripts + branch: boot-aarch64 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3873a82 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM quay.io/almalinux/almalinux:9 + +ENV SUMMARY="AlmaLinux 9 builder" \ + DESCRIPTION="AlmaLinux 9 image for test builds and rpm package builds." + +LABEL maintainer="Gerd Hoffmann <kraxel@redhat.com>" \ + summary="${SUMMARY}" \ + description="${DESCRIPTION}" + +USER root + +COPY configure-mirror /usr/local/bin +RUN /usr/local/bin/configure-mirror && \ + dnf update -y && \ + dnf install -y \ + 'dnf-command(builddep)' \ + 'dnf-command(config-manager)' \ + https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ + && \ + /usr/local/bin/configure-mirror && \ + dnf repolist --all && \ + dnf config-manager --set-enabled powertools && \ + dnf install -y \ + fedora-packager tito createrepo \ + autoconf automake libtool \ + make cmake meson ninja-build \ + gcc gcc-c++ binutils \ + glibc-devel openssl-devel \ + bc flex bison tree \ + && \ + dnf clean all -y diff --git a/configure-mirror b/configure-mirror new file mode 100755 index 0000000..0b0c38b --- /dev/null +++ b/configure-mirror @@ -0,0 +1,50 @@ +#!/bin/sh + +function set_baseurl() { + local furl="$1" + local turl="$2" + local name="$3" + local file + + if test "$turl" = ""; then + echo "# no mirror: $furl (env \$$name)" + return + fi + + for file in /etc/yum.repos.d/*.repo; do + if test ! -f "${file}.dist"; then + cp "${file}" "${file}.dist" + fi + grep -q -e "baseurl=$furl" "${file}.dist" || continue + echo "# mirror: $furl -> $turl ($file)" + sed -e 's/^mirrorlist/#mirrorlist/' \ + -e 's/^metalink/#metalink/' \ + -e 's/^#baseurl/baseurl/' \ + -e 's/^# baseurl/baseurl/' \ + -e "s|baseurl=${furl}|baseurl=${turl}|" \ + < "${file}.dist" > "$file" + done +} + +# +# use fixed (configurable) mirror. +# be cache proxy friendly. +# +set_baseurl http://mirror.centos.org/centos/ "${CENTOS_MIRROR}" CENTOS_MIRROR +set_baseurl http://download.fedoraproject.org/pub/epel/ "${EPEL_MIRROR}" EPEL_MIRROR +set_baseurl http://download.fedoraproject.org/pub/fedora/linux/ "${FEDORA_MIRROR}" FEDORA_MIRROR +set_baseurl http://download.example/pub/fedora/linux/ "${FEDORA_MIRROR}" FEDORA_MIRROR + +# +# no parallel downloads please. +# +if test -f /etc/dnf/dnf.conf; then + grep -q max_parallel_downloads /etc/dnf/dnf.conf ||\ + echo max_parallel_downloads=1 >> /etc/dnf/dnf.conf +fi +if test -f /etc/yum.conf; then + grep -q max_connections /etc/yum.conf ||\ + echo max_connections=1 >> /etc/yum.conf +fi + +exit 0 |