mkosi: Skip debuginfo workaround on newer rpm

The corresponding bug was fixed in rpm 4.20 (of which the alpha is in
rawhide as rpm 4.19.91) so skip the workaround when we detect a newer
rpm version.
This commit is contained in:
Daan De Meyer
2024-05-30 22:16:13 +02:00
parent 8c335463d9
commit 3b046883ad
2 changed files with 9 additions and 5 deletions
@@ -20,13 +20,15 @@ else
TS="${SOURCE_DATE_EPOCH:-$(date +%s)}"
fi
# Fix the %install override so debuginfo packages are generated even when --build-in-place is used.
# See https://github.com/rpm-software-management/rpm/issues/3042.
tee --append /usr/lib/rpm/redhat/macros <<'EOF'
if systemd-analyze compare-versions "$(rpm --version | cut -d ' ' -f3)" lt "4.19.91"; then
# Fix the %install override so debuginfo packages are generated even when --build-in-place is used.
# See https://github.com/rpm-software-management/rpm/issues/3042.
tee --append /usr/lib/rpm/redhat/macros <<'EOF'
%install %{?_enable_debug_packages:%{debug_package}}\
%%install\
%{nil}
EOF
fi
VERSION="$(cat meson.version)"
RELEASE="$(date "+%Y%m%d%H%M%S" --date "@$TS")"
@@ -26,12 +26,14 @@ fi
# extension.
find "pkg/$ID" -name "files.*" -exec sed --in-place 's/\.gz$//' {} \;
# Fix the %install override so debuginfo packages are generated.
tee --append /usr/lib/rpm/suse/macros <<'EOF'
if systemd-analyze compare-versions "$(rpm --version | cut -d ' ' -f3)" lt "4.20"; then
# Fix the %install override so debuginfo packages are generated.
tee --append /usr/lib/rpm/suse/macros <<'EOF'
%install %{debug_package}\
%%install\
%{nil}
EOF
fi
VERSION="$(cat meson.version)"
RELEASE="$(date "+%Y%m%d%H%M%S" --date "@$TS")"