Pass __strip and __objdump macros
This commit is contained in:
parent
3b777d0999
commit
1de7d81cf0
@ -3,11 +3,12 @@
|
|||||||
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
|
if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
[ -z "$STRIP" -a -n "$1" ] && STRIP="$1"
|
||||||
|
[ -z "$STRIP" ] && STRIP=strip
|
||||||
# Strip ELF binaries
|
# Strip ELF binaries
|
||||||
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
|
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
|
||||||
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
|
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
|
||||||
grep -v ' shared object,' | \
|
grep -v ' shared object,' | \
|
||||||
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
||||||
strip -g $f || :
|
$STRIP -g $f || :
|
||||||
done
|
done
|
||||||
|
@ -4,15 +4,20 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -z "$STRIP" -a -n "$1" ] && STRIP="$1"
|
||||||
|
[ -z "$OBJDUMP" -a -n "$2" ] && OBJDUMP="$2"
|
||||||
|
[ -z "$STRIP" ] && STRIP=strip
|
||||||
|
[ -z "$OBJDUMP" ] && OBJDUMP=objdump
|
||||||
|
|
||||||
# Strip .comment and .note sections (the latter only if it is not allocated)
|
# Strip .comment and .note sections (the latter only if it is not allocated)
|
||||||
# for already stripped elf files in the build root
|
# for already stripped elf files in the build root
|
||||||
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
|
for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
|
||||||
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
|
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
|
||||||
sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
|
sed -n -e 's/^\(.*\):[ ]*ELF.*, stripped/\1/p'`; do
|
||||||
note="-R .note"
|
note="-R .note"
|
||||||
if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
|
if $OBJDUMP -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
|
||||||
grep ALLOC >/dev/null; then
|
grep ALLOC >/dev/null; then
|
||||||
note=
|
note=
|
||||||
fi
|
fi
|
||||||
strip -R .comment $note $f || :
|
$STRIP -R .comment $note $f || :
|
||||||
done
|
done
|
||||||
|
@ -7,6 +7,8 @@ if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
[ -z "$STRIP" -a -n "$1" ] && STRIP="$1"
|
||||||
|
[ -z "$STRIP" ] && STRIP=strip
|
||||||
# Strip ELF shared objects
|
# Strip ELF shared objects
|
||||||
# Please note we don't restrict our search to executable files because
|
# Please note we don't restrict our search to executable files because
|
||||||
# our libraries are not (should not be, at least) +x.
|
# our libraries are not (should not be, at least) +x.
|
||||||
@ -14,5 +16,5 @@ for f in `find $RPM_BUILD_ROOT -type f -a -exec file {} \; | \
|
|||||||
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
|
grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug" | \
|
||||||
grep ' shared object,' | \
|
grep ' shared object,' | \
|
||||||
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
|
||||||
strip --strip-unneeded $f
|
$STRIP --strip-unneeded $f
|
||||||
done
|
done
|
||||||
|
4
macros
4
macros
@ -82,8 +82,8 @@
|
|||||||
|
|
||||||
%__os_install_post \
|
%__os_install_post \
|
||||||
/usr/lib/rpm/redhat/brp-compress \
|
/usr/lib/rpm/redhat/brp-compress \
|
||||||
/usr/lib/rpm/redhat/brp-strip \
|
/usr/lib/rpm/redhat/brp-strip %{__strip} \
|
||||||
/usr/lib/rpm/redhat/brp-strip-comment-note \
|
/usr/lib/rpm/redhat/brp-strip-comment-note %{__strip} %{__objdump} \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
%__spec_install_post\
|
%__spec_install_post\
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Summary: Red Hat specific rpm configuration files.
|
Summary: Red Hat specific rpm configuration files.
|
||||||
Name: redhat-rpm-config
|
Name: redhat-rpm-config
|
||||||
Version: 8.0.5
|
Version: 8.0.6
|
||||||
Release: 1
|
Release: 1
|
||||||
License: GPL
|
License: GPL
|
||||||
Group: Development/System
|
Group: Development/System
|
||||||
@ -27,6 +27,9 @@ rm -rf ${RPM_BUILD_ROOT}
|
|||||||
%{_prefix}/lib/rpm/redhat
|
%{_prefix}/lib/rpm/redhat
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Nov 21 2002 Elliot Lee <sopwith@redhat.com> 8.0.6-1
|
||||||
|
- Pass __strip and __objdump macros
|
||||||
|
|
||||||
* Thu Nov 21 2002 Elliot Lee <sopwith@redhat.com> 8.0.5-1
|
* Thu Nov 21 2002 Elliot Lee <sopwith@redhat.com> 8.0.5-1
|
||||||
- Update macros to specify find-provides/find-requires
|
- Update macros to specify find-provides/find-requires
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user