]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add Rocky 10 to docker and crossbuild jobs
authorNick Porter <nick@portercomputing.co.uk>
Tue, 17 Jun 2025 13:30:10 +0000 (14:30 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 28 Jul 2025 11:26:06 +0000 (12:26 +0100)
scripts/crossbuild/docker/rocky10/Dockerfile [new file with mode: 0644]
scripts/crossbuild/m4/Dockerfile.rpm.m4
scripts/docker/dists/rocky10/Dockerfile [new file with mode: 0644]
scripts/docker/dists/rocky10/docker-entrypoint.sh [new file with mode: 0755]
scripts/docker/m4/Dockerfile.m4
scripts/docker/m4/Dockerfile.rpm.m4

diff --git a/scripts/crossbuild/docker/rocky10/Dockerfile b/scripts/crossbuild/docker/rocky10/Dockerfile
new file mode 100644 (file)
index 0000000..1c9f94f
--- /dev/null
@@ -0,0 +1,91 @@
+# Auto generated for rocky10
+# from scripts/crossbuild/m4/Dockerfile.rpm.m4
+#
+# Rebuild this file with `make crossbuild.rocky10.regen`
+#
+ARG from=rockylinux/rockylinux:10
+FROM ${from} as build
+
+#
+#  Install yum
+#
+RUN dnf install -y yum
+
+#
+#  Install devtools like make and git and the EPEL
+#  repository for freetds and hiredis
+#
+RUN yum update -y
+RUN yum install -y rpmdevtools openssl epel-release git procps yum-utils \
+       rsync dnf-plugins-core
+
+
+
+RUN yum config-manager --set-enabled crb
+
+#
+#  Documentation build dependecies
+#
+
+#  - doxygen & JSON.pm
+RUN yum install -y doxygen graphviz perl-JSON
+#  - antora (npm needed)
+RUN curl -sL https://rpm.nodesource.com/setup_20.x | bash -
+RUN yum install -y nodejs
+RUN npm i -g @antora/cli@3.1.7 @antora/site-generator-default@3.1.7
+#  - pandoc
+RUN curl -o - -L $(curl -s https://api.github.com/repos/jgm/pandoc/releases/latest | grep "browser_download_url.*tar.gz" | cut -d '"' -f 4) | tar xzvf - -C /tmp/
+RUN mv /tmp/pandoc-*/bin/* /usr/local/bin
+#  - asciidoctor
+RUN yum install -y rubygems-devel
+RUN gem install asciidoctor
+
+#
+#  Setup a src dir in /usr/local
+#
+RUN mkdir -p /usr/local/src/repositories
+WORKDIR /usr/local/src/repositories
+
+
+#
+#  Shallow clone the FreeRADIUS source
+#
+WORKDIR /usr/local/src/repositories
+ARG source=https://github.com/FreeRADIUS/freeradius-server.git
+RUN git clone --depth 1 --no-single-branch ${source}
+
+#
+#  Install build dependencies for all branches from v3 onwards
+#  Nodesource has issues (no SRPMS in some repos) and is not needed here
+#  CentOS/RHEL 7 do not support "-D" for yum-builddep so do that separately below if needed
+#
+WORKDIR freeradius-server
+RUN for i in $(git for-each-ref --format='%(refname:short)' refs/remotes/origin 2>/dev/null | sed -e 's#origin/##' | egrep "^(v[3-9]*\.[0-9x]*\.x|master)$");\
+       do \
+               git checkout $i; \
+               [ -e redhat/freeradius.spec ] && yum-builddep -D "_with_rlm_yubikey 1" -y redhat/freeradius.spec; \
+       done
+
+
+RUN yum install -y libyubikey-devel
+
+#
+#  Which is required by fixture setup utilities
+#
+RUN yum install -y which
+
+#
+#  Explicitly install libnl3-devel which is required for the EAP tests
+#
+RUN yum install -y libnl3-devel
+
+#
+#  We test with TLS1.1, but that is disabled by default on some
+#  newer systems.
+#
+RUN update-crypto-policies --set LEGACY
+
+#
+#  Create the RPM build tree
+#
+RUN rpmdev-setuptree
index 714ee6e541ca01821368b72ccb5eb375546ce37e..72d4d9285b5c8e881cc56ee86270474c9e637066 100644 (file)
@@ -9,7 +9,7 @@ RUN sed -i "s/^mirrorlist/#mirrorlist/g" /etc/yum.repos.d/CentOS-*
 RUN sed -i "s|#\s*baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-*
 ')dnl
 
-ifelse(OS_VER, `9', `dnl
+ifelse(ifelse(OS_VER, 9, yes, OS_VER, 10, yes, no), yes, `dnl
 #
 #  Install yum
 #
@@ -51,7 +51,7 @@ RUN yum config-manager --set-enabled powertools
 RUN yum install -y gcc-toolset-9
 ')dnl
 
-ifelse(OS_VER, `9', `dnl
+ifelse(ifelse(OS_VER, 9, yes, OS_VER, 10, yes, no), yes, `dnl
 RUN yum config-manager --set-enabled crb
 ')dnl
 
diff --git a/scripts/docker/dists/rocky10/Dockerfile b/scripts/docker/dists/rocky10/Dockerfile
new file mode 100644 (file)
index 0000000..ae059d4
--- /dev/null
@@ -0,0 +1,128 @@
+# Auto generated for rocky10
+# from scripts/docker/m4/Dockerfile.rpm.m4
+#
+# Rebuild this file with `make docker.rocky10.regen`
+#
+ARG from=rockylinux/rockylinux:10
+FROM ${from} AS build
+
+
+#
+#  Install yum
+#
+RUN dnf install -y yum
+
+RUN rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-10
+
+#
+#  Install build tools
+#
+RUN yum groupinstall -y "Development Tools"
+
+RUN yum install -y rpmdevtools openssl dnf-utils
+
+
+#
+#  Create build directory
+#
+RUN mkdir -p /usr/local/src/repositories/freeradius-server
+WORKDIR /usr/local/src/repositories/freeradius-server/
+
+#
+#  Copy the FreeRADIUS directory in
+#
+COPY . .
+
+#
+#  Clean up tree - we want to build from the latest commit, not from
+#  any cruft left around on the local system
+#
+RUN git clean -fdxx \
+ && git reset --hard HEAD
+
+ARG release
+RUN [ -z "$release" ] || git checkout ${release} ; \
+    git status ; \
+    git log -1 --oneline
+
+#
+#  Other requirements
+#
+
+#  Enable EPEL repository for freetds and hiredis
+
+RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
+
+
+#  Enable Code Ready Builder repo (CentOS powertools equivalent)
+RUN yum install -y yum-utils
+RUN yum config-manager --enable crb
+
+#
+#  Install build dependencies
+#
+#  Run twice, it doesn't always get everything with one invocation
+#
+RUN [ -e redhat/freeradius.spec ] && \
+       yum-builddep -y redhat/freeradius.spec && \
+       yum-builddep -y redhat/freeradius.spec
+
+#
+#  Create RPM build environment
+#
+ENV BUILDDIR=/root/rpmbuild
+RUN rpmdev-setuptree
+
+RUN ./configure
+RUN cp VERSION /VERSION
+RUN make freeradius-server-$(cat /VERSION).tar.bz2
+RUN cp freeradius-server-$(cat /VERSION).tar.bz2 $BUILDDIR/SOURCES/
+RUN cp -r redhat/* $BUILDDIR/SOURCES/
+RUN sed -i "s/^Version:.*/Version: $(cat /VERSION)/" redhat/freeradius.spec
+RUN cp -r redhat/freeradius.spec $BUILDDIR/SPECS/
+WORKDIR $BUILDDIR
+
+#
+#  Build the server
+#
+ENV QA_RPATHS=0x0003
+RUN rpmbuild -bb --define "_release $(cat /VERSION)" "$BUILDDIR/SPECS/freeradius.spec"
+
+RUN mkdir /root/rpms
+RUN mv $BUILDDIR/RPMS/*/*.rpm /root/rpms/
+
+#
+#  Clean environment and run the server
+#
+FROM ${from}
+
+COPY --from=build /root/rpms /tmp/
+
+
+#
+#  Install yum
+#
+RUN dnf install -y yum
+
+
+#  EPEL repository for freetds and hiredis
+
+RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm \
+    && yum install -y dnf-utils \
+    && yum config-manager --enable crb \
+    && yum config-manager --enable epel-testing
+
+ARG radiusd_uid=95
+ARG radiusd_gid=95
+
+RUN groupadd -g ${radiusd_gid} -r radiusd \
+    && useradd -u ${radiusd_uid} -g radiusd -r -M -d /home/radiusd -s /sbin/nologin radiusd \
+    && yum install -y /tmp/*.rpm
+
+WORKDIR /
+COPY scripts/docker//etc/docker-entrypoint.sh.rpm docker-entrypoint.sh
+RUN chmod +x docker-entrypoint.sh
+
+EXPOSE 1812/udp 1813/udp
+ENTRYPOINT ["/docker-entrypoint.sh"]
+CMD ["radiusd"]
diff --git a/scripts/docker/dists/rocky10/docker-entrypoint.sh b/scripts/docker/dists/rocky10/docker-entrypoint.sh
new file mode 100755 (executable)
index 0000000..900ad6b
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+# this if will check if the first argument is a flag
+# but only works if all arguments require a hyphenated flag
+# -v; -SL; -f arg; etc will work, but not arg1 arg2
+if [ "$#" -eq 0 ] || [ "${1#-}" != "$1" ]; then
+    set -- radiusd "$@"
+fi
+
+# check for the expected command
+if [ "$1" = 'radiusd' ]; then
+    shift
+    exec radiusd -f "$@"
+fi
+
+# debian people are likely to call "freeradius" as well, so allow that
+if [ "$1" = 'freeradius' ]; then
+    shift
+    exec radiusd -f "$@"
+fi
+
+# else default to run whatever the user wanted like "bash" or "sh"
+exec "$@"
index 30559088d4412e60a0dec43ea277e91d2333cda2..23364c010d7e0a89a20c0a519283510e35fb2898 100644 (file)
@@ -30,6 +30,7 @@ ifelse(
        D_NAME, [centos8],      [p_SET([rpm], [centos], [8],    [8],            [centos:8])],
        D_NAME, [rocky8],       [p_SET([rpm], [rocky],  [8],    [8],            [rockylinux/rockylinux:8])],
        D_NAME, [rocky9],       [p_SET([rpm], [rocky],  [9],    [9],            [rockylinux/rockylinux:9])],
+       D_NAME, [rocky10],      [p_SET([rpm], [rocky],  [10],   [10],           [rockylinux/rockylinux:10])],
        [errprint(error: OS 'D_NAME' not defined[,] see __file__
 )m4exit(1)]
 )
index c943f723628de3a270ca268e727dbd12d745ab7c..56cd77544cecbb90e77863bb1fd6dffe2d323443 100644 (file)
@@ -22,6 +22,9 @@ RUN rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
 ifelse(OS_VER, 9, `dnl
 RUN rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9
 ')
+ifelse(OS_VER, 10, `dnl
+RUN rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-10
+')
 #
 #  Install build tools
 #
@@ -95,7 +98,7 @@ RUN yum config-manager --enable powertools
 #  Enable epel-testing, currently needed for hiredis-devel
 RUN yum config-manager --enable epel-testing
 ')dnl
-ifelse(OS_VER, 9, `
+ifelse(ifelse(OS_VER, 9, yes, OS_VER, 10, yes, no), yes, `
 #  Enable Code Ready Builder repo (CentOS powertools equivalent)
 RUN yum install -y yum-utils
 RUN yum config-manager --enable crb
@@ -189,7 +192,7 @@ ifelse(OS_VER, 7, `    \', `dnl
 ifelse(OS_VER, 8, `dnl
     && yum config-manager --enable powertools \
 ')dnl
-ifelse(OS_VER, 9, `dnl
+ifelse(ifelse(OS_VER, 9, yes, OS_VER, 10, yes, no), yes, `dnl
     && yum config-manager --enable crb \
 ')dnl
     && yum config-manager --enable epel-testing