1 |
#!/bin/bash |
#!/bin/bash |
2 |
|
# $Id$ |
3 |
|
|
4 |
# compiles/installs .smage2 source install scripts |
# compiles/installs .smage2 source install scripts |
5 |
# needs pkgbuild_dir (mage) |
# needs pkgbuild_dir (mage) |
6 |
|
|
7 |
# SMAGE2 |
# TODO: record dynlib, gz | xz database |
|
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.62 2007-11-28 10:47:50 niro Exp $ |
|
8 |
|
|
|
#01.10.2004 |
|
|
# added ccache support |
|
|
# added distcc support |
|
9 |
|
|
10 |
# set default user mage.rc |
# set default user mage.rc |
11 |
: ${MAGERC="/etc/mage.rc"} |
: ${MAGERC="/etc/mage.rc"} |
580 |
local stripdir="$@" |
local stripdir="$@" |
581 |
|
|
582 |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
583 |
find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_LIB} 2> /dev/null |
584 |
} |
} |
585 |
|
|
586 |
mstripbins() |
mstripbins() |
588 |
local stripdir="$@" |
local stripdir="$@" |
589 |
|
|
590 |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
591 |
find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_BIN} 2> /dev/null |
592 |
|
} |
593 |
|
|
594 |
|
mstripstatic() |
595 |
|
{ |
596 |
|
local stripdir="$@" |
597 |
|
|
598 |
|
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
599 |
|
find ${stripdir} | xargs file | grep "ar archive" | cut -f 1 -d : | xargs strip ${STRIP_STATIC_LIB} 2> /dev/null |
600 |
} |
} |
601 |
|
|
602 |
mcompressdocs() |
mcompressdocs() |
1600 |
do |
do |
1601 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
1602 |
mstripbins ${BINDIR}_${subpackage} |
mstripbins ${BINDIR}_${subpackage} |
1603 |
echo -e "${COLBLUE}===${COLGREEN} stripping libraries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" |
1604 |
mstriplibs ${BINDIR}_${subpackage} |
mstriplibs ${BINDIR}_${subpackage} |
1605 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" |
1606 |
|
mstripstatic ${BINDIR}_${subpackage} |
1607 |
done |
done |
1608 |
else |
else |
1609 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
1610 |
mstripbins ${BINDIR} |
mstripbins ${BINDIR} |
1611 |
echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" |
1612 |
mstriplibs ${BINDIR} |
mstriplibs ${BINDIR} |
1613 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" |
1614 |
|
mstripstatic ${BINDIR} |
1615 |
fi |
fi |
1616 |
;; |
;; |
1617 |
esac |
esac |