71 |
source ${file} |
source ${file} |
72 |
|
|
73 |
[[ -n ${STATE} ]] && mystate="${STATE}" |
[[ -n ${STATE} ]] && mystate="${STATE}" |
74 |
|
|
75 |
|
# do not overide if local state was broken or disabled! |
76 |
|
case ${STATE} in |
77 |
|
broken) return ;; |
78 |
|
disabled) return ;; |
79 |
|
esac |
80 |
|
|
81 |
if [ -f ${SMAGESCRIPTSDIR}/distribution ] |
if [ -f ${SMAGESCRIPTSDIR}/distribution ] |
82 |
then |
then |
83 |
source ${SMAGESCRIPTSDIR}/distribution |
source ${SMAGESCRIPTSDIR}/distribution |
751 |
# now build the mage file |
# now build the mage file |
752 |
> ${dest} |
> ${dest} |
753 |
|
|
|
# header |
|
|
echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.62 2007-11-28 10:47:50 niro Exp $' >> ${dest} |
|
|
echo >> ${dest} |
|
|
|
|
754 |
# pgkname and state |
# pgkname and state |
755 |
echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest} |
echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest} |
756 |
echo "STATE=\"${STATE}\"" >> ${dest} |
echo "STATE=\"${STATE}\"" >> ${dest} |
|
echo >> ${dest} |
|
757 |
|
|
758 |
# description and homepage |
# description and homepage |
759 |
echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest} |
echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest} |
760 |
echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest} |
echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest} |
|
echo >> ${dest} |
|
761 |
|
|
762 |
# special tags and vars |
# special tags and vars |
763 |
echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest} |
echo "PKGTYPE=\"${PKGTYPE}\"" >> ${dest} |
764 |
|
|
765 |
# echo MAGE_TARGETS ## note -target is needed ! |
# echo MAGE_TARGETS ## note -target is needed ! |
766 |
echo "MAGE_TARGETS=\"${target}\"" >> ${dest} |
echo "MAGE_TARGETS=\"${target}\"" >> ${dest} |
|
echo >> ${dest} |
|
767 |
|
|
768 |
# split package base |
# split package base |
769 |
echo "SPLIT_PACKAGE_BASE=\"${split_pkg_base}\"" >> ${dest} |
echo "SPLIT_PACKAGE_BASE=\"${split_pkg_base}\"" >> ${dest} |
|
echo >> ${dest} |
|
770 |
|
|
771 |
# add special vars |
# add special vars |
772 |
if [ -n "${SPECIAL_VARS}" ] |
if [ -n "${SPECIAL_VARS}" ] |
777 |
# being tricky here :) |
# being tricky here :) |
778 |
echo "${i}=\"$(eval echo \$${i})\"" >> ${dest} |
echo "${i}=\"$(eval echo \$${i})\"" >> ${dest} |
779 |
done |
done |
|
echo >> ${dest} |
|
780 |
fi |
fi |
781 |
|
|
782 |
# add at least all includes |
# add at least all includes |
788 |
do |
do |
789 |
echo -n " ${i}" >> ${dest} |
echo -n " ${i}" >> ${dest} |
790 |
done |
done |
|
echo >> ${dest} |
|
791 |
fi |
fi |
|
echo >> ${dest} |
|
792 |
|
|
793 |
# deps and provides |
# deps and provides |
794 |
echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest} |
echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest} |
|
echo >> ${dest} |
|
795 |
echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest} |
echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest} |
|
echo >> ${dest} |
|
796 |
echo "PROVIDE=\"${PROVIDE}\"" >> ${dest} |
echo "PROVIDE=\"${PROVIDE}\"" >> ${dest} |
|
echo >> ${dest} |
|
797 |
|
|
798 |
# add special functions |
# add special functions |
799 |
if [ -n "${SPECIAL_FUNCTIONS}" ] |
if [ -n "${SPECIAL_FUNCTIONS}" ] |
803 |
do |
do |
804 |
# add to mage (quotes needed !) |
# add to mage (quotes needed !) |
805 |
typeset -f "${i}" >> ${dest} |
typeset -f "${i}" >> ${dest} |
|
echo >> ${dest} |
|
806 |
# unset to be safe (quotes needed !) |
# unset to be safe (quotes needed !) |
807 |
#unset "${i}" <-- later to get every target built |
#unset "${i}" <-- later to get every target built |
808 |
done |
done |
|
echo >> ${dest} |
|
809 |
fi |
fi |
810 |
|
|
811 |
# pre|post-install|removes |
# pre|post-install|removes |
812 |
typeset -f preinstall >> ${dest} |
typeset -f preinstall >> ${dest} |
|
echo >> ${dest} |
|
813 |
typeset -f postinstall >> ${dest} |
typeset -f postinstall >> ${dest} |
|
echo >> ${dest} |
|
814 |
typeset -f preremove >> ${dest} |
typeset -f preremove >> ${dest} |
|
echo >> ${dest} |
|
815 |
typeset -f postremove >> ${dest} |
typeset -f postremove >> ${dest} |
|
echo >> ${dest} |
|
816 |
} |
} |
817 |
|
|
818 |
regen_mage_tree() |
regen_mage_tree() |