Magellan Linux

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

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

revision 347 by niro, Sat Mar 4 23:29:45 2006 UTC revision 384 by niro, Mon Jul 17 20:44:44 2006 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.41 2006-03-04 23:29:45 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.43 2006-07-17 20:44:44 niro Exp $
8    
9  #01.10.2004  #01.10.2004
10  # added ccache support  # added ccache support
# Line 14  Line 14 
14  PKGSUFFIX="mpk"  PKGSUFFIX="mpk"
15  SMAGENAME="$1"  SMAGENAME="$1"
16  SMAGESUFFIX="smage2"  SMAGESUFFIX="smage2"
 #SOURCEDIR="/bootstrap/sources"  
 #SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts"  
 #SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts"  
17  MLIBDIR=/usr/lib/mage  MLIBDIR=/usr/lib/mage
18  SMAGEVERSION="$( < ${MLIBDIR}/version)"  SMAGEVERSION="$( < ${MLIBDIR}/version)"
19    
20    ## only for tests -> normally in /etc/rc.d/init.d/functions
21    COLRED="\033[1;6m\033[31m"
22    COLGREEN="\033[1;6m\033[32m"
23    COLYELLOW="\033[1;6m\033[33m"
24    COLBLUE="\033[1;6m\033[34m"
25    COLMAGENTA="\033[1;6m\033[35m"
26    COLWHITE="\033[1;6m\033[37m"
27    COLGRAY="\033[0;6m\033[37m"
28    COLBOLD="\033[1m"
29    COLDEFAULT="\033[0m"
30    
31    if [[ ${NOCOLORS} = true ]]
32    then
33     COLRED=""
34     COLGREEN=""
35     COLYELLOW=""
36     COLBLUE=""
37     COLMAGENTA=""
38     COLWHITE=""
39     COLGRAY=""
40     COLBOLD=""
41     COLDEFAULT=""
42    fi
43    
44  # export default C locale  # export default C locale
45  export LC_ALL=C  export LC_ALL=C
46    
# Line 166  download_sources() Line 187  download_sources()
187   do   do
188   my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|mirror:/|${mirror}/sources|g")"   my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|mirror:/|${mirror}/sources|g")"
189    
  #echo "DEBUG: ${MY_SRC_URI}"  
190   if [[ ${FETCHING} = true ]]   if [[ ${FETCHING} = true ]]
191   then   then
192   echo "==> fetching ${my_SRC_URI_MIRROR}"   echo "==> fetching ${my_SRC_URI_MIRROR}"
# Line 186  download_sources() Line 206  download_sources()
206   fi   fi
207   done   done
208   else   else
  #echo "DEBUG: ${SRC_URI[${i}]}"  
209   if [[ ${FETCHING} = true ]]   if [[ ${FETCHING} = true ]]
210   then   then
211   echo "==> fetching ${my_SRC_URI}"   echo "==> fetching ${my_SRC_URI}"
# Line 197  download_sources() Line 216  download_sources()
216   --progress bar \   --progress bar \
217   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
218   "${my_SRC_URI}"   "${my_SRC_URI}"
 # only needed to run through a list of mirrors  
 # if [ "$?" == "0" ]  
 # then  
 # break  
 # else  
 # continue  
 # fi  
219   fi   fi
220   fi   fi
221    
# Line 248  src_install() Line 260  src_install()
260   return 0   return 0
261  }  }
262    
263    mlibdir()
264    {
265     local libdir=lib
266     [[ ${ARCH} = x86_64 ]] && libdir=lib64
267    
268     echo "${libdir}"
269    }
270    
271  mconfigure()  mconfigure()
272  {  {
273   if [ -x ./configure ]   if [ -x ./configure ]
# Line 260  mconfigure() Line 280  mconfigure()
280   --datadir=/usr/share \   --datadir=/usr/share \
281   --sysconfdir=/etc \   --sysconfdir=/etc \
282   --localstatedir=/var/lib \   --localstatedir=/var/lib \
283     --libdir=/usr/$(mlibdir) \
284   "$@" || die "mconfigure failed"   "$@" || die "mconfigure failed"
285   else   else
286   echo "configure is not an executable ..."   echo "configure is not an executable ..."
# Line 277  minstall() Line 298  minstall()
298   localstatedir=${BINDIR}/var/lib \   localstatedir=${BINDIR}/var/lib \
299   mandir=${BINDIR}/usr/share/man \   mandir=${BINDIR}/usr/share/man \
300   sysconfdir=${BINDIR}/etc \   sysconfdir=${BINDIR}/etc \
301     libdir=${BINDIR}/usr/$(mlibdir) \
302   "$@" install || die "minstall failed"   "$@" install || die "minstall failed"
303          else          else
304                  die "no Makefile found"                  die "no Makefile found"
# Line 340  mpatch() Line 362  mpatch()
362   PATCHOPTS=$1   PATCHOPTS=$1
363   PATCHFILE=$2   PATCHFILE=$2
364    
365     echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}"
366   patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}   patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}
367  }  }
368    
# Line 398  setup_distcc_environment() Line 421  setup_distcc_environment()
421   if [ -x /usr/bin/distcc ]   if [ -x /usr/bin/distcc ]
422   then   then
423   echo "Using DistCC for compilation ..."   echo "Using DistCC for compilation ..."
424   export PATH=/usr/lib/distcc/bin:${PATH} || die "distcc: could not export new $PATH"   export PATH=/usr/$(mlibdir)/distcc/bin:${PATH} || die "distcc: could not export new $PATH"
   
  # export distcc as compiler  
 # export CC="distcc"  
 # export CXX=distcc  
