Skip to content

Commit

Permalink
Replace yum with dnf
Browse files Browse the repository at this point in the history
The default since RHEL 8, which is the oldest FRv4 builds on.
  • Loading branch information
ndptech committed May 13, 2024
1 parent aa2e073 commit 4c65cbb
Show file tree
Hide file tree
Showing 11 changed files with 98 additions and 122 deletions.
42 changes: 21 additions & 21 deletions .github/workflows/ci-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,24 +84,24 @@ jobs:
echo 'gpgcheck=1' >> /etc/yum.repos.d/ltb-project.repo
echo 'gpgkey=https://www.ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project' >> /etc/yum.repos.d/ltb-project.repo
rpm --import https://www.ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project
yum install -y epel-release
dnf install -y epel-release
- name: Enable PowerTools / CRB
run: |
yum install -y yum-utils dnf-plugins-core
yum config-manager --enable PowerTools || :
yum config-manager --enable powertools || :
yum config-manager --enable crb || :
dnf install -y dnf-utils dnf-plugins-core
dnf config-manager --enable PowerTools || :
dnf config-manager --enable powertools || :
dnf config-manager --enable crb || :
- name: Enable EPEL for Rocky Linux 9
if: ${{ matrix.env.NAME == 'rocky-9' }}
run: |
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
# For pkill
- name: Enable procps-ng
run: |
yum install -y procps-ng
dnf install -y procps-ng
- name: Set up NetworkRADIUS extras repository
run: |
Expand All @@ -115,7 +115,7 @@ jobs:
- name: Install common tools
run: |
yum install -y rpm-build openssl make gcc perl git-core
dnf install -y rpm-build openssl make gcc perl git-core
- uses: actions/checkout@v4
with:
Expand All @@ -127,7 +127,7 @@ jobs:
#
- name: Install build dependencies
run: |
yum-builddep -y freeradius.spec && yum-builddep -y freeradius.spec
dnf builddep -y freeradius.spec && dnf builddep -y freeradius.spec
working-directory: freeradius/redhat

- name: Build RPMs
Expand All @@ -151,7 +151,7 @@ jobs:
# Build eapol_test using a minimal make environment to avoid configuring
- name: Build eapol_test
run: |
yum install -y libnl3-devel which
dnf install -y libnl3-devel which
[ -r /opt/rh/devtoolset-8/enable ] && source /opt/rh/devtoolset-8/enable || :
scripts/ci/eapol_test-build.sh
mv scripts/ci/eapol_test/eapol_test ../rpms
Expand All @@ -170,7 +170,7 @@ jobs:
#
- name: "Debug: Package dependancies for tmate"
run: |
yum install -y xz
dnf install -y xz
ln -s /bin/true /bin/apt-get
if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }}

Expand Down Expand Up @@ -226,24 +226,24 @@ jobs:
echo 'gpgcheck=1' >> /etc/yum.repos.d/ltb-project.repo
echo 'gpgkey=https://www.ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project' >> /etc/yum.repos.d/ltb-project.repo
rpm --import https://www.ltb-project.org/documentation/_static/RPM-GPG-KEY-LTB-project
yum install -y epel-release
dnf install -y epel-release
- name: Enable PowerTools / CRB
run: |
yum install -y yum-utils dnf-plugins-core
yum config-manager --enable PowerTools || :
yum config-manager --enable powertools || :
yum config-manager --enable crb || :
dnf install -y dnf-utils dnf-plugins-core
dnf config-manager --enable PowerTools || :
dnf config-manager --enable powertools || :
dnf config-manager --enable crb || :
- name: Enable EPEL for Rocky Linux 9
if: ${{ matrix.env.NAME == 'rocky-9' }}
run: |
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
# For pkill
- name: Enable procps-ng
run: |
yum install -y procps-ng
dnf install -y procps-ng
- name: Load RPMs
uses: actions/download-artifact@v4
Expand All @@ -252,7 +252,7 @@ jobs:

