Magellan Linux

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

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

revision 350 by niro, Sat Mar 4 23:29:45 2006 UTC revision 351 by niro, Wed Mar 22 17:45:49 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.42 2006-03-22 17:45:49 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 398  setup_distcc_environment() Line 420  setup_distcc_environment()
420   if [ -x /usr/bin/distcc ]   if [ -x /usr/bin/distcc ]
421   then   then
422   echo "Using DistCC for compilation ..."   echo "Using DistCC for compilation ..."
423   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  
424    
425   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"
426    
  # 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  
   
427   # creating distcc tempdir   # creating distcc tempdir
428   install -o distcc -g daemon -d ${DISTCC_DIR}   install -o distcc -g daemon -d ${DISTCC_DIR}
429   chmod 1777 ${DISTCC_DIR}   chmod 1777 ${DISTCC_DIR}
# Line 429  setup_ccache_environment() Line 435  setup_ccache_environment()
435   if [ -x /usr/bin/ccache ]   if [ -x /usr/bin/ccache ]
436   then   then
437   echo "Using CCache for compilation ..."   echo "Using CCache for compilation ..."
438   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  
439   fi   fi
440  }  }
441    
# Line 541  build_mage_script() Line 546  build_mage_script()
546   > ${dest}   > ${dest}
547    
548   # header   # header
549   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.42 2006-03-22 17:45:49 niro Exp $' >> ${dest}
550   echo  >> ${dest}   echo  >> ${dest}
551    
552   # pgkname and state   # pgkname and state
# Line 932  export MAKEOPTS="${MAKEOPTS}" || die "MA Line 937  export MAKEOPTS="${MAKEOPTS}" || die "MA
937    
938    
939  # setup distcc  # setup distcc
940  # 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
941  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment
942    
943  # setup ccache  # setup ccache
# Line 941  export MAKEOPTS="${MAKEOPTS}" || die "MA Line 946  export MAKEOPTS="${MAKEOPTS}" || die "MA
946  # small sleep to show our settings  # small sleep to show our settings
947  sleep 1  sleep 1
948    
 #debug  
 #echo "CC=${CC}"  
 #echo "CXX=${CXX}"  
 #echo "DISTCC_DIR=${DISTCC_DIR}"  
 #echo "PATH: ${PATH}"  
 #echo "--------------------------------------"  
 #env  
 #echo "--------------------------------------"  
 #read  
 #debug end  
   
949  # cleans up build if a previously one exists  # cleans up build if a previously one exists
950  if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
951  then  then
# Line 1067  esac Line 1061  esac
1061  # for sure  # for sure
1062  unset NOPKGBUILD  unset NOPKGBUILD
1063  unset NOSTRIP  unset NOSTRIP
1064    
1065  xtitleclean  xtitleclean
 #echo -e "\nPackage ${PKGNAME} successfully builded.\n"  

Legend:
Removed from v.350  
changed lines
  Added in v.351