--%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
-+%install \
-+%if %{?_enable_debug_packages:1}%{!?_enable_debug_packages:0}\
-+%if %{_enable_debug_packages}\
-+%{?buildsubdir:%{debug_package}}\
-+%endif\
-+%endif\
- %%install\
- LANG=C\
- export LANG\
-@@ -1407,7 +1421,7 @@
- %{?verbose:set -x;} \
- if [ -d "$RPM_BUILD_ROOT" ]; then \
- echo "Strip executable binaries, archives and shared object files."; \
-- filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
-+ filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
- elfexelist=`echo $filelist | xargs -r file | \
- awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
- elfsharedlist=`echo $filelist | xargs -r file | \
-diff -urN rpm-4.3.org/scripts/find-debuginfo.sh rpm-4.3/scripts/find-debuginfo.sh
---- rpm-4.3.org/scripts/find-debuginfo.sh 2004-05-31 17:16:16.146175184 +0200
-+++ rpm-4.3/scripts/find-debuginfo.sh 2004-05-31 17:16:51.153853208 +0200
-@@ -26,12 +26,14 @@
+ %__spec_install_post\
+- %{?__debug_package:%{__debug_install_post}}\
++ %{expand:%%define __sip_%{?_enable_debug_packages} 1}%{?__sip_1:%{?__debug_package:%{__debug_install_post}}}%{expand:%%undefine __sip_%{?_enable_debug_packages}}\
+ %{__arch_install_post}\
+ %{__os_install_post}\
+ %{nil}
+diff -ur rpm-4.4.6.org/scripts/find-debuginfo.sh rpm-4.4.6/scripts/find-debuginfo.sh
+--- rpm-4.4.6.org/scripts/find-debuginfo.sh 2006-02-12 15:59:51.000000000 +0100
++++ rpm-4.4.6/scripts/find-debuginfo.sh 2006-06-30 22:03:53.451126000 +0200
+@@ -15,7 +15,8 @@
+
+ strip_to_debug()
+ {
+- eu-strip --remove-comment -f "$1" "$2" || :
++ eu-strip --remove-comment -f "$1" -o "${2}.tmp" "$2" || :
++ rm -f "${2}.tmp"
+ }
+
+ # Strip ELF binaries
+@@ -30,7 +31,7 @@
+ [ -f "${debugfn}" ] && continue