summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorDonnie Berkholz <dberkholz@gentoo.org>2003-09-30 07:01:57 +0000
committerDonnie Berkholz <dberkholz@gentoo.org>2003-09-30 07:01:57 +0000
commit754af72aab1c77955a01d5d9a57a801a243030a1 (patch)
tree40acf4ab18d29e0434c99632389af1a36c76afa6 /eclass
parentunbreak mpg123 (diff)
downloadhistorical-754af72aab1c77955a01d5d9a57a801a243030a1.tar.gz
historical-754af72aab1c77955a01d5d9a57a801a243030a1.tar.bz2
historical-754af72aab1c77955a01d5d9a57a801a243030a1.zip
Adding stripping function.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/xfree.eclass30
1 files changed, 28 insertions, 2 deletions
diff --git a/eclass/xfree.eclass b/eclass/xfree.eclass
index 4a084a8093e3..9456a1f0b713 100644
--- a/eclass/xfree.eclass
+++ b/eclass/xfree.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/xfree.eclass,v 1.7 2003/09/30 06:17:49 spyderous Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/xfree.eclass,v 1.8 2003/09/30 07:01:57 spyderous Exp $
#
# Author: Seemant Kulleen <seemant@gentoo.org>
#
@@ -13,7 +13,7 @@
ECLASS=xfree
INHERITED="${INHERITED} ${ECLASS}"
-EXPORT_FUNCTIONS vcards is_kernel
+EXPORT_FUNCTIONS vcards is_kernel strip_bins
vcards() {
has "$1" ${VIDEO_CARDS} && return 0
@@ -49,3 +49,29 @@ is_kernel() {
return 1
fi
}
+
+# For stripping binaries, but not drivers or modules.
+strip_bins() {
+ einfo "Stripping binaries..."
+ # This bit I got from Redhat ... strip binaries and drivers ..
+ # NOTE: We do NOT want to strip the drivers, modules or DRI modules!
+ for x in $(find ${D}/ -type f -perm +0111 -exec file {} \; | \
+ grep -v ' shared object,' | \
+ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p')
+ do
+ if [ -f ${x} ]
+ then
+ # Dont do the modules ...
+ if [ "${x/\/lib\/modules}" = "${x}" ]
+ then
+ echo "`echo ${x} | sed -e "s|${D}||"`"
+ strip ${x} || :
+ fi
+ if [ "${x/\usr\/X11R6\/lib\/modules}" = "${x}" ]
+ then
+ echo "`echo ${x} | sed -e "s|${D}||"`"
+ strip ${x} || :
+ fi
+ fi
+ done
+}