Magellan Linux

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

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

revision 439 by niro, Mon Mar 19 19:09:59 2007 UTC revision 497 by niro, Thu Jun 7 13:16:03 2007 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.58 2007-06-07 13:16:03 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 399  mpatch() Line 447  mpatch()
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  }  }
474    
475    mlibtoolize()
476    {
477     local opts="$@"
478     [[ -z ${opts} ]] && opts="--copy --force"
479    
480     libtoolize ${opts} || die "running: mlibtoolize ${opts}"
481    }
482    
483  minstalldocs()  minstalldocs()
484  {  {
# Line 461  setup_distcc_environment() Line 533  setup_distcc_environment()
533  {  {
534   if [ -x /usr/bin/distcc ]   if [ -x /usr/bin/distcc ]
535   then   then
536   echo "Using DistCC for compilation ..."   echo -e "${COLBLUE}---${COLGREEN} Using DistCC for compilation ...${COLDEFAULT}"
537   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"
538    
539   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 548  setup_ccache_environment()
548  {  {
549   if [ -x /usr/bin/ccache ]   if [ -x /usr/bin/ccache ]
550   then   then
551   echo "Using CCache for compilation ..."   echo -e "${COLBLUE}---${COLGREEN} Using CCache for compilation ...${COLDEFAULT}"
552   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"
553   fi   fi
554  }  }
# Line 591  build_mage_script() Line 663  build_mage_script()
663   > ${dest}   > ${dest}
664    
665   # header   # header
666   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.58 2007-06-07 13:16:03 niro Exp $' >> ${dest}
667   echo  >> ${dest}   echo  >> ${dest}
668    
669   # pgkname and state   # pgkname and state
# Line 699  regen_mage_tree() Line 771  regen_mage_tree()
771   # now unset all uneeded vars to be safe   # now unset all uneeded vars to be safe
772   # unset PKGNAME <-- don't do that; smage needs this var   # unset PKGNAME <-- don't do that; smage needs this var
773   # unset to be safe (quotes needed !)   # unset to be safe (quotes needed !)
774   for i in ${SPECIAL_FUNCTIONS}  # for i in ${SPECIAL_FUNCTIONS}
775   do  # do
776   unset "${i}"  # unset "${i}"
777   done  # done
778   unset SPECIAL_FUNCTIONS   unset SPECIAL_FUNCTIONS
779   for i in ${SPECIAL_VARS}  # for i in ${SPECIAL_VARS}
780   do  # do
781   unset "${i}"  # unset "${i}"
782   done  # done
783   unset SPECIAL_VARS   unset SPECIAL_VARS
784   unset STATE   unset STATE
785   unset DESCRIPTION   unset DESCRIPTION
# Line 1044  if [[ ${CREATE_SRC_PKG_TARBALL} = true ] Line 1116  if [[ ${CREATE_SRC_PKG_TARBALL} = true ]
1116  then  then
1117   if [[ -d ${SOURCEDIR}/${PNAME} ]]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1118   then   then
1119   echo -e "${COLGREEN}Deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"
1120   rm -rf ${SOURCEDIR}/${PNAME}   rm -rf ${SOURCEDIR}/${PNAME}
1121   fi   fi
1122  fi  fi

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