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.31 2005-08-21 21:36:54 niro Exp $ |
# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.37 2005-10-02 14:23:11 niro Exp $ |
8 |
|
|
9 |
#01.10.2004 |
#01.10.2004 |
10 |
# added ccache support |
# added ccache support |
445 |
NDEPEND="${sym} ${cat}/${pname}" |
NDEPEND="${sym} ${cat}/${pname}" |
446 |
else |
else |
447 |
NDEPEND="${NDEPEND} |
NDEPEND="${NDEPEND} |
448 |
${sym} ${cat}/${pname}${target}" |
${sym} ${cat}/${pname}" |
449 |
fi |
fi |
450 |
|
|
451 |
unset cat pname pver |
unset cat pname pver |
512 |
> ${dest} |
> ${dest} |
513 |
|
|
514 |
# header |
# header |
515 |
echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.31 2005-08-21 21:36:54 niro Exp $' >> ${dest} |
echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.37 2005-10-02 14:23:11 niro Exp $' >> ${dest} |
516 |
echo >> ${dest} |
echo >> ${dest} |
517 |
|
|
518 |
# pgkname and state |
# pgkname and state |
527 |
|
|
528 |
# special tags and vars |
# special tags and vars |
529 |
echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest} |
echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest} |
530 |
|
|
531 |
|
# echo MAGE_TARGETS ## note -target is needed ! |
532 |
|
echo "MAGE_TARGETS=\"${target}\"" >> ${dest} |
533 |
|
echo >> ${dest} |
534 |
|
|
535 |
# add special vars |
# add special vars |
536 |
if [ -n "${SPECIAL_VARS}" ] |
if [ -n "${SPECIAL_VARS}" ] |
537 |
then |
then |
543 |
done |
done |
544 |
echo >> ${dest} |
echo >> ${dest} |
545 |
fi |
fi |
546 |
|
|
547 |
# add at least all includes |
# add at least all includes |
548 |
if [ -n "${INHERITS}" ] |
if [ -n "${INHERITS}" ] |
549 |
then |
then |
573 |
do |
do |
574 |
# add to mage (quotes needed !) |
# add to mage (quotes needed !) |
575 |
typeset -f "${i}" >> ${dest} |
typeset -f "${i}" >> ${dest} |
576 |
|
echo >> ${dest} |
577 |
# unset to be safe (quotes needed !) |
# unset to be safe (quotes needed !) |
578 |
#unset "${i}" <-- later to get every target built |
#unset "${i}" <-- later to get every target built |
579 |
done |
done |
644 |
unset postremove |
unset postremove |
645 |
} |
} |
646 |
|
|
647 |
|
export_inherits() |
648 |
|
{ |
649 |
|
local include="$1" |
650 |
|
shift |
651 |
|
|
652 |
|
while [ "$1" ] |
653 |
|
do |
654 |
|
local functions="$1" |
655 |
|
|
656 |
|
# sanity checks |
657 |
|
[ -z "${include}" ] && die "export_inherits(): \$include not given." |
658 |
|
[ -z "${functions}" ] && die "export_inherits(): \$functions not given." |
659 |
|
|
660 |
|
eval "${functions}() { ${include}_${functions} ; }" |
661 |
|
|
662 |
|
# debug |
663 |
|
[[ ${MAGEDEBUG} = on ]] && typeset -f "${functions}" |
664 |
|
|
665 |
|
shift |
666 |
|
done |
667 |
|
} |
668 |
|
|
669 |
# print out our version |
# print out our version |
670 |
showversion |
showversion |
671 |
echo |
echo |
775 |
exit 0 |
exit 0 |
776 |
fi |
fi |
777 |
|
|
778 |
|
# regen-mage-tree |
779 |
|
if [ "$1" == "only-regen-tree" -a -n "$2" ] |
780 |
|
then |
781 |
|
# set correct SMAGENAME |
782 |
|
SMAGENAME="$2" |
783 |
|
MD5DIR="$(dirname ${SMAGENAME})/md5" |
784 |
|
source ${SMAGENAME} || die "regen: smage2 not found" |
785 |
|
|
786 |
|
regen_mage_tree |
787 |
|
exit 0 |
788 |
|
fi |
789 |
|
|
790 |
if [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] |
if [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] |
791 |
then |
then |
792 |
die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting." |
die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting." |