rpath= ; \
chmod u+w "$file"; \
for dir in $(chrpath -l "$file" | awk '/RPATH=/ { gsub(/.*RPATH=/,""); gsub(/:/," "); print $0 }'); do \
- # translate $ORIGIN to real path, so that normalize path \
- # would work with readlink and secondly we don't need to \
- # relocate the binaries in rpm based distro \
- local f=${file#$RPM_BUILD_ROOT}; \
- local origin=${f%/*}; \
- dir=$(echo $dir | sed -e "s,\$ORIGIN,$origin,g"); \
+ case $dir in \
+ '$ORIGIN' ) \
+ if [ "$rpath" = "" ] ; then rpath="$dir" ; \
+ else rpath="$rpath:$dir" ; fi ; \
+ continue ; \
+ ;; \
+ esac ; \
dir=$(readlink -m "$dir"); \
case $dir in \
/home/* | /tmp/* | /usr/lib | /usr/lib64 | /lib | /lib64 | /usr/local/lib | /usr/local/lib64 | /usr/X11R6/lib | /usr/X11R6/lib64 ) \