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 881 by niro, Mon Jun 29 18:56:32 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.38 2005-10-03 20:54:14 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
11  # added distcc support  # added distcc support
12    
13    # set default user mage.rc
14    : ${MAGERC="/etc/mage.rc"}
15    
16  ## setup ##  ## setup ##
17  PKGSUFFIX="mpk"  PKGSUFFIX="mpk"
18    SRCPKGSUFFIX="mpks"
19  SMAGENAME="$1"  SMAGENAME="$1"
20  SMAGESUFFIX="smage2"  SMAGESUFFIX="smage2"
 #SOURCEDIR="/bootstrap/sources"  
 #SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts"  
 #SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts"  
21  MLIBDIR=/usr/lib/mage  MLIBDIR=/usr/lib/mage
22  SMAGEVERSION="$( < ${MLIBDIR}/version)"  SMAGEVERSION="$( < ${MLIBDIR}/version)"
23    SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log"
24    
25    
26    ## only for tests -> normally in /etc/rc.d/init.d/functions
27    COLRED="\033[1;6m\033[31m"
28    COLGREEN="\033[1;6m\033[32m"
29    COLYELLOW="\033[1;6m\033[33m"
30    COLBLUE="\033[1;6m\033[34m"
31    COLMAGENTA="\033[1;6m\033[35m"
32    COLWHITE="\033[1;6m\033[37m"
33    COLGRAY="\033[0;6m\033[37m"
34    COLBOLD="\033[1m"
35    COLDEFAULT="\033[0m"
36    
37    if [[ ${NOCOLORS} = true ]]
38    then
39     COLRED=""
40     COLGREEN=""
41     COLYELLOW=""
42     COLBLUE=""
43     COLMAGENTA=""
44     COLWHITE=""
45     COLGRAY=""
46     COLBOLD=""
47     COLDEFAULT=""
48    fi
49    
50  # export default C locale  # export default C locale
51  export LC_ALL=C  export LC_ALL=C
52    
53  source /etc/mage.rc  source /etc/mage.rc.global
54    source ${MAGERC}
55    
56    # set PKGDIR and BUILDDIR and BINDIR to MROOT
57    if [[ -n ${MROOT} ]]
58    then
59     export PKGDIR=${MROOT}/${PKGDIR}
60     export BUILDDIR=${MROOT}/${BUILDDIR}
61     export BINDIR=${MROOT}/${BINDIR}
62    fi
63    
64  showversion() {  showversion()
65    {
66   echo -en "Magellan Source Install v${SMAGEVERSION} "   echo -en "Magellan Source Install v${SMAGEVERSION} "
67   echo -e  "-- Niels Rogalla (niro@magellan-linux.de)"   echo -e  "-- Niels Rogalla (niro@magellan-linux.de)"
68  }  }
69    
70  die() {  die()
71    {
72   xtitleclean   xtitleclean
73     echo -e ${COLRED}"Exited ${BASH_SOURCE} at line no ${BASH_LINENO}."${COLDEFAULT}
74   echo "SMAGE failed: $@"   echo "SMAGE failed: $@"
75   exit 1   exit 1
76  }  }
77    
78  xtitle() {  xtitle()
79   if [ ${TERM} == "xterm" ]  {
80     if [[ ${TERM} = xterm ]]
81   then   then
82   echo -ne "\033]0;[sMage: $@]\007"   echo -ne "\033]0;[sMage: $@]\007"
83   fi   fi
84   return 0   return 0
85  }  }
86    
87  xtitleclean() {  xtitleclean()
88   if [ ${TERM} == "xterm" ]  {
89     if [[ ${TERM} = xterm ]]
90   then   then
91   echo -ne "\033]0;\007"   echo -ne "\033]0;\007"
92   fi   fi
93   return 0   return 0
94  }  }
95    
96  syncsmage2() {  syncsmage2()
97    {
98   xtitle "Updating smage2-script tree ..."   xtitle "Updating smage2-script tree ..."
99   local i   local i
100   for i in ${SMAGE2RSYNC}   for i in ${SMAGE2RSYNC}
101   do   do
102   rsync \   rsync ${RSYNC_FETCH_OPTIONS} ${i} ${SMAGESCRIPTSDIR}
103   --recursive \   if [[ $? = 0 ]]
  --links \  
  --perms \  
  --times \  
  --devices \  
  --timeout=600 \  
  --verbose \  
  --compress \  
  --progress \  
  --stats \  
  --delete \  
  --delete-after \  
  ${i} ${SMAGESCRIPTSDIR}  
   
  if [ "$?" == "0" ]  
104   then   then
105   break   break
106   else   else
107   continue   continue
108   fi   fi
   
109   done   done
110    
111   #clean up backup files (foo~)   # clean up backup files (foo~)
112   find ${SMAGESCRIPTSDIR} -name *~ -exec rm '{}' ';'   find ${SMAGESCRIPTSDIR} -name *~ -exec rm '{}' ';'
113    
114   xtitleclean   xtitleclean
115  }  }
116    
117  # $1 filename  # $1 filename
118  get_db_md5_sum() {  get_db_md5_sum()
119    {
120   local DB_FILE   local DB_FILE
121   local MD5_FILE   local MD5_FILE
122   local i   local i
# Line 101  get_db_md5_sum() { Line 129  get_db_md5_sum() {
129   echo "${i}"   echo "${i}"
130  }  }
131    
132  download_sources() {  download_sources()
133    {
134    
135   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0
136    
# Line 113  download_sources() { Line 142  download_sources() {
142   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
143   local FETCHING   local FETCHING
144   local i mirror   local i mirror
   
145    
146   #install SRCDIR/PNAME if not exist  
147     # install SRCDIR/PNAME if not exist
148   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}
149    
150   # check if FETCHING is needed   # check if FETCHING is needed
151   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )
152   if [[ $? == 0 ]]   if [[ $? = 0 ]]
153   then   then
154   # md5's ok, not fetching needed   # md5's ok, no fetching needed
155   FETCHING=false   FETCHING=false
156   else   else
157   FETCHING=true   FETCHING=true
158   fi   fi
159    
160   for ((i=0; i < EOA; i++))   for ((i=0; i < EOA; i++))
161   do   do
162   # url to file   # url to file
# Line 145  download_sources() { Line 174  download_sources() {
174   fi   fi
175    
176   # if an mirrored file than replace first the mirror uri   # if an mirrored file than replace first the mirror uri
177   if [ -n "$(echo ${my_SRC_URI} | grep 'mirror://')" ]   if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]]
178   then   then
179   for mirror in ${MIRRORS}   for mirror in ${MIRRORS}
180   do   do
181   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")"
182    
183   #echo "DEBUG: ${MY_SRC_URI}"   if [[ ${FETCHING} = true ]]
184   if [[ ${FETCHING} == true ]]   then
185     echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
186     wget \
187     --passive-ftp \
188     --tries 3 \
189     --continue \
190     --progress bar \
191     --directory-prefix="${my_SOURCEDIR}" \
192     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
193     "${my_SRC_URI_MIRROR}"
194     if [[ $? = 0 ]]
195     then
196     break
197     else
198     continue
199     fi
200     fi
201     done
202     elif [[ -n $(echo ${my_SRC_URI} | grep 'sourceforge://') ]]
203     then
204     for mirror in ${SOURCEFORGE_MIRRORS}
205     do
206     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|sourceforge:/|${mirror}|g")"
207    
208     if [[ ${FETCHING} = true ]]
209     then
210     echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
211     wget \
212     --passive-ftp \
213     --tries 3 \
214     --continue \
215     --progress bar \
216     --directory-prefix="${my_SOURCEDIR}" \
217     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
218     "${my_SRC_URI_MIRROR}"
219     if [[ $? = 0 ]]
220     then
221     break
222     else
223     continue
224     fi
225     fi
226     done
227     elif [[ -n $(echo ${my_SRC_URI} | grep 'gnu://') ]]
228     then
229     for mirror in ${GNU_MIRRORS}
230     do
231     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|gnu:/|${mirror}|g")"
232    
233     if [[ ${FETCHING} = true ]]
234     then
235     echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
236     wget \
237     --passive-ftp \
238     --tries 3 \
239     --continue \
240     --progress bar \
241     --directory-prefix="${my_SOURCEDIR}" \
242     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
243     "${my_SRC_URI_MIRROR}"
244     if [[ $? = 0 ]]
245     then
246     break
247     else
248     continue
249     fi
250     fi
251     done
252     elif [[ -n $(echo ${my_SRC_URI} | grep 'kde://') ]]
253     then
254     for mirror in ${KDE_MIRRORS}
255     do
256     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|kde:/|${mirror}|g")"
257    
258     if [[ ${FETCHING} = true ]]
259     then
260     echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
261     wget \
262     --passive-ftp \
263     --tries 3 \
264     --continue \
265     --progress bar \
266     --directory-prefix="${my_SOURCEDIR}" \
267     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
268     "${my_SRC_URI_MIRROR}"
269     if [[ $? = 0 ]]
270     then
271     break
272     else
273     continue
274     fi
275     fi
276     done
277     elif [[ -n $(echo ${my_SRC_URI} | grep 'gnome://') ]]
278     then
279     for mirror in ${GNOME_MIRRORS}
280     do
281     my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|gnome:/|${mirror}|g")"
282    
283     if [[ ${FETCHING} = true ]]
284   then   then
285   echo "==> fetching ${my_SRC_URI_MIRROR}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
286   wget \   wget \
287   --passive-ftp \   --passive-ftp \
288   --tries 3 \   --tries 3 \
289   --continue \   --continue \
290   --progress bar \   --progress bar \
291   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
292     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
293   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
294   if [ "$?" == "0" ]   if [[ $? = 0 ]]
295   then   then
296   break   break
297   else   else
# Line 171  download_sources() { Line 300  download_sources() {
300   fi   fi
301   done   done
302   else   else
303   #echo "DEBUG: ${SRC_URI[${i}]}"   if [[ ${FETCHING} = true ]]
  if [[ ${FETCHING} == true ]]  
