Magellan Linux

Diff of /branches/mage-next/src/smage2.in

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

revision 439 by niro, Mon Mar 19 19:09:59 2007 UTC revision 832 by niro, Sun Apr 26 15:57:42 2009 UTC
# Line 4  Line 4 
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.62 2007-11-28 10:47:50 niro Exp $
8    
9  #01.10.2004  #01.10.2004
10  # added ccache support  # added ccache support
# Line 244  download_sources() Line 244  download_sources()
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
# Line 357  munpack() Line 405  munpack()
405    
406   SRCFILE=$1   SRCFILE=$1
407    
408   if [ -z "$2" ]   if [[ -z $2 ]]
409   then   then
410   DEST=${BUILDDIR}   DEST=${BUILDDIR}
411   else   else
# Line 372  munpack() Line 420  munpack()
420   IFTAR="${IFTAR##*.}"   IFTAR="${IFTAR##*.}"
421   if [[ ${IFTAR} = tar ]]   if [[ ${IFTAR} = tar ]]
422   then   then
423   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tar.bz2 unpack failed."
424     else
425     pushd ${DEST} > /dev/null
426     bzcat ${SOURCEDIR}/${PNAME}/${SRCFILE} > ${DEST}/$(basename ${SRCFILE} .bz2) || die ".bz2 unpack failed."
427     popd > /dev/null
428   fi   fi
429   ;;   ;;
430   gz)   gz)
# Line 380  munpack() Line 432  munpack()
432   IFTAR="${IFTAR##*.}"   IFTAR="${IFTAR##*.}"
433   if [[ ${IFTAR} = tar ]]   if [[ ${IFTAR} = tar ]]
434   then   then
435   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tar.gz unpack failed."
436     else
437     pushd ${DEST} > /dev/null
438     zcat ${SOURCEDIR}/${PNAME}/${SRCFILE} > ${DEST}/$(basename ${SRCFILE} .gz) || die ".gz unpack failed."
439     popd > /dev/null
440   fi   fi
441   ;;   ;;
442   tbz2)   tbz2|mpks|mpk)
443   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tbz2 unpack failed."
444   ;;   ;;
445   tgz)   tgz)
446   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tgz unpack failed."
447     ;;
448     rar)
449     unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST}  || die ".rar unpack failed."
450     ;;
451     zip|xpi)
452     unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed."
453     ;;
454     rpm)
455     pushd ${DEST} > /dev/null
456     rpm2targz ${SOURCEDIR}/${PNAME}/${SRCFILE} || die "rpm2targz: .rpm unpack failed."
457     tar --no-same-owner -xvzf ${SRCFILE/.rpm/.tar.gz} || die "tar: .rpm unpack failed."
458     if [[ -f ${DEST}/${SRCFILE/.rpm/.tar.gz} ]]
459     then
460     rm ${DEST}/${SRCFILE/.rpm/.tar.gz}
461     fi
462   ;;   ;;
463   *)   *)
464   die "munpack failed"   die "munpack failed"
# Line 399  mpatch() Line 470  mpatch()
470  {  {
471   local PATCHOPTS   local PATCHOPTS
472   local PATCHFILE   local PATCHFILE
473     local i
474    
475   PATCHOPTS=$1   PATCHOPTS=$1
476   PATCHFILE=$2   PATCHFILE=$2
477    
478     if [[ -z $2 ]]
479     then
480     PATCHFILE=$1
481    
482     ## patch level auto-detection, get patch level
483     for ((i=0; i < 10; i++))
484     do
485     patch --dry-run -Np${i} -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} > /dev/null
486     if [[ $? = 0 ]]
487     then
488     PATCHOPTS="-Np${i}"
489     break
490     fi
491     done
492     fi
493    
494   echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}"   echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}"
495   patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}   patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}
496  }  }
497    
498    mlibtoolize()
499    {
500     local opts="$@"
501     [[ -z ${opts} ]] && opts="--copy --force"
502    
503     libtoolize ${opts} || die "running: mlibtoolize ${opts}"
504    }
505    
506  minstalldocs()  minstalldocs()
507  {  {
# Line 461  setup_distcc_environment() Line 556  setup_distcc_environment()
556  {  {
557   if [ -x /usr/bin/distcc ]   if [ -x /usr/bin/distcc ]
558   then   then
559   echo "Using DistCC for compilation ..."   echo -e "${COLBLUE}---${COLGREEN} Using DistCC for compilation ...${COLDEFAULT}"
560   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"
561    
562   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"
# Line 476  setup_ccache_environment() Line 571  setup_ccache_environment()
571  {  {
572   if [ -x /usr/bin/ccache ]   if [ -x /usr/bin/ccache ]
573   then   then
574   echo "Using CCache for compilation ..."   echo -e "${COLBLUE}---${COLGREEN} Using CCache for compilation ...${COLDEFAULT}"
575   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"
576   fi   fi
577  }  }
# Line 555  EOF Line 650  EOF
650  # special tags:  # special tags:
651  #   PKGTYPE               type of pkg  #   PKGTYPE               type of pkg
652  #   INHERITS              which functions get included  #   INHERITS              which functions get included
653  #   SPECIAL_FUNCTIONS     special functions wich should also be added  #   SPECIAL_FUNCTIONS     special functions which should also be added
654  #                         warning: they get killed before the build starts !  #                         warning: they get killed before the build starts !
655  #  #
656  #   MAGE_TREE_DEST        target destination of the generated tree  #   MAGE_TREE_DEST        target destination of the generated tree
# Line 591  build_mage_script() Line 686  build_mage_script()
686   > ${dest}   > ${dest}
687    
688   # header   # header
689   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.62 2007-11-28 10:47:50 niro Exp $' >> ${dest}
690   echo  >> ${dest}   echo  >> ${dest}
691    
692   # pgkname and state   # pgkname and state
# Line 699  regen_mage_tree() Line 794  regen_mage_tree()
794   # now unset all uneeded vars to be safe   # now unset all uneeded vars to be safe
795   # unset PKGNAME <-- don't do that; smage needs this var   # unset PKGNAME <-- don't do that; smage needs this var
796   # unset to be safe (quotes needed !)   # unset to be safe (quotes needed !)
797   for i in ${SPECIAL_FUNCTIONS}  # for i in ${SPECIAL_FUNCTIONS}
798   do  # do
799   unset "${i}"  # unset "${i}"
800   done  # done
801   unset SPECIAL_FUNCTIONS   unset SPECIAL_FUNCTIONS
802   for i in ${SPECIAL_VARS}  # for i in ${SPECIAL_VARS}
803   do  # do
804   unset "${i}"  # unset "${i}"
805   done  # done
806   unset SPECIAL_VARS   unset SPECIAL_VARS
807   unset STATE   unset STATE
808   unset DESCRIPTION   unset DESCRIPTION
# Line 1044  if [[ ${CREATE_SRC_PKG_TARBALL} = true ] Line 1139  if [[ ${CREATE_SRC_PKG_TARBALL} = true ]
1139  then  then
1140   if [[ -d ${SOURCEDIR}/${PNAME} ]]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1141   then   then
1142   echo -e "${COLGREEN}Deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"
1143   rm -rf ${SOURCEDIR}/${PNAME}   rm -rf ${SOURCEDIR}/${PNAME}
1144   fi   fi
1145  fi  fi

Legend:
Removed from v.439  
changed lines
  Added in v.832