From 500266d29925745bf8f45851eab8f7c938534314 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Thu, 21 Nov 2024 14:50:25 -0600 Subject: [PATCH] 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 --- .builds/9.yml | 6 +++--- .gitignore | 4 ++-- Makefile | 14 +++++++------- forge-srpm-macros.spec | 11 ++++++----- tools/epel9_build.sh | 13 ------------- tools/epel_build.sh | 15 +++++++++++++++ 6 files changed, 33 insertions(+), 30 deletions(-) delete mode 100755 tools/epel9_build.sh create mode 100755 tools/epel_build.sh diff --git a/.builds/9.yml b/.builds/9.yml index 966ff6b..0cb6bfd 100644 --- a/.builds/9.yml +++ b/.builds/9.yml @@ -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 diff --git a/.gitignore b/.gitignore index 4e9faa1..9b95f4f 100644 --- a/.gitignore +++ b/.gitignore @@ -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*/ diff --git a/Makefile b/Makefile index f1d9a30..a9b6e91 100644 --- a/Makefile +++ b/Makefile @@ -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/ diff --git a/forge-srpm-macros.spec b/forge-srpm-macros.spec index 4d51174..64d053b 100644 --- a/forge-srpm-macros.spec +++ b/forge-srpm-macros.spec @@ -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 diff --git a/tools/epel9_build.sh b/tools/epel9_build.sh deleted file mode 100755 index 6f04423..0000000 --- a/tools/epel9_build.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -x -# Copyright (C) 2024 Maxwell G -# 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 diff --git a/tools/epel_build.sh b/tools/epel_build.sh new file mode 100755 index 0000000..81270b0 --- /dev/null +++ b/tools/epel_build.sh @@ -0,0 +1,15 @@ +#!/bin/bash -x +# Copyright (C) 2024 Maxwell G +# 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