304   then   then
305   echo "==> fetching ${my_SRC_URI}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}"
306   wget \   wget \
307   --passive-ftp \   --passive-ftp \
308   --tries 3 \   --tries 3 \
309   --continue \   --continue \
310   --progress bar \   --progress bar \
311   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
312     --output-document="$(basename ${my_SRC_URI_MIRROR})" \
313   "${my_SRC_URI}"   "${my_SRC_URI}"
 # only needed to run through a list of mirrors  
 # if [ "$?" == "0" ]  
 # then  
 # break  
 # else  
 # continue  
 # fi  
314   fi   fi
315   fi   fi
316    
317   # unset them to be shure   # unset them to be shure
318   unset my_SRC_URI   unset my_SRC_URI
319   unset my_SRC_URI_DEST   unset my_SRC_URI_DEST
# Line 201  download_sources() { Line 323  download_sources() {
323    
324   # recheck md5 sums   # recheck md5 sums
325   echo   echo
326   echo ">== Checking MD5 sums:"   echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}"
327   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} ) || die "md5 failed"   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} ) || die "md5 failed"
328   echo   echo
329    
# Line 210  download_sources() { Line 332  download_sources() {
332  }  }
333    
334  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
335  src_prepare() {  src_prepare()
336    {
337   echo "no src_prepare defined"   echo "no src_prepare defined"
338   sleep 2   sleep 2
339   return 0   return 0
340  }  }
341    
342  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
343  src_compile() {  src_compile()
344    {
345   echo "no src_compile defined"   echo "no src_compile defined"
346   sleep 2   sleep 2
347   return 0   return 0
348  }  }
349    
350  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
351  src_install() {  src_install()
352    {
353   echo "no src_install defined"   echo "no src_install defined"
354   sleep 2   sleep 2
355   return 0   return 0
356  }  }
357    
358  mconfigure() {  mlibdir()
359    {
360     local libdir=lib
361     [[ ${ARCH} = x86_64 ]] && libdir=lib64
362    
363     echo "${libdir}"
364    }
365    
366    mconfigure()
367    {
368   if [ -x ./configure ]   if [ -x ./configure ]
369   then   then
370   ./configure \   ./configure \
371   --prefix=/usr \   --prefix=/usr \
372   --host=${CHOST} \   --host=${CHOST} \
373   --mandir=/usr/share/man \   --build=${CHOST} \
374   --infodir=/usr/share/info \   --mandir=/usr/share/man \
375   --datadir=/usr/share \   --infodir=/usr/share/info \
376   --sysconfdir=/etc \   --datadir=/usr/share \
377   --localstatedir=/var/lib \   --sysconfdir=/etc \
378   "$@" || die "mconfigure failed"   --localstatedir=/var/lib \
379     --libdir=/usr/$(mlibdir) \
380     "$@" || die "mconfigure failed"
381   else   else
382   echo "configure is not an executable ..."   echo "configure is not an executable ..."
383   exit 1   exit 1
384   fi   fi
385  }  }
386    
387  minstall() {  minstall()
388   if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then  {
389     if [ -f ./[mM]akefile -o -f ./GNUmakefile ]
390     then
391   make prefix=${BINDIR}/usr \   make prefix=${BINDIR}/usr \
392   datadir=${BINDIR}/usr/share \   datadir=${BINDIR}/usr/share \
393   infodir=${BINDIR}/usr/share/info \   infodir=${BINDIR}/usr/share/info \
394   localstatedir=${BINDIR}/var/lib \   localstatedir=${BINDIR}/var/lib \
395   mandir=${BINDIR}/usr/share/man \   mandir=${BINDIR}/usr/share/man \
396   sysconfdir=${BINDIR}/etc \   sysconfdir=${BINDIR}/etc \
397     libdir=${BINDIR}/usr/$(mlibdir) \
398   "$@" install || die "minstall failed"   "$@" install || die "minstall failed"
399          else          else
400                  die "no Makefile found"                  die "no Makefile found"
401          fi          fi
402  }  }
403    
404  mmake() {  mmake()
405    {
406   make ${MAKEOPTS} ${EXTRA_EMAKE} "$@"   make ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
407  }  }
408    
409  munpack() {  munpack()
410    {
411   local SRCFILE   local SRCFILE
412   local IFTAR   local IFTAR
413   local DEST   local DEST
414    
415   SRCFILE=$1   SRCFILE=$1
416    
417   if [ -z "$2" ]   if [[ -z $2 ]]
418   then   then
419   DEST=${BUILDDIR}   DEST=${BUILDDIR}
420   else   else
421   DEST=$2   DEST=$2
422   fi   fi
423    
424     [[ ! -d ${DEST} ]] && install -d ${DEST}
425    
426   case "${SRCFILE##*.}" in   case "${SRCFILE##*.}" in
427   bz2)   bz2)
428   IFTAR="$(basename $SRCFILE .bz2)"   IFTAR="$(basename $SRCFILE .bz2)"
429   IFTAR="${IFTAR##*.}"   IFTAR="${IFTAR##*.}"
430   if [ "${IFTAR}" == "tar" ]   if [[ ${IFTAR} = tar ]]
431   then   then
432   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."
433     else
434     pushd ${DEST} > /dev/null
435     bzcat ${SOURCEDIR}/${PNAME}/${SRCFILE} > ${DEST}/$(basename ${SRCFILE} .bz2) || die ".bz2 unpack failed."
436     popd > /dev/null
437   fi   fi
438   ;;   ;;
439   gz)   gz)
440   IFTAR="$(basename $SRCFILE .gz)"   IFTAR="$(basename $SRCFILE .gz)"
441   IFTAR="${IFTAR##*.}"   IFTAR="${IFTAR##*.}"
442   if [ "${IFTAR}" == "tar" ]   if [[ ${IFTAR} = tar ]]
443   then   then
444   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."
445     else
446     pushd ${DEST} > /dev/null
447     zcat ${SOURCEDIR}/${PNAME}/${SRCFILE} > ${DEST}/$(basename ${SRCFILE} .gz) || die ".gz unpack failed."
448     popd > /dev/null
449   fi   fi
450   ;;   ;;
451   tbz2)   tbz2|mpks|mpk)
452   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tbz2 unpack failed."
453   ;;   ;;
454   tgz)   tgz)
455   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tgz unpack failed."
456     ;;
457     rar)
458     unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST}  || die ".rar unpack failed."
459     ;;
460     zip|xpi)
461     unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed."
462     ;;
463     rpm)
464     pushd ${DEST} > /dev/null
465     rpm2targz ${SOURCEDIR}/${PNAME}/${SRCFILE} || die "rpm2targz: .rpm unpack failed."
466     tar --no-same-owner -xvzf ${SRCFILE/.rpm/.tar.gz} || die "tar: .rpm unpack failed."
467     if [[ -f ${DEST}/${SRCFILE/.rpm/.tar.gz} ]]
468     then
469     rm ${DEST}/${SRCFILE/.rpm/.tar.gz}
470     fi
471   ;;   ;;
472   *)   *)
473   die "munpack failed"   die "munpack failed"
# Line 309  munpack() { Line 475  munpack() {
475   esac   esac
476  }  }
477    
478  mpatch() {  mpatch()
479    {
480   local PATCHOPTS   local PATCHOPTS
481   local PATCHFILE   local PATCHFILE
482     local i
483    
484   PATCHOPTS=$1   PATCHOPTS=$1
485   PATCHFILE=$2   PATCHFILE=$2
486    
487     if [[ -z $2 ]]
488     then
489     PATCHFILE=$1
490    
491     ## patch level auto-detection, get patch level
492     for ((i=0; i < 10; i++))
493     do
494     patch --dry-run -Np${i} -i ${SOURCEDIR}/${PNAME}/${PATCHFILE} > /dev/null
495     if [[ $? = 0 ]]
496     then
497     PATCHOPTS="-Np${i}"
498     break
499     fi
500     done
501     fi
502    
503     echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}"
504   patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}   patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}
505  }  }
506    
507    mlibtoolize()
508    {
509     local opts="$@"
510     [[ -z ${opts} ]] && opts="--copy --force"
511    
512     libtoolize ${opts} || die "running: mlibtoolize ${opts}"
513    }
514    
515  minstalldocs() {  minstalldocs()
516    {
517   local docfiles   local docfiles
   
518   docfiles="$@"   docfiles="$@"
519    
520   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]
521   then   then
522   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."
523   fi   fi
524    
525   for i in ${docfiles}   for i in ${docfiles}
526   do   do
527   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."
# Line 338  minstalldocs() { Line 530  minstalldocs() {
530   done   done
531  }  }
532    
533  mstriplibs() {  mstriplibs()
534    {
535   local stripdir="$@"   local stripdir="$@"
536    
537   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [ -z "${stripdir}" ] && stripdir=${BINDIR}
538   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
539  }  }
540    
541  mstripbins() {  mstripbins()
542    {
543   local stripdir="$@"   local stripdir="$@"
544    
545   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [ -z "${stripdir}" ] && stripdir=${BINDIR}
546   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
547  }  }
548    
549  sminclude() {  sminclude()
550    {
551   local i   local i
552    
553   if [[ -n "$@" ]]   if [[ -n "$@" ]]
# Line 366  sminclude() { Line 561  sminclude() {
561   fi   fi
562  }  }
563    
564  setup_distcc_environment(){  setup_distcc_environment()
565    {
566   if [ -x /usr/bin/distcc ]   if [ -x /usr/bin/distcc ]
567   then   then
568   echo "Using DistCC for compilation ..."   echo -e "${COLBLUE}---${COLGREEN} Using DistCC for compilation ...${COLDEFAULT}"
569   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  
570    
571   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"
572    
573     # 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  
574   install -o distcc -g daemon -d ${DISTCC_DIR}   install -o distcc -g daemon -d ${DISTCC_DIR}
575   chmod 1777 ${DISTCC_DIR}   chmod 1777 ${DISTCC_DIR}
576   fi   fi
577  }  }
578    
579  setup_ccache_environment(){  setup_ccache_environment()
580    {
581   if [ -x /usr/bin/ccache ]   if [ -x /usr/bin/ccache ]
582   then   then
583   echo "Using CCache for compilation ..."   echo -e "${COLBLUE}---${COLGREEN} Using CCache for compilation ...${COLDEFAULT}"
584   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  
585   fi   fi
586  }  }
587    
588    
589  # fixes given dependencies to match a MAGE_TARGET  # fixes given dependencies to match a MAGE_TARGET
590  # fix_mage_deps -target s/depend # <-- note -target !  # fix_mage_deps -target s/depend # <-- note -target !
591  fix_mage_deps() {  fix_mage_deps()
592    {
593   local target="$1"   local target="$1"
594   local depend="$2"   local depend="$2"
595   local NDEPEND   local NDEPEND
# Line 424  fix_mage_deps() { Line 604  fix_mage_deps() {
604   # fix DEPEND   # fix DEPEND
605   while read sym dep   while read sym dep
606   do   do
607     # ignore empty lines
608     [[ -z ${dep} ]] && continue
609    
610   cat="$(dirname ${dep})"   cat="$(dirname ${dep})"
611   # change if not virtual   # change if not virtual
612   if [[ ${cat} = virtual ]]   if [[ ${cat} = virtual ]]
# Line 476  EOF Line 659  EOF
659  # special tags:  # special tags:
660  #   PKGTYPE               type of pkg  #   PKGTYPE               type of pkg
661  #   INHERITS              which functions get included  #   INHERITS              which functions get included
662  #   SPECIAL_FUNCTIONS     special functions wich should also be added  #   SPECIAL_FUNCTIONS     special functions which should also be added
663  #                         warning: they get killed before the build starts !  #                         warning: they get killed before the build starts !
664  #  #
665  #   MAGE_TREE_DEST        target destination of the generated tree  #   MAGE_TREE_DEST        target destination of the generated tree
# Line 504  build_mage_script() Line 687  build_mage_script()
687   dest="${MAGE_TREE_DEST}/${PCATEGORIE}/${PNAME}${target}/${magefile}"   dest="${MAGE_TREE_DEST}/${PCATEGORIE}/${PNAME}${target}/${magefile}"
688    
689   # show what we are doing   # show what we are doing
690   echo "Generating Mage file:"   echo -e "${COLBLUE}===${COLGREEN} generating mage file:${COLDEFAULT}"
691   echo "  ${dest}"   echo "${dest}"
692    
693   install -d "$(dirname ${dest})"   install -d "$(dirname ${dest})"
694   # now build the mage file   # now build the mage file
695   > ${dest}   > ${dest}
696    
697   # header   # header
698   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.62 2007-11-28 10:47:50 niro Exp $' >> ${dest}
699   echo  >> ${dest}   echo  >> ${dest}
700    
701   # pgkname and state   # pgkname and state
# Line 620  regen_mage_tree() Line 803  regen_mage_tree()
803   # now unset all uneeded vars to be safe   # now unset all uneeded vars to be safe
804   # unset PKGNAME <-- don't do that; smage needs this var   # unset PKGNAME <-- don't do that; smage needs this var
805   # unset to be safe (quotes needed !)   # unset to be safe (quotes needed !)
806   for i in ${SPECIAL_FUNCTIONS}  # for i in ${SPECIAL_FUNCTIONS}
807   do  # do
808   unset "${i}"  # unset "${i}"
809   done  # done
810   unset SPECIAL_FUNCTIONS   unset SPECIAL_FUNCTIONS
811   for i in ${SPECIAL_VARS}  # for i in ${SPECIAL_VARS}
812   do  # do
813   unset "${i}"  # unset "${i}"
814   done  # done
815   unset SPECIAL_VARS   unset SPECIAL_VARS
816   unset STATE   unset STATE
817   unset DESCRIPTION   unset DESCRIPTION
# Line 711  generate_package_md5sum() Line 894  generate_package_md5sum()
894   # build pkg-md5-sum only if requested   # build pkg-md5-sum only if requested
895   if [[ ${REGEN_MAGE_TREE} = true ]]   if [[ ${REGEN_MAGE_TREE} = true ]]
896   then   then
897   echo -n "Generating a md5sum for ${pkgname}.${PKGSUFFIX} ... "   echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}"
898    
899   # abort if not exist   # abort if not exist
900   if [ ! -f ${PKGDIR}/${pkgname}.${PKGSUFFIX} ]   if [ ! -f ${PKGDIR}/${pkgname}.${PKGSUFFIX} ]
901   then   then
902   echo "! exists"   echo -e "${COLRED}! exists${COLDEFAULT}"
903   return 0   return 0
904   fi   fi
905    
# Line 729  generate_package_md5sum() Line 912  generate_package_md5sum()
912    
913   # gen md5sum   # gen md5sum
914   ( cd ${PKGDIR}; md5sum "${pkgname}.${PKGSUFFIX}" ) \   ( cd ${PKGDIR}; md5sum "${pkgname}.${PKGSUFFIX}" ) \
915   >> ${dest}/${pkgname}.md5   > ${dest}/${pkgname}.md5
916   echo "done"   echo -e "${COLGREEN}done${COLDEFAULT}"
917   fi   fi
918  }  }
919    
920    source_pkg_build()
921    {
922     if [[ ${PKGTYPE} = virtual ]]
923     then
924     echo "Virtual package detected; src-pkg-tarball not necessary ..."
925     return 0
926     fi
927    
928     if [[ ! -d ${SOURCEDIR}/${PNAME} ]]
929     then
930     echo "No SRC_URI defined; src-pkg-tarball not necessary ..."
931     return 0
932     fi
933    
934     [ -z "${SRCPKGDIR}" ] && die "\$SRCPKGDIR not found. Please setup your ${MAGERC} correctly."
935    
936     echo -e "${COLGREEN}Creating source package tarball ... ${COLDEFAULT}"
937    
938     # include the smage2 file
939     cp ${SMAGENAME} ${SOURCEDIR}/${PNAME}
940    
941     ( cd ${SOURCEDIR}; tar cvjf ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${PNAME}; )
942     [[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR}
943     mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX}
944    
945     echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}"
946    }
947    
948    step_by_step()
949    {
950     if [[ ${STEP_BY_STEP} = true ]]
951     then
952     echo "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"
953     echo "Press [enter] to continue"
954     read
955     fi
956    }
957    
958    
959  # print out our version  # print out our version
960  showversion  showversion
961  echo  echo
# Line 746  then Line 968  then
968  fi  fi
969    
970  # updating smage2-scripts  # updating smage2-scripts
971  if [ "$1" == "update" ]  if [[ $1 = update ]]
972  then  then
973   if [ ! -d ${SOURCEDIR} ]   if [ ! -d ${SOURCEDIR} ]
974   then   then
# Line 757  then Line 979  then
979  fi  fi
980    
981  # creates md5sums for smages to given dir  # creates md5sums for smages to given dir
982  if [ "$1" == "calcmd5" ]  if [[ $1 = calcmd5 ]]
983  then  then
984   if [ $# -ge 3 ]   if [ $# -ge 3 ]
985   then   then
# Line 809  then Line 1031  then
1031   unset my_SRC_URI_MIRROR   unset my_SRC_URI_MIRROR
1032   unset my_SOURCEDIR   unset my_SOURCEDIR
1033   done   done
1034    
1035   echo   echo
1036   echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done."   echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done."
1037   echo   echo
# Line 822  then Line 1044  then
1044   echo   echo
1045   exit 1   exit 1
1046   fi   fi
1047    
1048   exit 0   exit 0
1049  fi  fi
1050    
# Line 865  then Line 1087  then
1087   exit 0   exit 0
1088  fi  fi
1089    
1090  if [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ]  if [ "$1" == "--create-src-tarball" -a -n "$2" ]
1091  then  then
1092   die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."   # set correct SMAGENAME
1093  fi   SMAGENAME="$2"
1094     MD5DIR="$(dirname ${SMAGENAME})/md5"
1095    
1096  if [ -z "`basename ${SMAGENAME}|grep .${SMAGESUFFIX}`" ]   echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}"
 then  
  die "File '`basename ${SMAGENAME}`' is not a sMage v${SMAGEVERSION} file. Aborting."  
 fi  
