[b3a8c23b] | 1 | # Extract %%__os_install_post into os_install_post~ |
---|
[2f9c5897] | 2 | cat << \EOF > os_install_post~ |
---|
[b3a8c23b] | 3 | %__os_install_post |
---|
| 4 | EOF |
---|
| 5 | |
---|
| 6 | # Generate customized brp-*scripts |
---|
| 7 | cat os_install_post~ | while read a x y; do |
---|
| 8 | case $a in |
---|
| 9 | # Prevent brp-strip* from trying to handle foreign binaries |
---|
| 10 | */brp-strip*) |
---|
| 11 | b=$(basename $a) |
---|
| 12 | sed -e 's,find $RPM_BUILD_ROOT,find $RPM_BUILD_ROOT%_bindir $RPM_BUILD_ROOT%_libexecdir,' $a > $b |
---|
| 13 | chmod a+x $b |
---|
| 14 | ;; |
---|
| 15 | %if "%{_prefix}" != "/usr" |
---|
| 16 | # Fix up brp-compress to handle %%_prefix != /usr |
---|
| 17 | */brp-compress*) |
---|
| 18 | b=$(basename $a) |
---|
[7afdf54c] | 19 | sed -e 's,\./usr/,.%{_prefix}/,g' < $a > $b |
---|
[b3a8c23b] | 20 | chmod a+x $b |
---|
| 21 | ;; |
---|
| 22 | %endif |
---|
| 23 | esac |
---|
| 24 | done |
---|
| 25 | |
---|
| 26 | sed -e 's,^[ ]*/usr/lib/rpm.*/brp-strip,./brp-strip,' \ |
---|
| 27 | %if "%{_prefix}" != "/usr" |
---|
| 28 | -e 's,^[ ]*/usr/lib/rpm.*/brp-compress,./brp-compress,' \ |
---|
| 29 | %endif |
---|
| 30 | < os_install_post~ > os_install_post |
---|
| 31 | %define __os_install_post . ./os_install_post |
---|
| 32 | |
---|
| 33 | |
---|
[c046309] | 34 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
[b3a8c23b] | 35 | #!/bin/sh |
---|
[58255f77] | 36 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/@tool_target@/(lib|include|sys-root)' \ |
---|
[9af225c] | 37 | | grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/@tool_target@/' | %__find_provides |
---|
[b3a8c23b] | 38 | EOF |
---|
[c046309] | 39 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
| 40 | %define __find_provides %{_builddir}/%{name}-%{gcc_rpmvers}/find-provides |
---|
[b3a8c23b] | 41 | |
---|
[c046309] | 42 | cat << EOF > %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
[b3a8c23b] | 43 | #!/bin/sh |
---|
[58255f77] | 44 | grep -E -v '^${RPM_BUILD_ROOT}%{_exec_prefix}/@tool_target@/(lib|include|sys-root)' \ |
---|
[9af225c] | 45 | | grep -v '^${RPM_BUILD_ROOT}%{_gcclibdir}/gcc/@tool_target@/' | %__find_requires |
---|
[b3a8c23b] | 46 | EOF |
---|
[c046309] | 47 | chmod +x %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
| 48 | %define __find_requires %{_builddir}/%{name}-%{gcc_rpmvers}/find-requires |
---|
[c7373465] | 49 | |
---|
[f8552286] | 50 | %ifnarch noarch |
---|
[156764a6] | 51 | # Extract %%__debug_install_post into debug_install_post~ |
---|
| 52 | cat << \EOF > debug_install_post~ |
---|
| 53 | %__debug_install_post |
---|
| 54 | EOF |
---|
| 55 | |
---|
| 56 | # Generate customized debug_install_post script |
---|
| 57 | cat debug_install_post~ | while read a x y; do |
---|
| 58 | case $a in |
---|
| 59 | # Prevent find-debuginfo.sh* from trying to handle foreign binaries |
---|
| 60 | */find-debuginfo.sh) |
---|
| 61 | b=$(basename $a) |
---|
| 62 | sed -e 's,find "$RPM_BUILD_ROOT" !,find "$RPM_BUILD_ROOT"%_bindir "$RPM_BUILD_ROOT"%_libexecdir !,' $a > $b |
---|
| 63 | chmod a+x $b |
---|
| 64 | ;; |
---|
| 65 | esac |
---|
| 66 | done |
---|
| 67 | |
---|
| 68 | sed -e 's,^[ ]*/usr/lib/rpm/find-debuginfo.sh,./find-debuginfo.sh,' \ |
---|
| 69 | < debug_install_post~ > debug_install_post |
---|
| 70 | %define __debug_install_post . ./debug_install_post |
---|
| 71 | |
---|
[f8552286] | 72 | %endif |
---|
[156764a6] | 73 | |
---|