%{__arch_install_post}\
%{__os_install_post}\
%{nil}
---- rpm-4.5/scripts/find-debuginfo.sh 2008-05-22 14:11:01.000000000 +0300
-+++ rpm-4.5/scripts/find-debuginfo.sh 2008-08-27 21:28:20.669206923 +0300
-@@ -1,32 +1,50 @@
+--- rpm-4.5.debuginfo/scripts/find-debuginfo.sh 2007-08-31 04:07:02.000000000 +0300
++++ rpm-4.5/scripts/find-debuginfo.sh 2008-10-05 00:49:03.834523059 +0300
+@@ -1,36 +1,54 @@
#!/bin/sh
-#find-debuginfo.sh - automagically generate debug info and file list
-#for inclusion in an rpm spec file.
+ debugfn="$debugdn/$bn"
+ [ -f "$debugfn" ] && continue
- echo extracting debug info from $f
-@@ -37,7 +55,7 @@
- [ -f "$debugfn" ] && continue
-
echo extracting debug info from $f
- /usr/lib/rpm/4.5/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug -l "$SOURCEFILE" "$f"
+ /usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug -l "$SOURCEFILE" "$f"
# A binary already copied into /usr/lib/debug doesn't get stripped,
# just has its file names collected and adjusted.
+@@ -38,20 +56,21 @@
+ /usr/lib/debug/*) continue ;;
+ esac
+
+- mkdir -p "${debugdn}"
++ mkdir -p "$debugdn"
+ if test -w "$f"; then
+- strip_to_debug "${debugfn}" "$f"
++ strip_to_debug "$debugfn" "$f"
+ else
+ chmod u+w "$f"
+- strip_to_debug "${debugfn}" "$f"
++ strip_to_debug "$debugfn" "$f"
+ chmod u-w "$f"
+ fi
+ done
+
+-mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug
+-cat $SOURCEFILE | (cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0mL ${RPM_BUILD_ROOT}/usr/src/debug)
++mkdir -p $RPM_BUILD_ROOT/usr/src/debug
++cat $SOURCEFILE | (cd $RPM_BUILD_DIR; LANG=C sort -z -u | fgrep -zv '<built-in>' | cpio --quiet -pd0mL $RPM_BUILD_ROOT/usr/src/debug)
+ # stupid cpio creates new directories in mode 0700, fixup
+-find ${RPM_BUILD_ROOT}/usr/src/debug -type d -print0 | xargs -0 chmod a+rx
++find $RPM_BUILD_ROOT/usr/src/debug -type d -print0 | xargs -0 chmod a+rx
+
+-find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTFILE
+-find ${RPM_BUILD_ROOT}/usr/src/debug -mindepth 1 -maxdepth 1 | sed -n -e "s#^$RPM_BUILD_ROOT##p" >> $LISTFILE
++find $RPM_BUILD_ROOT/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTFILE
++find $RPM_BUILD_ROOT/usr/lib/debug -mindepth 1 -type d | sed -n -e "s#^$RPM_BUILD_ROOT#%dir #p" >> $LISTFILE
++find $RPM_BUILD_ROOT/usr/src/debug -mindepth 1 -maxdepth 1 | sed -n -e "s#^$RPM_BUILD_ROOT##p" >> $LISTFILE
---- rpm-4.5/scripts/rpm2cpio~ 2007-06-11 08:56:55.000000000 +0300
-+++ rpm-4.5/scripts/rpm2cpio 2008-08-19 10:31:53.658158936 +0300
-@@ -31,6 +31,6 @@
+--- rpm-4.5/scripts/rpm2cpio 2008-08-19 10:31:53.658158936 +0300
++++ rpm-4.4.9/scripts/rpm2cpio 2008-10-05 00:44:53.976068978 +0300
+@@ -24,13 +24,13 @@
+ o=`expr $o + $hdrsize`
+
+-comp=`dd if="$pkg" ibs=$o skip=1 count=1 2>/dev/null \
+- | dd bs=3 count=1 2>/dev/null`
++comp=$(dd if="$pkg" ibs=$o skip=1 count=1 2>/dev/null \
++ | dd bs=3 count=1 2> /dev/null)
+
+-gz="`echo . | awk '{ printf("%c%c", 0x1f, 0x8b); }'`"
++gz="$(echo -en '\037\0213')"
+ case "$comp" in
BZh) dd if="$pkg" ibs=$o skip=1 2>/dev/null | bunzip2 ;;
"$gz"*) dd if="$pkg" ibs=$o skip=1 2>/dev/null | gunzip ;;
# no magic in old lzma format, if unknown we assume that's lzma for now
- *) dd if="$pkg" ibs=$o skip=1 2>/dev/null | lzma d -si -so ;;
-+ *) dd if="$pkg" ibs=$o skip=1 2>/dev/null | lzma --format=alone -d ;;
++ *) dd if="$pkg" ibs=$o skip=1 2>/dev/null | lzma -dc - ;;
#*) echo "Unrecognized rpm file: $pkg"; return 1 ;;
esac