4 |
# needs pkgbuild_dir (mage) |
# needs pkgbuild_dir (mage) |
5 |
|
|
6 |
# SMAGE2 |
# SMAGE2 |
7 |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.53 2007-03-19 19:09:59 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.57 2007-04-23 16:41:44 niro Exp $ |
8 |
|
|
9 |
#01.10.2004 |
#01.10.2004 |
10 |
# added ccache support |
# added ccache support |
244 |
fi |
fi |
245 |
fi |
fi |
246 |
done |
done |
247 |
|
elif [[ -n $(echo ${my_SRC_URI} | grep 'kde://') ]] |
248 |
|
then |
249 |
|
for mirror in ${KDE_MIRRORS} |
250 |
|
do |
251 |
|
my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|kde:/|${mirror}|g")" |
252 |
|
|
253 |
|
if [[ ${FETCHING} = true ]] |
254 |
|
then |
255 |
|
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
256 |
|
wget \ |
257 |
|
--passive-ftp \ |
258 |
|
--tries 3 \ |
259 |
|
--continue \ |
260 |
|
--progress bar \ |
261 |
|
--directory-prefix="${my_SOURCEDIR}" \ |
262 |
|
"${my_SRC_URI_MIRROR}" |
263 |
|
if [[ $? = 0 ]] |
264 |
|
then |
265 |
|
break |
266 |
|
else |
267 |
|
continue |
268 |
|
fi |
269 |
|
fi |
270 |
|
done |
271 |
|
elif [[ -n $(echo ${my_SRC_URI} | grep 'gnome://') ]] |
272 |
|
then |
273 |
|
for mirror in ${GNOME_MIRRORS} |
274 |
|
do |
275 |
|
my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|gnome:/|${mirror}|g")" |
276 |
|
|
277 |
|
if [[ ${FETCHING} = true ]] |
278 |
|
then |
279 |
|
echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}" |
280 |
|
wget \ |
281 |
|
--passive-ftp \ |
282 |
|
--tries 3 \ |
283 |
|
--continue \ |
284 |
|
--progress bar \ |
285 |
|
--directory-prefix="${my_SOURCEDIR}" \ |
286 |
|
"${my_SRC_URI_MIRROR}" |
287 |
|
if [[ $? = 0 ]] |
288 |
|
then |
289 |
|
break |
290 |
|
else |
291 |
|
continue |
292 |
|
fi |
293 |
|
fi |
294 |
|
done |
295 |
else |
else |
296 |
if [[ ${FETCHING} = true ]] |
if [[ ${FETCHING} = true ]] |
297 |
then |
then |
447 |
{ |
{ |
448 |
local PATCHOPTS |
local PATCHOPTS |
449 |
local PATCHFILE |
local PATCHFILE |
450 |
|
local i |
451 |
|
|
452 |
PATCHOPTS=$1 |
PATCHOPTS=$1 |
453 |
PATCHFILE=$2 |
PATCHFILE=$2 |
454 |
|
|
455 |
|
if [[ -z $2 ]] |
456 |
|
then |
457 |
|
PATCHFILE=$1 |
458 |
|
|
459 |
|
## patch level auto-detection, get patch level |
460 |
|
for ((i=0; i < 10; i++)) |
461 |
|
do |
462 |
|
patch --dry-run -Np${i} -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} > /dev/null |
463 |
|
if [[ $? = 0 ]] |
464 |
|
then |
465 |
|
PATCHOPTS="-Np${i}" |
466 |
|
break |
467 |
|
fi |
468 |
|
done |
469 |
|
fi |
470 |
|
|
471 |
echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}" |
echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}" |
472 |
patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} |
patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} |
473 |
} |
} |
526 |
{ |
{ |
527 |
if [ -x /usr/bin/distcc ] |
if [ -x /usr/bin/distcc ] |
528 |
then |
then |
529 |
echo "Using DistCC for compilation ..." |
echo -e "${COLBLUE}---${COLGREEN} Using DistCC for compilation ...${COLDEFAULT}" |
530 |
export PATH=/usr/$(mlibdir)/distcc/bin:${PATH} || die "distcc: could not export new $PATH" |
export PATH=/usr/$(mlibdir)/distcc/bin:${PATH} || die "distcc: could not export new $PATH" |
531 |
|
|
532 |
export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed" |
export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed" |
541 |
{ |
{ |
542 |
if [ -x /usr/bin/ccache ] |
if [ -x /usr/bin/ccache ] |
543 |
then |
then |
544 |
echo "Using CCache for compilation ..." |
echo -e "${COLBLUE}---${COLGREEN} Using CCache for compilation ...${COLDEFAULT}" |
545 |
export PATH=/usr/$(mlibdir)/ccache/bin:${PATH} || die "ccache: could not export new $PATH" |
export PATH=/usr/$(mlibdir)/ccache/bin:${PATH} || die "ccache: could not export new $PATH" |
546 |
fi |
fi |
547 |
} |
} |
656 |
> ${dest} |
> ${dest} |
657 |
|
|
658 |
# header |
# header |
659 |
echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.53 2007-03-19 19:09:59 niro Exp $' >> ${dest} |
echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.57 2007-04-23 16:41:44 niro Exp $' >> ${dest} |
660 |
echo >> ${dest} |
echo >> ${dest} |
661 |
|
|
662 |
# pgkname and state |
# pgkname and state |
764 |
# now unset all uneeded vars to be safe |
# now unset all uneeded vars to be safe |
765 |
# unset PKGNAME <-- don't do that; smage needs this var |
# unset PKGNAME <-- don't do that; smage needs this var |
766 |
# unset to be safe (quotes needed !) |
# unset to be safe (quotes needed !) |
767 |
for i in ${SPECIAL_FUNCTIONS} |
# for i in ${SPECIAL_FUNCTIONS} |
768 |
do |
# do |
769 |
unset "${i}" |
# unset "${i}" |
770 |
done |
# done |
771 |
unset SPECIAL_FUNCTIONS |
unset SPECIAL_FUNCTIONS |
772 |
for i in ${SPECIAL_VARS} |
# for i in ${SPECIAL_VARS} |
773 |
do |
# do |
774 |
unset "${i}" |
# unset "${i}" |
775 |
done |
# done |
776 |
unset SPECIAL_VARS |
unset SPECIAL_VARS |
777 |
unset STATE |
unset STATE |
778 |
unset DESCRIPTION |
unset DESCRIPTION |
1109 |
then |
then |
1110 |
if [[ -d ${SOURCEDIR}/${PNAME} ]] |
if [[ -d ${SOURCEDIR}/${PNAME} ]] |
1111 |
then |
then |
1112 |
echo -e "${COLGREEN}Deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}" |
1113 |
rm -rf ${SOURCEDIR}/${PNAME} |
rm -rf ${SOURCEDIR}/${PNAME} |
1114 |
fi |
fi |
1115 |
fi |
fi |