425    
426   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"
427    
  # ccache + distcc together  
  if [[ ${SMAGE_USE_CCACHE} = true ]]  
  then  
  if [ -x /usr/bin/ccache ]  
  then  
  echo "Preparing DistCC to work together with CCache ..."  
  #export CCACHE_PREFIX="distcc" || die "distcc: could not set ccach_prefix"  
 # export CC="ccache distcc"  
 # export CXX="ccache distcc"  
  fi  
  fi  
   
428   # creating distcc tempdir   # creating distcc tempdir
429   install -o distcc -g daemon -d ${DISTCC_DIR}   install -o distcc -g daemon -d ${DISTCC_DIR}
430   chmod 1777 ${DISTCC_DIR}   chmod 1777 ${DISTCC_DIR}
# Line 429  setup_ccache_environment() Line 436  setup_ccache_environment()
436   if [ -x /usr/bin/ccache ]   if [ -x /usr/bin/ccache ]
437   then   then
438   echo "Using CCache for compilation ..."   echo "Using CCache for compilation ..."
439   export PATH=/usr/lib/ccache/bin:${PATH} || die "ccache: could not export new $PATH"   export PATH=/usr/$(mlibdir)/ccache/bin:${PATH} || die "ccache: could not export new $PATH"
  #unset CC CXX  
440   fi   fi
441  }  }
442    
# Line 541  build_mage_script() Line 547  build_mage_script()
547   > ${dest}   > ${dest}
548    
549   # header   # header
550   echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.41 2006-03-04 23:29:45 niro Exp $' >> ${dest}   echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.43 2006-07-17 20:44:44 niro Exp $' >> ${dest}
551   echo  >> ${dest}   echo  >> ${dest}
552    
553   # pgkname and state   # pgkname and state
# Line 932  export MAKEOPTS="${MAKEOPTS}" || die "MA Line 938  export MAKEOPTS="${MAKEOPTS}" || die "MA
938    
939    
940  # setup distcc  # setup distcc
941  # distcc mus be setup *before* ccache, as ccache need to be before distcc in path  # setup for distcc goes *before* ccache, so ccache comes before distcc in path
942  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment
943    
944  # setup ccache  # setup ccache
# Line 941  export MAKEOPTS="${MAKEOPTS}" || die "MA Line 947  export MAKEOPTS="${MAKEOPTS}" || die "MA
947  # small sleep to show our settings  # small sleep to show our settings
948  sleep 1  sleep 1
949    
 #debug  
 #echo "CC=${CC}"  
 #echo "CXX=${CXX}"  
 #echo "DISTCC_DIR=${DISTCC_DIR}"  
 #echo "PATH: ${PATH}"  
 #echo "--------------------------------------"  
 #env  
 #echo "--------------------------------------"  
 #read  
 #debug end  
   
950  # cleans up build if a previously one exists  # cleans up build if a previously one exists
951  if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
952  then  then
# Line 1067  esac Line 1062  esac
1062  # for sure  # for sure
1063  unset NOPKGBUILD  unset NOPKGBUILD
1064  unset NOSTRIP  unset NOSTRIP
1065    
1066  xtitleclean  xtitleclean
 #echo -e "\nPackage ${PKGNAME} successfully builded.\n"  

Legend:
Removed from v.347  
changed lines
  Added in v.384