tools: update epel script to allow creating an EPEL 10 override

After discussion in the 2024-11-21 FPC meeting, I am updating the epel
build script to allow creating a forge-srpm-macros-epel backport package
that overrides the EL 10 package.
The backport package will address a critical bug that has gone unfixed
in RHEL and include other features that have been added since the EL 10
branching.

Ref: https://bugzilla.redhat.com/show_bug.cgi?id=2314083
Ref: https://issues.redhat.com/browse/RHEL-60802
Ref: https://meetbot.fedoraproject.org/meeting-1_matrix_fedoraproject-org/2024-11-21/fpc.2024-11-21-17.00.log.html
This commit is contained in:
Maxwell G 2024-11-21 14:50:25 -06:00
commit 500266d299
Signed by: gotmax23
GPG key ID: F79E4E25E8C661F8
6 changed files with 33 additions and 30 deletions

View file

@ -17,9 +17,9 @@ tasks:
cd forge-srpm-macros
if [ "$(rpm -E %{?rhel})" = "9" ]; then
sudo dnf install -y epel-rpm-macros
make epel9-build
make epel-build
export \
MACRO_DIR="$(pwd)/epel9/rpm/macros.d" \
MACRO_LUA_DIR="$(pwd)/epel9/rpm/lua"
MACRO_DIR="$(pwd)/epel/rpm/macros.d" \
MACRO_LUA_DIR="$(pwd)/epel/rpm/lua"
fi
pytest -vv

4
.gitignore vendored
View file

@ -8,5 +8,5 @@ __pycache__/
/NEWS_FRAGMENT.md
/GIT_MSG
/fedora*
# Build directory used to rename files for EPEL 9 usage
/epel9/
# Build directory used to rename files for EPEL usage
/epel*/

View file

@ -12,15 +12,15 @@ install:
install -Dpm 0644 rpm/macros.d/macros.* -t $(DESTDIR)$(RPMMACRODIR)/
install -Dpm 0644 rpm/lua/fedora/srpm/*.lua -t $(DESTDIR)$(RPMLUADIR)/fedora/srpm/
# Rename macros so they can be packaged for EPEL 9 without conflicting with EL
# 9's redhat-rpm-config package.
epel9-build:
./tools/epel9_build.sh
# Rename macros so they can be packaged for EPEL without conflicting with EL's
# forge macros
epel-build:
./tools/epel_build.sh
epel9-install:
$(MAKE) -C epel9 -f ../Makefile install
epel-install:
$(MAKE) -C epel -f ../Makefile install
epel9: epel9-build epel9-install
epel: epel-build epel-install
clean:
rm -rf epel9/

View file

@ -45,15 +45,15 @@ Requires: redhat-rpm-config
%build
%if %{defined el9}
%make_build epel9-build
%if %{defined epel}
%make_build epel-build
%endif
%install
%make_build \
DESTDIR=%{buildroot} \
RPMMACRODIR=%{_rpmmacrodir} RPMLUADIR=%{_rpmluadir} %{?el9:epel9-}install
RPMMACRODIR=%{_rpmmacrodir} RPMLUADIR=%{_rpmluadir} %{?epel:epel-}install
%check
@ -67,14 +67,15 @@ export MACRO_LUA_DIR="%{buildroot}%{_rpmluadir}"
%files
%license LICENSES/GPL-1.0-or-later.txt
%doc README.md NEWS.md
%if %{undefined el9}
%if %{undefined epel}
%{_rpmluadir}/fedora/srpm/forge.lua
%{_rpmluadir}/fedora/srpm/_forge_util.lua
%{_rpmmacrodir}/macros.forge
%else
%{_rpmluadir}/fedora/srpm/forge_epel.lua
%{_rpmluadir}/fedora/srpm/_forge_epel_util.lua
%{_rpmmacrodir}/macros.zzz-forge_epel
%endif
%{_rpmluadir}/fedora/srpm/_forge_util.lua
%changelog

View file

@ -1,13 +0,0 @@
#!/bin/bash -x
# Copyright (C) 2024 Maxwell G <maxwell@gtmx.me>
# SPDX-License-Identifier: GPL-1.0-or-later
set -euo pipefail
mkdir -p epel9/rpm/macros.d epel9/rpm/lua/fedora/srpm
cp -p rpm/macros.d/macros.forge epel9/rpm/macros.d/macros.zzz-forge_epel
cp -p rpm/lua/fedora/srpm/forge.lua epel9/rpm/lua/fedora/srpm/forge_epel.lua
sed -Ei '/require "fedora.srpm.forge"/s/forge"$/forge_epel"/' \
epel9/rpm/macros.d/macros.zzz-forge_epel
# This can stay as is. The file does not exist in EL 9.
cp -p rpm/lua/fedora/srpm/_forge_util.lua epel9/rpm/lua/fedora/srpm

15
tools/epel_build.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash -x
# Copyright (C) 2024 Maxwell G <maxwell@gtmx.me>
# SPDX-License-Identifier: GPL-1.0-or-later
set -euo pipefail
rm -rf epel
mkdir -p epel/rpm/macros.d epel/rpm/lua/fedora/srpm
cp -p rpm/macros.d/macros.forge epel/rpm/macros.d/macros.zzz-forge_epel
cp -p rpm/lua/fedora/srpm/forge.lua epel/rpm/lua/fedora/srpm/forge_epel.lua
cp -p rpm/lua/fedora/srpm/_forge_util.lua epel/rpm/lua/fedora/srpm/_forge_epel_util.lua
sed -Ei \
-e '/require "fedora.srpm.forge"/s/forge"$/forge_epel"/' \
-e '/require "fedora.srpm._forge_util"/s/_forge_util"$/_forge_epel_util"/' \
epel/rpm/macros.d/macros.zzz-forge_epel epel/rpm/lua/fedora/srpm/forge_epel.lua