Magellan Linux

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

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

revision 255 by niro, Mon Oct 3 20:54:14 2005 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.38 2005-10-03 20:54:14 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    
47  source /etc/mage.rc  source /etc/mage.rc
48    
49  showversion() {  # set PKGDIR and BUILDDIR and BINDIR to MROOT
50    if [[ -n ${MROOT} ]]
51    then
52     export PKGDIR=${MROOT}/${PKGDIR}
53     export BUILDDIR=${MROOT}/${BUILDDIR}
54     export BINDIR=${MROOT}/${BINDIR}
55    fi
56    
57    showversion()
58    {
59   echo -en "Magellan Source Install v${SMAGEVERSION} "   echo -en "Magellan Source Install v${SMAGEVERSION} "
60   echo -e  "-- Niels Rogalla (niro@magellan-linux.de)"   echo -e  "-- Niels Rogalla (niro@magellan-linux.de)"
61  }  }
62    
63  die() {  die()
64    {
65   xtitleclean   xtitleclean
66   echo "SMAGE failed: $@"   echo "SMAGE failed: $@"
67   exit 1   exit 1
68  }  }
69    
70  xtitle() {  xtitle()
71   if [ ${TERM} == "xterm" ]  {
72     if [[ ${TERM} = xterm ]]
73   then   then
74   echo -ne "\033]0;[sMage: $@]\007"   echo -ne "\033]0;[sMage: $@]\007"
75   fi   fi
76   return 0   return 0
77  }  }
78    
79  xtitleclean() {  xtitleclean()
80   if [ ${TERM} == "xterm" ]  {
81     if [[ ${TERM} = xterm ]]
82   then   then
83   echo -ne "\033]0;\007"   echo -ne "\033]0;\007"
84   fi   fi
85   return 0   return 0
86  }  }
87    
88  syncsmage2() {  syncsmage2()
89    {
90   xtitle "Updating smage2-script tree ..."   xtitle "Updating smage2-script tree ..."
91   local i   local i
92   for i in ${SMAGE2RSYNC}   for i in ${SMAGE2RSYNC}
# Line 71  syncsmage2() { Line 105  syncsmage2() {
105   --delete \   --delete \
106   --delete-after \   --delete-after \
107   ${i} ${SMAGESCRIPTSDIR}   ${i} ${SMAGESCRIPTSDIR}
108    
109   if [ "$?" == "0" ]   if [[ $? = 0 ]]
110   then   then
111   break   break
112   else   else
113   continue   continue
114   fi   fi
115    
116   done   done
117    
118   #clean up backup files (foo~)   # clean up backup files (foo~)
119   find ${SMAGESCRIPTSDIR} -name *~ -exec rm '{}' ';'   find ${SMAGESCRIPTSDIR} -name *~ -exec rm '{}' ';'
120    
121   xtitleclean   xtitleclean
122  }  }
123    
124  # $1 filename  # $1 filename
125  get_db_md5_sum() {  get_db_md5_sum()
126    {
127   local DB_FILE   local DB_FILE
128   local MD5_FILE   local MD5_FILE
129   local i   local i
# Line 101  get_db_md5_sum() { Line 136  get_db_md5_sum() {
136   echo "${i}"   echo "${i}"
137  }  }
138    
139  download_sources() {  download_sources()
140    {
141    
142   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0
143    
# Line 113  download_sources() { Line 149  download_sources() {
149   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
150   local FETCHING   local FETCHING
151   local i mirror   local i mirror
   
152    
153   #install SRCDIR/PNAME if not exist  
154     # install SRCDIR/PNAME if not exist
155   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}
156    
157   # check if FETCHING is needed   # check if FETCHING is needed
158   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )
159   if [[ $? == 0 ]]   if [[ $? = 0 ]]
160   then   then
161   # md5's ok, not fetching needed   # md5's ok, not fetching needed
162   FETCHING=false   FETCHING=false
163   else   else
164   FETCHING=true   FETCHING=true
165   fi   fi
166    
167   for ((i=0; i < EOA; i++))   for ((i=0; i < EOA; i++))
168   do   do
169   # url to file   # url to file
# Line 151  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    
190   #echo "DEBUG: ${MY_SRC_URI}"   if [[ ${FETCHING} = true ]]
  if [[ ${FETCHING} == true ]]  