1097    
1098  if [ -z "${SOURCEDIR}" ]   source ${SMAGENAME} || die "regen: smage2 not found"
 then  
  die "\$SOURCEDIR not found. Please setup your mage.rc correctly."  
 fi  
1099    
1100  if [ -z "${SMAGESCRIPTSDIR}" ]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1101  then   then
1102   die "\$SMAGESCRIPTSDIR not found. Please setup your mage.rc correctly."   echo -e "${COLGREEN}Deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"
1103  fi   rm -rf ${SOURCEDIR}/${PKGNAME}
1104     fi
1105    
1106  if [ -z "${SMAGE2RSYNC}" ]   download_sources
1107  then   source_pkg_build ${SMAGENAME}
1108   echo "\$SMAGE2RSYNC not found. Please setup your mage.rc correctly."   exit 0
  exit 1  
1109  fi  fi
1110    
1111  if [ -z "${BINDIR}" ]  if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]
1112  then  then
1113   die "no BINDIR variable found in /etc/mage.rc"   SRCPKGTARBALL="${2}"
1114  fi   USE_SRC_PKG_TARBALL=true
1115    
1116  if [ -z "${CHOST}" ]   # abort if given file is not a source pkg
1117  then   [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."
  die "no CHOST variable found in /etc/mage.rc"  
 fi  
1118    
1119  if [ -z "${CFLAGS}" ]   # set correct SMAGENAME; use the one that the src_pkg provide
1120  then   # /path/to/SOURCEDIR/PNAME/SMAGENAME
1121   die "no CFLAGS variable found in /etc/mage.rc"   SMAGENAME="${SOURCEDIR}/$(basename ${SRCPKGTARBALL%-*-*})/$(basename ${SRCPKGTARBALL} .${SRCPKGSUFFIX}).${SMAGESUFFIX}"
 fi  
1122    
1123  if [ -z "${CXXFLAGS}" ]   echo -e "${COLGREEN}Using src-tarball ${COLBLUE}${SRCPKGTARBALL}${COLGREEN} ...${COLDEFAULT}"
1124  then  
1125   die "no CXXFLAGS variable found in /etc/mage.rc"   [[ ! -d ${SOURCEDIR} ]] && install -d ${SOURCEDIR}
1126    
1127     # unpack srctarball
1128     [[ ! -f ${SRCPKGTARBALL} ]] && die "Error: ${SRCPKGTARBALL} does not exist. Aborting."
1129    
1130     tar xvjf ${SRCPKGTARBALL} -C ${SOURCEDIR} || die  "Error unpackung src-tarball ${SRCPKGTARBALL}"
1131    
1132     [[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}"
1133  fi  fi
1134    
1135    
1136    [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."
1137    [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] &&
1138     die "File '$(basename ${SMAGENAME})' is not a sMage v${SMAGEVERSION} file. Aborting."
1139    [ -z "${SOURCEDIR}" ] && die "\$SOURCEDIR not found. Please setup your ${MAGERC} correctly."
1140    [ -z "${SMAGESCRIPTSDIR}" ] && die "\$SMAGESCRIPTSDIR not found. Please setup your ${MAGERC} correctly."
1141    [ -z "${SMAGE2RSYNC}" ] && die "\$SMAGE2RSYNC not found. Please setup your ${MAGERC} correctly."
1142    [ -z "${BINDIR}" ] && die "no BINDIR variable found in ${MAGERC}"
1143    [ -z "${CHOST}" ] && die "no CHOST variable found in ${MAGERC}"
1144    [ -z "${CFLAGS}" ] && die "no CFLAGS variable found in ${MAGERC}"
1145    [ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}"
1146    
1147  source ${SMAGENAME} || die "source failed"  source ${SMAGENAME} || die "source failed"
1148  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"
1149  MD5DIR="$(dirname ${SMAGENAME})/md5"  MD5DIR="$(dirname ${SMAGENAME})/md5"
1150    
1151  xtitle "Compiling ${PKGNAME}"  xtitle "Compiling ${PKGNAME}"
1152  echo "Compiling ${PKGNAME}"  echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}"
1153    
1154  # auto regen mage tree if requested  # auto regen mage tree if requested
1155  regen_mage_tree  regen_mage_tree
1156    
1157    if [[ ${CREATE_SRC_PKG_TARBALL} = true ]]
1158    then
1159     if [[ -d ${SOURCEDIR}/${PNAME} ]]
1160     then
1161     echo -e "${COLBLUE}===${COLGREEN} deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"
1162     rm -rf ${SOURCEDIR}/${PNAME}
1163     fi
1164    fi
1165    
1166  # download sources  # download sources
1167  download_sources  [[ ${USE_SRC_PKG_TARBALL} != true ]] && download_sources
1168    
1169  # fixes some issues with these functions  # fixes some issues with these functions
1170  export -f src_prepare || die "src_prepare export failed"  export -f src_prepare || die "src_prepare export failed"
# Line 939  export MAKEOPTS="${MAKEOPTS}" || die "MA Line 1180  export MAKEOPTS="${MAKEOPTS}" || die "MA
1180    
1181    
1182  # setup distcc  # setup distcc
1183  # 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
1184  if [ "${SMAGE_USE_DISTCC}" == "true" ]  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment
 then  
  setup_distcc_environment  
 fi  
1185    
1186  # setup ccache  # setup ccache
1187  if [ "${SMAGE_USE_CCACHE}" == "true" ]  [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment
 then  
  setup_ccache_environment  
 fi  
   
1188    
1189  # small sleep to show our settings  # small sleep to show our settings
1190  sleep 1  sleep 1
1191    
 #debug  
 #echo "CC=${CC}"  
 #echo "CXX=${CXX}"  
 #echo "DISTCC_DIR=${DISTCC_DIR}"  
 #echo "PATH: ${PATH}"  
 #echo "--------------------------------------"  
 #env  
 #echo "--------------------------------------"  
 #read  
 #debug end  
   
1192  # cleans up build if a previously one exists  # cleans up build if a previously one exists
1193  if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
1194  then  then
# Line 998  then Line 1221  then
1221   mage rmstamp   mage rmstamp
1222  fi  fi
1223    
1224  src_prepare || die "src_prepare failed"  # setup build loggins
1225  src_compile || die "src_compile failed"  [[ ! -d /var/log/smage ]] && install -d /var/log/smage
1226  src_install || die "src_install failed"  echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log
1227    
1228    src_prepare || die "src_prepare failed" | ${SMAGE_LOG_CMD}
1229    step_by_step $_
1230    src_compile || die "src_compile failed" | ${SMAGE_LOG_CMD}
1231    step_by_step $_
1232    src_install || die "src_install failed" | ${SMAGE_LOG_CMD}
1233    step_by_step $_
1234    
1235    
1236  # compressing doc, info & man files  # compressing doc, info & man files
 echo -e "Compressing man-pages ..."  
1237  if [ -d ${BUILDDIR}/builded/usr/share/man ]  if [ -d ${BUILDDIR}/builded/usr/share/man ]
1238  then  then
1239     echo -e "${COLBLUE}===${COLGREEN} compressing man-pages ...${COLDEFAULT}"
1240   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/man   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/man
1241  fi  fi
1242    
 echo -e "Compressing info-pages ..."  
1243  if [ -d ${BUILDDIR}/builded/usr/share/info ]  if [ -d ${BUILDDIR}/builded/usr/share/info ]
1244  then  then
1245     echo -e "${COLBLUE}===${COLGREEN} compressing info-pages ...${COLDEFAULT}"
1246   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info
1247  fi  fi
1248    
# Line 1022  case ${NOSTRIP} in Line 1252  case ${NOSTRIP} in
1252   echo -e "NOSTRIP=true detected; Package will not be stripped ..."   echo -e "NOSTRIP=true detected; Package will not be stripped ..."
1253   ;;   ;;
1254   *)   *)
1255   echo -e "Stripping binaries ..."   echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}"
1256   mstripbins ${BINDIR}   mstripbins ${BINDIR}
1257   echo -e "Stripping libraries ..."   echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}"
1258   mstriplibs ${BINDIR}   mstriplibs ${BINDIR}
1259   ;;   ;;
1260  esac  esac
# Line 1035  case ${NOPKGBUILD} in Line 1265  case ${NOPKGBUILD} in
1265   echo -e "NOPGKBUILD=true detected; Package will not be build ..."   echo -e "NOPGKBUILD=true detected; Package will not be build ..."
1266   ;;   ;;
1267   *)   *)
1268   # build serveral targets   # build several targets
1269   if [ -n "${MAGE_TARGETS}" ]   if [ -n "${MAGE_TARGETS}" ]
1270   then   then
1271   for target in ${MAGE_TARGETS}   for target in ${MAGE_TARGETS}
# Line 1060  case ${NOPKGBUILD} in Line 1290  case ${NOPKGBUILD} in
1290   --parch "${ARCH}" \   --parch "${ARCH}" \
1291   --target "${target}"   --target "${target}"
1292    
1293   echo -e "\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n"   echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"
1294   done   done
1295   else   else
1296   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"
# Line 1073  case ${NOPKGBUILD} in Line 1303  case ${NOPKGBUILD} in
1303   --pbuild "${PBUILD}" \   --pbuild "${PBUILD}" \
1304   --parch "${ARCH}"   --parch "${ARCH}"
1305    
1306   echo -e "\nPackage ${PKGNAME} successfully builded.\n"   echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}"
1307   fi   fi
1308    
1309     # build src-pkg-tarball if requested
1310     [[ ${CREATE_SRC_PKG_TARBALL} = true ]] && source_pkg_build ${SMAGENAME}
1311   ;;   ;;
1312  esac  esac
1313    
1314    if [[ ${SMAGE_BUILD_LOGGING} != false ]]
1315    then
1316     bzip2 -9f /var/log/smage/${PKGNAME}.log
1317    else
1318     [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log
1319    fi
1320    
1321  # for sure  # for sure
1322  unset NOPKGBUILD  unset NOPKGBUILD
1323  unset NOSTRIP  unset NOSTRIP
1324    
1325  xtitleclean  xtitleclean
 #echo -e "\nPackage ${PKGNAME} successfully builded.\n"  

Legend:
Removed from v.255  
changed lines
  Added in v.881