--- trunk/mage/usr/lib/mage/smage2.sh 2005/02/16 17:50:54 66 +++ trunk/mage/usr/lib/mage/smage2.sh 2005/06/01 15:49:20 79 @@ -4,7 +4,7 @@ # needs pkgbuild_dir (mage) # SMAGE2 -# version: 0.3.6-r15 +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.10 2005-06-01 15:49:20 niro Exp $ #01.10.2004 # added ccache support @@ -339,6 +339,20 @@ done } +mstriplibs() { + local stripdir="$@" + + [ -z "${stripdir}" ] && stripdir=${BINDIR} + find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +} + +mstripbins() { + local stripdir="$@" + + [ -z "${stripdir}" ] && stripdir=${BINDIR} + find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null +} + setup_distcc_environment(){ if [ -x /usr/bin/distcc ] then @@ -637,6 +651,19 @@ ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info fi +# stripping all bins and libs +case ${NOSTRIP} in + true|TRUE|yes|y) + echo -e "NOSTRIP=true detected; Package will not be stripped ..." + ;; + *) + echo -e "Stripping binaries ..." + mstripbins ${BINDIR} + echo -e "Stripping libraries ..." + mstriplibs ${BINDIR} + ;; +esac + #the new buildpkg command case ${NOPKGBUILD} in true|TRUE|yes|y)