Magellan Linux

Diff of /trunk/mage/usr/lib/mage/smage2.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1291 by niro, Fri May 27 12:54:34 2011 UTC revision 1349 by niro, Sat Jun 4 09:45:04 2011 UTC
# Line 60  then Line 60  then
60   export BINDIR=${MROOT}/${BINDIR}   export BINDIR=${MROOT}/${BINDIR}
61  fi  fi
62    
63    # sources the smage file and uses state from distribution file if exist
64    # may helpful for repository support later on
65    smagesource()
66    {
67     local file="$1"
68     local mystate
69     local mycodename
70    
71     source ${file}
72    
73     [[ -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 ]
82     then
83     source ${SMAGESCRIPTSDIR}/distribution
84     [[ -n ${STATE} ]] && mystate="${STATE}"
85     fi
86     # now switch state and export it
87     STATE="${mystate}"
88    }
89    
90  showversion()  showversion()
91  {  {
92   echo -en "Magellan Source Install v${SMAGEVERSION} "   echo -en "Magellan Source Install v${SMAGEVERSION} "
# Line 724  build_mage_script() Line 751  build_mage_script()
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}" ]
# Line 758  build_mage_script() Line 777  build_mage_script()
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
# Line 770  build_mage_script() Line 788  build_mage_script()
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}" ]
# Line 790  build_mage_script() Line 803  build_mage_script()
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()
# Line 1188  then Line 1195  then
1195   MD5DIR="$3"   MD5DIR="$3"
1196   [[ -z ${MD5DIR} ]] && MD5DIR="$(dirname ${SMAGENAME})/md5"   [[ -z ${MD5DIR} ]] && MD5DIR="$(dirname ${SMAGENAME})/md5"
1197    
1198   source ${SMAGENAME} || die "download source failed"   smagesource ${SMAGENAME} || die "download source failed"
1199    
1200   # overridable sourcedir; must be declared after source of the smage2   # overridable sourcedir; must be declared after source of the smage2
1201   CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}"   CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}"
# Line 1262  then Line 1269  then
1269   # get smage   # get smage
1270   SMAGENAME="$2"   SMAGENAME="$2"
1271   MD5DIR="$(dirname ${SMAGENAME})/md5"   MD5DIR="$(dirname ${SMAGENAME})/md5"
1272   source ${SMAGENAME} || die "download source failed"   smagesource ${SMAGENAME} || die "download source failed"
1273    
1274   download_sources   download_sources
1275   exit 0   exit 0
# Line 1274  then Line 1281  then
1281   # set correct SMAGENAME   # set correct SMAGENAME
1282   SMAGENAME="$2"   SMAGENAME="$2"
1283   MD5DIR="$(dirname ${SMAGENAME})/md5"   MD5DIR="$(dirname ${SMAGENAME})/md5"
1284   source ${SMAGENAME} || die "regen: smage2 not found"   smagesource ${SMAGENAME} || die "regen: smage2 not found"
1285    
1286   regen_mage_tree   regen_mage_tree
1287    
# Line 1336  then Line 1343  then
1343    
1344   echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}"   echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}"
1345    
1346   source ${SMAGENAME} || die "regen: smage2 not found"   smagesource ${SMAGENAME} || die "regen: smage2 not found"
1347    
1348   if [[ -d ${SOURCEDIR}/${PNAME} ]]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1349   then   then
# Line 1385  fi Line 1392  fi
1392  [ -z "${CFLAGS}" ] && die "no CFLAGS variable found in ${MAGERC}"  [ -z "${CFLAGS}" ] && die "no CFLAGS variable found in ${MAGERC}"
1393  [ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}"  [ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}"
1394    
1395  source ${SMAGENAME} || die "source failed"  smagesource ${SMAGENAME} || die "source failed"
1396  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"
1397  MD5DIR="$(dirname ${SMAGENAME})/md5"  MD5DIR="$(dirname ${SMAGENAME})/md5"
1398  SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log"  SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log"

Legend:
Removed from v.1291  
changed lines
  Added in v.1349