--- trunk/mage/usr/lib/mage/smage2.sh 2005/02/16 17:50:54 66 +++ trunk/mage/usr/lib/mage/smage2.sh 2005/08/09 14:17:15 183 @@ -4,14 +4,14 @@ # 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.20 2005-08-09 14:17:15 niro Exp $ #01.10.2004 # added ccache support # added distcc support ## setup ## -SMAGEVERSION=0.3.6-r15 +SMAGEVERSION=0.3.7-r1 PKGSUFFIX="mpk" SMAGENAME="$1" SMAGESUFFIX="smage2" @@ -20,6 +20,9 @@ #SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts" MLIBDIR=/usr/lib/mage +# export default C locale +export LC_ALL=C + source /etc/mage.rc showversion() { @@ -179,12 +182,13 @@ --progress bar \ --directory-prefix="${my_SOURCEDIR}" \ "${my_SRC_URI}" - if [ "$?" == "0" ] - then - break - else - continue - fi +# only needed to run through a list of mirrors +# if [ "$?" == "0" ] +# then +# break +# else +# continue +# fi fi fi @@ -339,6 +343,34 @@ 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 +} + +sminclude() { + local i + + if [[ -n "$@" ]] + then + for i in $@ + do + echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" + source ${SMAGESCRIPTSDIR}/include/${i}.sminc + done + echo + fi +} + setup_distcc_environment(){ if [ -x /usr/bin/distcc ] then @@ -474,7 +506,6 @@ #download sources if [ "$1" == "download" -a -n "$2" ] then - showversion if [ ! -d ${SMAGESCRIPTSDIR} ] then install -d ${SMAGESCRIPTSDIR} @@ -637,6 +668,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) @@ -650,6 +694,7 @@ #for sure unset NOPKGBUILD +unset NOSTRIP xtitleclean #echo -e "\nPackage ${PKGNAME} successfully builded.\n"