4 |
# needs pkgbuild_dir (mage) |
# needs pkgbuild_dir (mage) |
5 |
|
|
6 |
# SMAGE2 |
# SMAGE2 |
7 |
# version: 0.3.6-r15 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.21 2005-08-16 23:23:26 niro Exp $ |
8 |
|
|
9 |
#01.10.2004 |
#01.10.2004 |
10 |
# added ccache support |
# added ccache support |
11 |
# added distcc support |
# added distcc support |
12 |
|
|
13 |
## setup ## |
## setup ## |
|
SMAGEVERSION=0.3.6-r15 |
|
14 |
PKGSUFFIX="mpk" |
PKGSUFFIX="mpk" |
15 |
SMAGENAME="$1" |
SMAGENAME="$1" |
16 |
SMAGESUFFIX="smage2" |
SMAGESUFFIX="smage2" |
18 |
#SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts" |
#SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts" |
19 |
#SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts" |
#SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts" |
20 |
MLIBDIR=/usr/lib/mage |
MLIBDIR=/usr/lib/mage |
21 |
|
SMAGEVERSION="$( < ${MLIBDIR}/version)" |
22 |
|
|
23 |
|
# export default C locale |
24 |
|
export LC_ALL=C |
25 |
|
|
26 |
source /etc/mage.rc |
source /etc/mage.rc |
27 |
|
|
182 |
--progress bar \ |
--progress bar \ |
183 |
--directory-prefix="${my_SOURCEDIR}" \ |
--directory-prefix="${my_SOURCEDIR}" \ |
184 |
"${my_SRC_URI}" |
"${my_SRC_URI}" |
185 |
if [ "$?" == "0" ] |
# only needed to run through a list of mirrors |
186 |
then |
# if [ "$?" == "0" ] |
187 |
break |
# then |
188 |
else |
# break |
189 |
continue |
# else |
190 |
fi |
# continue |
191 |
|
# fi |
192 |
fi |
fi |
193 |
fi |
fi |
194 |
|
|
343 |
done |
done |
344 |
} |
} |
345 |
|
|
346 |
|
mstriplibs() { |
347 |
|
local stripdir="$@" |
348 |
|
|
349 |
|
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
350 |
|
find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
351 |
|
} |
352 |
|
|
353 |
|
mstripbins() { |
354 |
|
local stripdir="$@" |
355 |
|
|
356 |
|
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
357 |
|
find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null |
358 |
|
} |
359 |
|
|
360 |
|
sminclude() { |
361 |
|
local i |
362 |
|
|
363 |
|
if [[ -n "$@" ]] |
364 |
|
then |
365 |
|
for i in $@ |
366 |
|
do |
367 |
|
echo "--- Including ${SMAGESCRIPTSDIR}/include/${i}.sminc" |
368 |
|
source ${SMAGESCRIPTSDIR}/include/${i}.sminc |
369 |
|
done |
370 |
|
echo |
371 |
|
fi |
372 |
|
} |
373 |
|
|
374 |
setup_distcc_environment(){ |
setup_distcc_environment(){ |
375 |
if [ -x /usr/bin/distcc ] |
if [ -x /usr/bin/distcc ] |
376 |
then |
then |
506 |
#download sources |
#download sources |
507 |
if [ "$1" == "download" -a -n "$2" ] |
if [ "$1" == "download" -a -n "$2" ] |
508 |
then |
then |
|
showversion |
|
509 |
if [ ! -d ${SMAGESCRIPTSDIR} ] |
if [ ! -d ${SMAGESCRIPTSDIR} ] |
510 |
then |
then |
511 |
install -d ${SMAGESCRIPTSDIR} |
install -d ${SMAGESCRIPTSDIR} |
668 |
${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info |
${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info |
669 |
fi |
fi |
670 |
|
|
671 |
|
# stripping all bins and libs |
672 |
|
case ${NOSTRIP} in |
673 |
|
true|TRUE|yes|y) |
674 |
|
echo -e "NOSTRIP=true detected; Package will not be stripped ..." |
675 |
|
;; |
676 |
|
*) |
677 |
|
echo -e "Stripping binaries ..." |
678 |
|
mstripbins ${BINDIR} |
679 |
|
echo -e "Stripping libraries ..." |
680 |
|
mstriplibs ${BINDIR} |
681 |
|
;; |
682 |
|
esac |
683 |
|
|
684 |
#the new buildpkg command |
#the new buildpkg command |
685 |
case ${NOPKGBUILD} in |
case ${NOPKGBUILD} in |
686 |
true|TRUE|yes|y) |
true|TRUE|yes|y) |
694 |
|
|
695 |
#for sure |
#for sure |
696 |
unset NOPKGBUILD |
unset NOPKGBUILD |
697 |
|
unset NOSTRIP |
698 |
|
|
699 |
xtitleclean |
xtitleclean |
700 |
#echo -e "\nPackage ${PKGNAME} successfully builded.\n" |
#echo -e "\nPackage ${PKGNAME} successfully builded.\n" |