Merge "allow rpm to custom systemd installation" into tizen
[platform/upstream/rpm.git] / scripts / brp-strip-static-archive
1 #!/bin/sh
2
3 if [ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ]; then
4         exit 0
5 fi
6
7 STRIP=${1:-strip}
8
9 case `uname -a` in
10 Darwin*) exit 0 ;;
11 *) ;;
12 esac
13
14 # Strip static libraries.
15 for f in `find "$RPM_BUILD_ROOT" -type f -a -exec file {} \; | \
16         grep -v "^${RPM_BUILD_ROOT}/\?usr/lib/debug"  | \
17         grep 'current ar archive' | \
18         sed -n -e 's/^\(.*\):[  ]*current ar archive/\1/p'`; do
19         $STRIP -g "$f"
20 done