- name: Install RPMs
run: |
yum install -y *.rpm
dnf install -y *.rpm
- name: Config check
run: |
Expand All @@ -264,7 +264,7 @@ jobs:
#
- name: Install pre-built eapol_test
run: |
yum install -y libnl3 make gdb which
dnf install -y libnl3 make gdb which
mv eapol_test /usr/local/bin
chmod +x /usr/local/bin/eapol_test
Expand Down Expand Up @@ -296,7 +296,7 @@ jobs:
#
- name: "Debug: Package dependancies for tmate"
run: |
yum install -y xz
dnf install -y xz
ln -s /bin/true /bin/apt-get
if: ${{ github.ref == 'refs/heads/ci-debug' && failure() }}

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,8 @@ rpmbuild/SOURCES/freeradius-server-$(PKG_VERSION).tar.bz2: freeradius-server-$(P
@cp $< $@

rpm: rpmbuild/SOURCES/freeradius-server-$(PKG_VERSION).tar.bz2
@if ! $(SUDO) yum-builddep ${YUM_BUILDDEP_FLAGS} -q -C --assumeno redhat/freeradius.spec 1> rpmbuild/builddep.log 2>&1; then \
echo "ERROR: Required dependencies not found, install them with: yum-builddep redhat/freeradius.spec"; \
@if ! $(SUDO) dnf builddep ${YUM_BUILDDEP_FLAGS} -q -C --assumeno redhat/freeradius.spec 1> rpmbuild/builddep.log 2>&1; then \
echo "ERROR: Required dependencies not found, install them with: dnf builddep redhat/freeradius.spec"; \
cat rpmbuild/builddep.log; \
exit 1; \
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OpenLDAP LTB packages available under the
"Packaging and OpenLDAP extensions" heading https://ltb-project.org/documentation[here].

You should add the appropriate repository definitions and install the `openldap`
package (`yum install openldap` or `apt-get install openldap`).
package (`dnf install openldap` or `apt-get install openldap`).

=== Define site specific variables
Change the values here to match local paths and your site specific
Expand Down
4 changes: 2 additions & 2 deletions doc/antora/modules/howto/pages/modules/sql/odbc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ Install the MS SQL Tools package:

[source,shell]
----
yum install mssql-tools
dnf install mssql-tools
----

Verify that non-ODBC connectivity to the database server functions correctly
Expand Down Expand Up @@ -153,7 +153,7 @@ Install the package for Microsoft ODBC Driver for SQL Server:

[source,shell]
----
yum install msodbcsql17 unixodbc
dnf install msodbcsql17 unixodbc
----


Expand Down
4 changes: 2 additions & 2 deletions doc/antora/modules/installation/pages/dependencies.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ https://talloc.samba.org/talloc/doc/html/index.html

```
# subscription-manager repos --enable rhel-7-server-optional-rpms
# yum install libtalloc-dev
# dnf install libtalloc-dev
```

=== kqueue
Expand All @@ -54,5 +54,5 @@ _kqueue is already available, there is nothing to install._

```
# subscription-manager repos --enable rhel-7-server-optional-rpms
# yum install libkqueue-dev
# dnf install libkqueue-dev
```
22 changes: 11 additions & 11 deletions scripts/docker/build/rocky8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ RUN rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
#
# Install build tools
#
RUN yum groupinstall -y "Development Tools"
RUN dnf groupinstall -y "Development Tools"

RUN yum install -y rpmdevtools openssl dnf-utils
RUN dnf install -y rpmdevtools openssl dnf-utils


#
Expand Down Expand Up @@ -61,21 +61,21 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project'\
RUN rpm --import https://ltb-project.org/lib/RPM-GPG-KEY-LTB-project

# Enable EPEL repository for freetds and hiredis
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

# Enable powertools repo
RUN yum config-manager --enable powertools
RUN dnf config-manager --enable powertools

# Enable epel-testing, currently needed for hiredis-devel
RUN yum config-manager --enable epel-testing
RUN dnf config-manager --enable epel-testing

#
# 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
dnf builddep -y redhat/freeradius.spec && \
dnf builddep -y redhat/freeradius.spec

#
# Create RPM build environment
Expand Down Expand Up @@ -136,16 +136,16 @@ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-LTB-project'\


# EPEL repository for freetds and hiredis
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
&& yum install -y dnf-utils \
&& yum config-manager --enable epel-testing
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
&& dnf install -y dnf-utils \
&& dnf 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
&& dnf install -y /tmp/*.rpm

WORKDIR /
COPY scripts/docker/etc/docker-entrypoint.sh.rpm docker-entrypoint.sh
Expand Down
18 changes: 9 additions & 9 deletions scripts/docker/build/rocky8/Dockerfile.cb
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@ FROM ${from} as build
# 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 \
RUN dnf update -y
RUN dnf install -y rpmdevtools openssl epel-release git procps dnf-utils \
rsync dnf-plugins-core


RUN yum config-manager --set-enabled powertools
RUN dnf config-manager --set-enabled powertools

#
# Install GCC that has the requisite support for C11 keywords and atomics
#
RUN yum install -y gcc-toolset-9
RUN dnf install -y gcc-toolset-9


#
# Documentation build dependencies
#

# - doxygen & JSON.pm
RUN yum install -y doxygen graphviz perl-JSON
RUN dnf 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 dnf 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 dnf install -y rubygems-devel
RUN gem install asciidoctor

#
Expand Down Expand Up @@ -85,13 +85,13 @@ 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[4-9]*\.[0-9x]*\.x|master)$");\
do \
git checkout $i; \
[ -e redhat/freeradius.spec ] && yum-builddep -y redhat/freeradius.spec; \
[ -e redhat/freeradius.spec ] && dnf builddep -y redhat/freeradius.spec; \
done

#
# A few extra packages needed for tests
#
RUN yum install -y \
RUN dnf install -y \
libnl3-devel \
libyubikey-devel \
oathtool \
Expand Down
33 changes: 13 additions & 20 deletions scripts/docker/build/rocky9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ FROM ${from} as build

RUN rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9

#
# Ensure yum is installed. Some docker images only have microdnf
#
RUN if [ ! -e /usr/bin/yum ]; then if [ -e /usr/bin/dnf ]; then dnf install -y yum; else microdnf install -y yum; fi; fi

#
# Install build tools
#
RUN yum groupinstall -y "Development Tools"
RUN dnf groupinstall -y "Development Tools"

RUN yum install -y rpmdevtools openssl dnf-utils
RUN dnf install -y rpmdevtools openssl dnf-utils


#
Expand Down Expand Up @@ -56,19 +51,19 @@ RUN git clean -fdxx \
#

# Enable EPEL repository for freetds and hiredis
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

# Enable Code Ready Builder repo (CentOS powertools equivalent)
RUN yum install -y yum-utils
RUN yum config-manager --enable crb
RUN dnf install -y dnf-utils
RUN dnf 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
dnf builddep -y redhat/freeradius.spec && \
dnf builddep -y redhat/freeradius.spec

#
# Create RPM build environment
Expand Down Expand Up @@ -118,23 +113,21 @@ RUN rpm --import https://packages.networkradius.com/pgp/packages@networkradius.c
# Other requirements
#

RUN if [ ! -e /usr/bin/yum ]; then if [ -e /usr/bin/dnf ]; then dnf install -y yum; else microdnf install -y yum; fi; fi

# Needed for mysql-libs on Rocky 9
RUN yum install -y yum-utils
RUN yum config-manager --enable crb
RUN dnf install -y dnf-utils
RUN dnf config-manager --enable crb

# EPEL repository for freetds and hiredis
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
&& yum install -y dnf-utils \
&& yum config-manager --enable epel-testing
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
&& dnf install -y dnf-utils \
&& dnf 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
&& dnf install -y /tmp/*.rpm

WORKDIR /
COPY scripts/docker/etc/docker-entrypoint.sh.rpm docker-entrypoint.sh
Expand Down
Loading

0 comments on commit 4c65cbb

Please sign in to comment.