191   then   then
192   echo "==> fetching ${my_SRC_URI_MIRROR}"   echo "==> fetching ${my_SRC_URI_MIRROR}"
193   wget \   wget \
# Line 162  download_sources() { Line 197  download_sources() {
197   --progress bar \   --progress bar \
198   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
199   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
200   if [ "$?" == "0" ]   if [[ $? = 0 ]]
201   then   then
202   break   break
203   else   else
# Line 171  download_sources() { Line 206  download_sources() {
206   fi   fi
207   done   done
208   else   else
209   #echo "DEBUG: ${SRC_URI[${i}]}"   if [[ ${FETCHING} = true ]]
  if [[ ${FETCHING} == true ]]  
210   then   then
211   echo "==> fetching ${my_SRC_URI}"   echo "==> fetching ${my_SRC_URI}"
212   wget \   wget \
# Line 182  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    
222   # unset them to be shure   # unset them to be shure
223   unset my_SRC_URI   unset my_SRC_URI
224   unset my_SRC_URI_DEST   unset my_SRC_URI_DEST
# Line 210  download_sources() { Line 237  download_sources() {
237  }  }
238    
239  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
240  src_prepare() {  src_prepare()
241    {
242   echo "no src_prepare defined"   echo "no src_prepare defined"
243   sleep 2   sleep 2
244   return 0   return 0
245  }  }
246    
247  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
248  src_compile() {  src_compile()
249    {
250   echo "no src_compile defined"   echo "no src_compile defined"
251   sleep 2   sleep 2
252   return 0   return 0
253  }  }
254    
255  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
256  src_install() {  src_install()
257    {
258   echo "no src_install defined"   echo "no src_install defined"
259   sleep 2   sleep 2
260   return 0   return 0
261  }  }
262    
263  mconfigure() {  mlibdir()
264    {
265     local libdir=lib
266     [[ ${ARCH} = x86_64 ]] && libdir=lib64
267    
268     echo "${libdir}"
269    }
270    
271    mconfigure()
272    {
273   if [ -x ./configure ]   if [ -x ./configure ]
274   then   then
275   ./configure \   ./configure \
276   --prefix=/usr \   --prefix=/usr \
277   --host=${CHOST} \   --host=${CHOST} \
278   --mandir=/usr/share/man \   --mandir=/usr/share/man \
279   --infodir=/usr/share/info \   --infodir=/usr/share/info \
280   --datadir=/usr/share \   --datadir=/usr/share \
281   --sysconfdir=/etc \   --sysconfdir=/etc \
282   --localstatedir=/var/lib \   --localstatedir=/var/lib \
283   "$@" || die "mconfigure failed"   --libdir=/usr/$(mlibdir) \
284     "$@" || die "mconfigure failed"
285   else   else
286   echo "configure is not an executable ..."   echo "configure is not an executable ..."
287   exit 1   exit 1
288   fi   fi
289  }  }
290    
291  minstall() {  minstall()
292   if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then  {
293     if [ -f ./[mM]akefile -o -f ./GNUmakefile ]
294     then
295   make prefix=${BINDIR}/usr \   make prefix=${BINDIR}/usr \
296   datadir=${BINDIR}/usr/share \   datadir=${BINDIR}/usr/share \
297   infodir=${BINDIR}/usr/share/info \   infodir=${BINDIR}/usr/share/info \
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"
305          fi          fi
306  }  }
307    
308  mmake() {  mmake()
309    {
310   make ${MAKEOPTS} ${EXTRA_EMAKE} "$@"   make ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
311  }  }
312    
313  munpack() {  munpack()
314    {
315   local SRCFILE   local SRCFILE
316   local IFTAR   local IFTAR
317   local DEST   local DEST
318    
319   SRCFILE=$1   SRCFILE=$1
320    
321   if [ -z "$2" ]   if [ -z "$2" ]
322   then   then
323   DEST=${BUILDDIR}   DEST=${BUILDDIR}
324   else   else
325   DEST=$2   DEST=$2
326   fi   fi
327    
328   case "${SRCFILE##*.}" in   case "${SRCFILE##*.}" in
329   bz2)   bz2)
330   IFTAR="$(basename $SRCFILE .bz2)"   IFTAR="$(basename $SRCFILE .bz2)"
331   IFTAR="${IFTAR##*.}"   IFTAR="${IFTAR##*.}"
332   if [ "${IFTAR}" == "tar" ]   if [[ ${IFTAR} = tar ]]
333   then   then
334   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}
335   fi   fi
# Line 292  munpack() { Line 337  munpack() {
337   gz)   gz)
338   IFTAR="$(basename $SRCFILE .gz)"   IFTAR="$(basename $SRCFILE .gz)"
339   IFTAR="${IFTAR##*.}"   IFTAR="${IFTAR##*.}"
340   if [ "${IFTAR}" == "tar" ]   if [[ ${IFTAR} = tar ]]
341   then   then
342   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}
343   fi   fi
# Line 309  munpack() { Line 354  munpack() {
354   esac   esac
355  }  }
356    
357  mpatch() {  mpatch()
358    {
359   local PATCHOPTS   local PATCHOPTS
360   local PATCHFILE   local PATCHFILE
361    
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    
369    
370  minstalldocs() {  minstalldocs()
371    {
372   local docfiles   local docfiles
   
373   docfiles="$@"   docfiles="$@"
374    
375   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]
376   then   then
377   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."
378   fi   fi
379    
380   for i in ${docfiles}   for i in ${docfiles}
381   do   do
382   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."
# Line 338  minstalldocs() { Line 385  minstalldocs() {
385   done   done
386  }  }
387    
388  mstriplibs() {  mstriplibs()
389    {
390   local stripdir="$@"   local stripdir="$@"
391    
392   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [ -z "${stripdir}" ] && stripdir=${BINDIR}
393   find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null   find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
394  }  }
395    
396  mstripbins() {  mstripbins()
397    {
398   local stripdir="$@"   local stripdir="$@"
399    
400   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [ -z "${stripdir}" ] && stripdir=${BINDIR}
401   find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null   find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
402  }  }
403    
404  sminclude() {  sminclude()
405    {
406   local i   local i
407    
408   if [[ -n "$@" ]]   if [[ -n "$@" ]]
# Line 366  sminclude() { Line 416  sminclude() {
416   fi   fi
417  }  }
418    
419  setup_distcc_environment(){  setup_distcc_environment()
420    {
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    
428     # creating distcc tempdir
  #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  
   
  #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}
431   fi   fi
432  }  }
433    
434  setup_ccache_environment(){  setup_ccache_environment()
435    {
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    
443    
444  # fixes given dependencies to match a MAGE_TARGET  # fixes given dependencies to match a MAGE_TARGET
445  # fix_mage_deps -target s/depend # <-- note -target !  # fix_mage_deps -target s/depend # <-- note -target !
446  fix_mage_deps() {  fix_mage_deps()
447    {
448   local target="$1"   local target="$1"
449   local depend="$2"   local depend="$2"
450   local NDEPEND   local NDEPEND
# Line 512  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.38 2005-10-03 20:54:14 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 729  generate_package_md5sum() Line 764  generate_package_md5sum()
764    
765   # gen md5sum   # gen md5sum
766   ( cd ${PKGDIR}; md5sum "${pkgname}.${PKGSUFFIX}" ) \   ( cd ${PKGDIR}; md5sum "${pkgname}.${PKGSUFFIX}" ) \
767   >> ${dest}/${pkgname}.md5   > ${dest}/${pkgname}.md5
768   echo "done"   echo "done"
769   fi   fi
770  }  }
# Line 746  then Line 781  then
781  fi  fi
782    
783  # updating smage2-scripts  # updating smage2-scripts
784  if [ "$1" == "update" ]  if [[ $1 = update ]]
785  then  then
786   if [ ! -d ${SOURCEDIR} ]   if [ ! -d ${SOURCEDIR} ]
787   then   then
# Line 757  then Line 792  then
792  fi  fi
793    
794  # creates md5sums for smages to given dir  # creates md5sums for smages to given dir
795  if [ "$1" == "calcmd5" ]  if [[ $1 = calcmd5 ]]
796  then  then
797   if [ $# -ge 3 ]   if [ $# -ge 3 ]
798   then   then
# Line 809  then Line 844  then
844   unset my_SRC_URI_MIRROR   unset my_SRC_URI_MIRROR
845   unset my_SOURCEDIR   unset my_SOURCEDIR
846   done   done
847    
848   echo   echo
849   echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done."   echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done."
850   echo   echo
# Line 822  then Line 857  then
857   echo   echo
858   exit 1   exit 1
859   fi   fi
860    
861   exit 0   exit 0
862  fi  fi
863    
# Line 865  then Line 900  then
900   exit 0   exit 0
901  fi  fi
902    
903  if [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ]  [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."
904  then  [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] &&
905   die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."   die "File '$(basename ${SMAGENAME})' is not a sMage v${SMAGEVERSION} file. Aborting."
906  fi  [ -z "${SOURCEDIR}" ] && die "\$SOURCEDIR not found. Please setup your mage.rc correctly."
907    [ -z "${SMAGESCRIPTSDIR}" ] && die "\$SMAGESCRIPTSDIR not found. Please setup your mage.rc correctly."
908  if [ -z "`basename ${SMAGENAME}|grep .${SMAGESUFFIX}`" ]  [ -z "${SMAGE2RSYNC}" ] && die "\$SMAGE2RSYNC not found. Please setup your mage.rc correctly."
909  then  [ -z "${BINDIR}" ] && die "no BINDIR variable found in /etc/mage.rc"
910   die "File '`basename ${SMAGENAME}`' is not a sMage v${SMAGEVERSION} file. Aborting."  [ -z "${CHOST}" ] && die "no CHOST variable found in /etc/mage.rc"
911  fi  [ -z "${CFLAGS}" ] && die "no CFLAGS variable found in /etc/mage.rc"
912    [ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in /etc/mage.rc"
 if [ -z "${SOURCEDIR}" ]  
 then  
  die "\$SOURCEDIR not found. Please setup your mage.rc correctly."  
 fi  
   
 if [ -z "${SMAGESCRIPTSDIR}" ]  
 then  
  die "\$SMAGESCRIPTSDIR not found. Please setup your mage.rc correctly."  
 fi  
   
 if [ -z "${SMAGE2RSYNC}" ]  
 then  
  echo "\$SMAGE2RSYNC not found. Please setup your mage.rc correctly."  
  exit 1  
 fi  
   
 if [ -z "${BINDIR}" ]  
 then  
  die "no BINDIR variable found in /etc/mage.rc"  
 fi  
   
 if [ -z "${CHOST}" ]  
 then  
  die "no CHOST variable found in /etc/mage.rc"  
 fi  
   
 if [ -z "${CFLAGS}" ]  
 then  
  die "no CFLAGS variable found in /etc/mage.rc"  
 fi  
   
 if [ -z "${CXXFLAGS}" ]  
 then  
  die "no CXXFLAGS variable found in /etc/mage.rc"  
 fi  
   
913    
914  source ${SMAGENAME} || die "source failed"  source ${SMAGENAME} || die "source failed"
915  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"
# Line 939  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  if [ "${SMAGE_USE_DISTCC}" == "true" ]  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment
 then  
  setup_distcc_environment  
 fi  
943    
944  # setup ccache  # setup ccache
945  if [ "${SMAGE_USE_CCACHE}" == "true" ]  [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment
 then  
  setup_ccache_environment  
 fi  
   
946    
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 1035  case ${NOPKGBUILD} in Line 1016  case ${NOPKGBUILD} in
1016   echo -e "NOPGKBUILD=true detected; Package will not be build ..."   echo -e "NOPGKBUILD=true detected; Package will not be build ..."
1017   ;;   ;;
1018   *)   *)
1019   # build serveral targets   # build several targets
1020   if [ -n "${MAGE_TARGETS}" ]   if [ -n "${MAGE_TARGETS}" ]
1021   then   then
1022   for target in ${MAGE_TARGETS}   for target in ${MAGE_TARGETS}
# Line 1081  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.255  
changed lines
  Added in v.384