From b3b694c041164446007700b3cd402b8997031c75 Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Fri, 20 Mar 2009 20:51:55 -0300 Subject: [PATCH] add a emptyrpath option, to the options array add a emptyrpath option, to the option array, to removing RPATH and RUNPATH from ELF files. Don't patch the makepkg.conf so is needed to add $EMPTYRPATH_DIRS manually to it with same paths as $STRIP_DIRS See http://bugs.archlinux.org/task/13890 Signed-off-by: Gerardo Exequiel Pozzi modified: scripts/makepkg.sh.in --- scripts/makepkg.sh.in | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 0aa8a9b..a4f4457 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -43,7 +43,7 @@ startdir="$PWD" srcdir="$startdir/src" pkgdir="$startdir/pkg" -packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge') +packaging_options=('strip' 'docs' 'libtool' 'emptydirs' 'zipman' 'purge' 'emptyrpath') other_options=('ccache' 'distcc' 'makeflags' 'force') splitpkg_overrides=('pkgdesc' 'license' 'groups' 'depends' 'optdepends' 'provides' \ 'conflicts' 'replaces' 'backup' 'options' 'install') @@ -845,6 +845,20 @@ tidy_install() { done fi + if [ "$(check_option emptyrpath)" = "y" -a -n "${EMPTYRPATH_DIRS[*]}" ]; then + msg2 "$(gettext "Removing RPATH/RUNPATH from binaries and libraries...")" + local binary + find ${EMPTYRPATH_DIRS[@]} -type f 2>/dev/null | while read binary ; do + case "$(file -biz "$binary")" in + *application/x-sharedlib*) # Libraries (.so) + /usr/bin/chrpath -d "$binary";; + *application/x-executable*) # Binaries + /usr/bin/chrpath -d "$binary";; + esac + done + fi + + if [ "$(check_option libtool)" = "n" ]; then msg2 "$(gettext "Removing libtool .la files...")" find . ! -type d -name "*.la" -exec rm -f -- '{}' \; -- 1.6.2