Add ForFiles replace actions to portable config for RPM 4.19

Add replace rules to inject ForFiles wrapper macros and update
%files sections to use them, fixing %%{nil} expansion issue
with RPM 4.19.
This commit is contained in:
Andrew Lukoshko 2026-02-21 16:25:28 +00:00
parent a6767a3fd1
commit 10ebf95d8b

View File

@ -6,9 +6,50 @@ actions:
- run_script:
- script: "replace_spec.sh"
cwd: "rpms"
- replace:
- target: "spec"
find: |
%define staticlibsportablearchive() %{expand:%{staticlibsportablenameimpl -- %%{1}}.tar.xz}
%define jreportablename()
replace: |
%define staticlibsportablearchive() %{expand:%{staticlibsportablenameimpl -- %%{1}}.tar.xz}
# RPM 4.19 no longer accept our double percentaged %%{nil} passed to %%{1}
# so we have to pass in "" but evaluate it, otherwise files record will include it
%define jreportablearchiveForFiles() %(echo %{jreportablearchive -- ""})
%define jdkportablearchiveForFiles() %(echo %{jdkportablearchive -- ""})
%define staticlibsportablearchiveForFiles() %(echo %{staticlibsportablearchive -- ""})
%define jreportablename()
count: 1
- target: "spec"
find: |
%{_jvmdir}/%{jreportablearchive -- %%{nil}}
%{_jvmdir}/%{jreportablearchive -- %%{nil}}.sha256sum
replace: |
%{_jvmdir}/%{jreportablearchiveForFiles}
%{_jvmdir}/%{jreportablearchiveForFiles}.sha256sum
count: 1
- target: "spec"
find: |
%{_jvmdir}/%{jdkportablearchive -- %%{nil}}
%{_jvmdir}/%{jdkportablearchive -- .debuginfo}
%{_jvmdir}/%{jdkportablearchive -- %%{nil}}.sha256sum
replace: |
%{_jvmdir}/%{jdkportablearchiveForFiles}
%{_jvmdir}/%{jdkportablearchive -- .debuginfo}
%{_jvmdir}/%{jdkportablearchiveForFiles}.sha256sum
count: 1
- target: "spec"
find: |
%{_jvmdir}/%{staticlibsportablearchive -- %%{nil}}
%{_jvmdir}/%{staticlibsportablearchive -- %%{nil}}.sha256sum
replace: |
%{_jvmdir}/%{staticlibsportablearchiveForFiles}
%{_jvmdir}/%{staticlibsportablearchiveForFiles}.sha256sum
count: 1
- changelog_entry:
- name: "eabdullin"
email: "eabdullin@almalinux.org"
- name: "Andrew Lukoshko"
email: "alukoshko@almalinux.org"
line:
- "Portable build"
- "Fix portable archive macros for RPM 4.19"