]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- added chrpath support from ra
authordjurban <djurban@pld-linux.org>
Sat, 17 May 2003 11:30:20 +0000 (11:30 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    rpm.macros -> 1.115

rpm.macros

index e4803db01168b08a2baa022f74e39dbe14bc17e1..66f9c4b304c8789e7cca65b42181c09c3237002e 100644 (file)
@@ -207,7 +207,38 @@ echo "Compress man and info pages."; \
                strip --strip-debug --remove-section=.note  --remove-section=.comment $elfarchiveslist; \
        fi; } \
 } }
-
+#-----------------------------------------------------------------
+# remove all RPATH from executable binaries and shared object files
+#
+# Requires: find, awk, cut, xargs, chrpath, uname
+#
+#%no_install_post_chrpath      1
+%__spec_install_post_chrpath {%{!?debug: \
+%{!?no_install_post_chrpath: \
+       %{?verbose:set -x;} \
+echo "Remove RPATH from executable binaries and shared object files."; \
+if [ "$(uname -m)" != alpha ] ; then \
+find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" | xargs -r file | \
+       awk '/ELF.*(executable|shared object)/ {print $1}' | cut -d: -f1 | \
+while read file ; do \
+       rpath= ; \
+       chmod u+w "$file"; \
+       for dir in `chrpath -l "$file" | \
+                   awk '/RPATH=/ { gsub(/.*RPATH=/,""); gsub(/:/," "); print $0 }'` ; do \
+                       case $dir in \
+                       /home/* | /tmp/* | /usr/lib | /lib | /usr/local/lib | /usr/X11R6/lib ) \
+                               echo "remove-rpath: $dir in $file"; \
+                               ;; \
+                       * ) \
+                               if [ "$rpath" = "" ] ; then rpath="$dir" ; \
+                               else rpath="$rpath:$dir" ; fi ; \
+                               ;; \
+                       esac ; \
+       done ; \
+       if [ "$rpath" = "" ] ; then chrpath -d "$file" > /dev/null ; \
+       else chrpath -r "$rpath" "$file" > /dev/null ; fi ; \
+done; fi; } \
+} }
 #-----------------------------------------------------------------
 # Find and gzip all kernel modules
 #
This page took 0.107506 seconds and 4 git commands to generate.