Avoid noise from python bytecompile on non-python pkgs (RhBug:539635)
[platform/upstream/rpm.git] / scripts / brp-strip
1 #!/bin/sh
2 # If using normal root, avoid changing anything.
3 if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
4         exit 0
5 fi
6
7 case `uname -a` in
8 Darwin*) exit 0 ;;
9 *) ;;
10 esac
11
12 # Strip ELF binaries
13 for f in `find $RPM_BUILD_ROOT -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
14         grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug"  | \
15         grep -v ' shared object,' | \
16         sed -n -e 's/^\(.*\):[  ]*ELF.*, not stripped/\1/p'`; do
17         strip -g "$f" || :
18 done