Magellan Linux

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

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

revision 191 by niro, Fri Aug 19 02:24:12 2005 UTC revision 413 by niro, Fri Jan 19 23:15:04 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.22 2005-08-19 02:24:12 niro Exp $  # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.50 2007-01-19 23:15:04 niro Exp $
8    
9  #01.10.2004  #01.10.2004
10  # added ccache support  # added ccache support
# Line 12  Line 12 
12    
13  ## setup ##  ## setup ##
14  PKGSUFFIX="mpk"  PKGSUFFIX="mpk"
15    SRCPKGSUFFIX="mpks"
16  SMAGENAME="$1"  SMAGENAME="$1"
17  SMAGESUFFIX="smage2"  SMAGESUFFIX="smage2"
 #SOURCEDIR="/bootstrap/sources"  
 #SMAGESCRIPTSDIR="/bootstrap/smage2-install-scripts"  
 #SMAGE2RSYNC="rsync://192.168.0.2/smage2-scripts"  
18  MLIBDIR=/usr/lib/mage  MLIBDIR=/usr/lib/mage
19  SMAGEVERSION="$( < ${MLIBDIR}/version)"  SMAGEVERSION="$( < ${MLIBDIR}/version)"
20    
21    ## only for tests -> normally in /etc/rc.d/init.d/functions
22    COLRED="\033[1;6m\033[31m"
23    COLGREEN="\033[1;6m\033[32m"
24    COLYELLOW="\033[1;6m\033[33m"
25    COLBLUE="\033[1;6m\033[34m"
26    COLMAGENTA="\033[1;6m\033[35m"
27    COLWHITE="\033[1;6m\033[37m"
28    COLGRAY="\033[0;6m\033[37m"
29    COLBOLD="\033[1m"
30    COLDEFAULT="\033[0m"
31    
32    if [[ ${NOCOLORS} = true ]]
33    then
34     COLRED=""
35     COLGREEN=""
36     COLYELLOW=""
37     COLBLUE=""
38     COLMAGENTA=""
39     COLWHITE=""
40     COLGRAY=""
41     COLBOLD=""
42     COLDEFAULT=""
43    fi
44    
45  # export default C locale  # export default C locale
46  export LC_ALL=C  export LC_ALL=C
47    
48  source /etc/mage.rc  source /etc/mage.rc
49    
50  showversion() {  # set PKGDIR and BUILDDIR and BINDIR to MROOT
51    if [[ -n ${MROOT} ]]
52    then
53     export PKGDIR=${MROOT}/${PKGDIR}
54     export BUILDDIR=${MROOT}/${BUILDDIR}
55     export BINDIR=${MROOT}/${BINDIR}
56    fi
57    
58    showversion()
59    {
60   echo -en "Magellan Source Install v${SMAGEVERSION} "   echo -en "Magellan Source Install v${SMAGEVERSION} "
61   echo -e  "-- Niels Rogalla (niro@magellan-linux.de)"   echo -e  "-- Niels Rogalla (niro@magellan-linux.de)"
62  }  }
63    
64  die() {  die()
65    {
66   xtitleclean   xtitleclean
67     echo -e ${COLRED}"Exited ${BASH_SOURCE} at line no ${BASH_LINENO}."${COLDEFAULT}
68   echo "SMAGE failed: $@"   echo "SMAGE failed: $@"
69   exit 1   exit 1
70  }  }
71    
72  xtitle() {  xtitle()
73   if [ ${TERM} == "xterm" ]  {
74     if [[ ${TERM} = xterm ]]
75   then   then
76   echo -ne "\033]0;[sMage: $@]\007"   echo -ne "\033]0;[sMage: $@]\007"
77   fi   fi
78   return 0   return 0
79  }  }
80    
81  xtitleclean() {  xtitleclean()
82   if [ ${TERM} == "xterm" ]  {
83     if [[ ${TERM} = xterm ]]
84   then   then
85   echo -ne "\033]0;\007"   echo -ne "\033]0;\007"
86   fi   fi
87   return 0   return 0
88  }  }
89    
90  syncsmage2() {  syncsmage2()
91    {
92   xtitle "Updating smage2-script tree ..."   xtitle "Updating smage2-script tree ..."
93   local i   local i
94   for i in ${SMAGE2RSYNC}   for i in ${SMAGE2RSYNC}
95   do   do
96   rsync \   rsync ${RSYNC_FETCH_OPTIONS} ${i} ${SMAGESCRIPTSDIR}
97   --recursive \   if [[ $? = 0 ]]
  --links \  
  --perms \  
  --times \  
  --devices \  
  --timeout=600 \  
  --verbose \  
  --compress \  
  --progress \  
  --stats \  
  --delete \  
  --delete-after \  
  ${i} ${SMAGESCRIPTSDIR}  
   
  if [ "$?" == "0" ]  
98   then   then
99   break   break
100   else   else
101   continue   continue
102   fi   fi
   
103   done   done
104    
105   #clean up backup files (foo~)   # clean up backup files (foo~)
106   find ${SMAGESCRIPTSDIR} -name *~ -exec rm '{}' ';'   find ${SMAGESCRIPTSDIR} -name *~ -exec rm '{}' ';'
107    
108   xtitleclean   xtitleclean
109  }  }
110    
111  # $1 filename  # $1 filename
112  get_db_md5_sum() {  get_db_md5_sum()
113    {
114   local DB_FILE   local DB_FILE
115   local MD5_FILE   local MD5_FILE
116   local i   local i
# Line 101  get_db_md5_sum() { Line 123  get_db_md5_sum() {
123   echo "${i}"   echo "${i}"
124  }  }
125    
126  download_sources() {  download_sources()
127    {
128    
129   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0
130    
# Line 113  download_sources() { Line 136  download_sources() {
136   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
137   local FETCHING   local FETCHING
138   local i mirror   local i mirror
   
139    
140   #install SRCDIR/PNAME if not exist  
141     # install SRCDIR/PNAME if not exist
142   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}
143    
144   # check if FETCHING is needed   # check if FETCHING is needed
145   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )
146   if [[ $? == 0 ]]   if [[ $? = 0 ]]
147   then   then
148   # md5's ok, not fetching needed   # md5's ok, not fetching needed
149   FETCHING=false   FETCHING=false
150   else   else
151   FETCHING=true   FETCHING=true
152   fi   fi
153    
154   for ((i=0; i < EOA; i++))   for ((i=0; i < EOA; i++))
155   do   do
156   # url to file   # url to file
# Line 151  download_sources() { Line 174  download_sources() {
174   do   do
175   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")"
176    
177   #echo "DEBUG: ${MY_SRC_URI}"   if [[ ${FETCHING} = true ]]
  if [[ ${FETCHING} == true ]]  
178   then   then
179   echo "==> fetching ${my_SRC_URI_MIRROR}"   echo "==> fetching ${my_SRC_URI_MIRROR}"
180   wget \   wget \
# Line 162  download_sources() { Line 184  download_sources() {
184   --progress bar \   --progress bar \
185   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
186   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
187   if [ "$?" == "0" ]   if [[ $? = 0 ]]
188   then   then
189   break   break
190   else   else
# Line 171  download_sources() { Line 193  download_sources() {
193   fi   fi
194   done   done
195   else   else
196   #echo "DEBUG: ${SRC_URI[${i}]}"   if [[ ${FETCHING} = true ]]
  if [[ ${FETCHING} == true ]]  
197   then   then
198   echo "==> fetching ${my_SRC_URI}"   echo "==> fetching ${my_SRC_URI}"
199   wget \   wget \
# Line 182  download_sources() { Line 203  download_sources() {
203   --progress bar \   --progress bar \
204   --directory-prefix="${my_SOURCEDIR}" \   --directory-prefix="${my_SOURCEDIR}" \
205   "${my_SRC_URI}"   "${my_SRC_URI}"
 # only needed to run through a list of mirrors  
 # if [ "$?" == "0" ]  
 # then  
 # break  
 # else  
 # continue  
 # fi  
206   fi   fi
207   fi   fi
208    
209   # unset them to be shure   # unset them to be shure
210   unset my_SRC_URI   unset my_SRC_URI
211   unset my_SRC_URI_DEST   unset my_SRC_URI_DEST
# Line 210  download_sources() { Line 224  download_sources() {
224  }  }
225    
226  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
227  src_prepare() {  src_prepare()
228    {
229   echo "no src_prepare defined"   echo "no src_prepare defined"
230   sleep 2   sleep 2
231   return 0   return 0
232  }  }
233    
234  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
235  src_compile() {  src_compile()
236    {
237   echo "no src_compile defined"   echo "no src_compile defined"
238   sleep 2   sleep 2
239   return 0   return 0
240  }  }
241    
242  # dummy function, used if that not exist in smage file  # dummy function, used if that not exist in smage file
243  src_install() {  src_install()
244    {
245   echo "no src_install defined"   echo "no src_install defined"
246   sleep 2   sleep 2
247   return 0   return 0
248  }  }
249    
250    mlibdir()
251    {
252     local libdir=lib
253     [[ ${ARCH} = x86_64 ]] && libdir=lib64
254    
255  build_mage_script() {   echo "${libdir}"
  return 0  
256  }  }
257    
258  mconfigure() {  mconfigure()
259    {
260   if [ -x ./configure ]   if [ -x ./configure ]
261   then   then
262   ./configure \   ./configure \
263   --prefix=/usr \   --prefix=/usr \
264   --host=${CHOST} \   --host=${CHOST} \
265   --mandir=/usr/share/man \   --mandir=/usr/share/man \
266   --infodir=/usr/share/info \   --infodir=/usr/share/info \
267   --datadir=/usr/share \   --datadir=/usr/share \
268   --sysconfdir=/etc \   --sysconfdir=/etc \
269   --localstatedir=/var/lib \   --localstatedir=/var/lib \
270   "$@" || die "mconfigure failed"   --libdir=/usr/$(mlibdir) \
271     "$@" || die "mconfigure failed"
272   else   else
273   echo "configure is not an executable ..."   echo "configure is not an executable ..."
274   exit 1   exit 1
275   fi   fi
276  }  }
277    
278  minstall() {  minstall()
279   if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then  {
280     if [ -f ./[mM]akefile -o -f ./GNUmakefile ]
281     then
282   make prefix=${BINDIR}/usr \   make prefix=${BINDIR}/usr \
283   datadir=${BINDIR}/usr/share \   datadir=${BINDIR}/usr/share \
284   infodir=${BINDIR}/usr/share/info \   infodir=${BINDIR}/usr/share/info \
285   localstatedir=${BINDIR}/var/lib \   localstatedir=${BINDIR}/var/lib \
286   mandir=${BINDIR}/usr/share/man \   mandir=${BINDIR}/usr/share/man \
287   sysconfdir=${BINDIR}/etc \   sysconfdir=${BINDIR}/etc \
288     libdir=${BINDIR}/usr/$(mlibdir) \
289   "$@" install || die "minstall failed"   "$@" install || die "minstall failed"
290          else          else
291                  die "no Makefile found"                  die "no Makefile found"
292          fi          fi
293  }  }
294    
295  mmake() {  mmake()
296    {
297   make ${MAKEOPTS} ${EXTRA_EMAKE} "$@"   make ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
298  }  }
299    
300  munpack() {  munpack()
301    {
302   local SRCFILE   local SRCFILE
303   local IFTAR   local IFTAR
304   local DEST   local DEST
305    
306   SRCFILE=$1   SRCFILE=$1
307    
308   if [ -z "$2" ]   if [ -z "$2" ]
309   then   then
310   DEST=${BUILDDIR}   DEST=${BUILDDIR}
311   else   else
312   DEST=$2   DEST=$2
313   fi   fi
314    
315     [[ ! -d ${DEST} ]] && install -d ${DEST}
316    
317   case "${SRCFILE##*.}" in   case "${SRCFILE##*.}" in
318   bz2)   bz2)
319   IFTAR="$(basename $SRCFILE .bz2)"   IFTAR="$(basename $SRCFILE .bz2)"
320   IFTAR="${IFTAR##*.}"   IFTAR="${IFTAR##*.}"
321   if [ "${IFTAR}" == "tar" ]   if [[ ${IFTAR} = tar ]]
322   then   then
323   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}
324   fi   fi
# Line 297  munpack() { Line 326  munpack() {
326   gz)   gz)
327   IFTAR="$(basename $SRCFILE .gz)"   IFTAR="$(basename $SRCFILE .gz)"
328   IFTAR="${IFTAR##*.}"   IFTAR="${IFTAR##*.}"
329   if [ "${IFTAR}" == "tar" ]   if [[ ${IFTAR} = tar ]]
330   then   then
331   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST}
332   fi   fi
# Line 314  munpack() { Line 343  munpack() {
343   esac   esac
344  }  }
345    
346  mpatch() {  mpatch()
347    {
348   local PATCHOPTS   local PATCHOPTS
349   local PATCHFILE   local PATCHFILE
350    
351   PATCHOPTS=$1   PATCHOPTS=$1
352   PATCHFILE=$2   PATCHFILE=$2
353    
354     echo -e "${COLBLUE}*** ${COLGREEN}Applying patch '${PATCHFILE}'${COLDEFAULT}"
355   patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}   patch "${PATCHOPTS}" -i ${SOURCEDIR}/${PNAME}/${PATCHFILE}
356  }  }
357    
358    
359  minstalldocs() {  minstalldocs()
360    {
361   local docfiles   local docfiles
   
362   docfiles="$@"   docfiles="$@"
363    
364   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]
365   then   then
366   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."
367   fi   fi
368    
369   for i in ${docfiles}   for i in ${docfiles}
370   do   do
371   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."
# Line 343  minstalldocs() { Line 374  minstalldocs() {
374   done   done
375  }  }
376    
377  mstriplibs() {  mstriplibs()
378    {
379   local stripdir="$@"   local stripdir="$@"
380    
381   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [ -z "${stripdir}" ] && stripdir=${BINDIR}
382   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
383  }  }
384    
385  mstripbins() {  mstripbins()
386    {
387   local stripdir="$@"   local stripdir="$@"
388    
389   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [ -z "${stripdir}" ] && stripdir=${BINDIR}
390   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
391  }  }
392    
393  sminclude() {  sminclude()
394    {
395   local i   local i
396    
397   if [[ -n "$@" ]]   if [[ -n "$@" ]]
# Line 371  sminclude() { Line 405  sminclude() {
405   fi   fi
406  }  }
407    
408  setup_distcc_environment(){  setup_distcc_environment()
409    {
410   if [ -x /usr/bin/distcc ]   if [ -x /usr/bin/distcc ]
411   then   then
412   echo "Using DistCC for compilation ..."   echo "Using DistCC for compilation ..."
413   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  
414    
415   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"   export DISTCC_DIR="${DISTCC_DIR}" || die "distcc_dir export failed"
416    
417     # 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  
418   install -o distcc -g daemon -d ${DISTCC_DIR}   install -o distcc -g daemon -d ${DISTCC_DIR}
419   chmod 1777 ${DISTCC_DIR}   chmod 1777 ${DISTCC_DIR}
420   fi   fi
421  }  }
422    
423  setup_ccache_environment(){  setup_ccache_environment()
424    {
425   if [ -x /usr/bin/ccache ]   if [ -x /usr/bin/ccache ]
426   then   then
427   echo "Using CCache for compilation ..."   echo "Using CCache for compilation ..."
428   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"
429   #unset CC CXX   fi
430    }
431    
432    
433    # fixes given dependencies to match a MAGE_TARGET
434    # fix_mage_deps -target s/depend # <-- note -target !
435    fix_mage_deps()
436    {
437     local target="$1"
438     local depend="$2"
439     local NDEPEND
440     local sym dep cat pver pname
441    
442     # deps and provides are special
443     # they must be fixed to match the target
444    
445     # run this only if target and depend is not empty
446     if [ -n "${target}" ] && [ -n "${depend}" ]
447     then
448     # fix DEPEND
449     while read sym dep
450     do
451     cat="$(dirname ${dep})"
452     # change if not virtual
453     if [[ ${cat} = virtual ]]
454     then
455     pname="$(basename ${dep})"
456     else
457     # fix pver to target-pver
458     # to get pname-target-pver
459    
460     # doing it backwards !
461     pver="${dep##*-}"
462     # full pver
463     pname="$(basename ${dep/-${pver}/})${target}-${pver}"
464     fi
465    
466     # do not add empty lines
467     if [ -z "${NDEPEND}" ]
468     then
469     NDEPEND="${sym} ${cat}/${pname}"
470     else
471     NDEPEND="${NDEPEND}
472     ${sym} ${cat}/${pname}"
473     fi
474    
475     unset cat pname pver
476     done << EOF
477    ${depend}
478    EOF
479     # set NDEPEND to DEPEND
480     depend="${NDEPEND}"
481   fi   fi
482    
483     echo "${depend}"
484  }  }
485    
486  # alx_create_mage_file: helper functions for regen_mage_tree()  # build_mage_script(): helper functions for regen_mage_tree()
487  # generates an mage file with given information in smage file  # generates an mage file with given information in smage file
488  # needs at least:  # needs at least:
489  #   PNAME                 name of pkg  #   PNAME                 name of pkg
# Line 433  setup_ccache_environment(){ Line 505  setup_ccache_environment(){
505  #  #
506  #   MAGE_TREE_DEST        target destination of the generated tree  #   MAGE_TREE_DEST        target destination of the generated tree
507  #   REGEN_MAGE_TREE       set to 'true' to enable this  #   REGEN_MAGE_TREE       set to 'true' to enable this
508  alx_create_mage_file()  #
509    # gets called with build_mage_script target
510    build_mage_script()
511  {  {
512   local magefile   local magefile
513   local dest   local dest
514   local suffix   local target
515   local sym   local sym
516   local depname   local depname
517    
# Line 445  alx_create_mage_file() Line 519  alx_create_mage_file()
519   : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}   : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}
520    
521   # determinate which suffix this mage file should get, if any   # determinate which suffix this mage file should get, if any
522   suffix="$1"   [ -n "$1" ] && target="-$1"
523    
524   # name of magefile   # name of magefile
525   magefile="${PNAME}${suffix}-${PVER}-${PBUILD}.mage"   magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage"
526    
527   # destination to magefile   # destination to magefile
528   dest="${MAGE_TREE_DEST}/${PCATEGORIE}/${PNAME}${suffix}/${magefile}"   dest="${MAGE_TREE_DEST}/${PCATEGORIE}/${PNAME}${target}/${magefile}"
529    
530   # show what we are doing   # show what we are doing
531   echo "Generating Mage file:"   echo "Generating Mage file:"
# Line 462  alx_create_mage_file() Line 536  alx_create_mage_file()
536   > ${dest}   > ${dest}
537    
538   # header   # header
539   echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.22 2005-08-19 02:24:12 niro Exp $' >> ${dest}   echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.50 2007-01-19 23:15:04 niro Exp $' >> ${dest}
540   echo  >> ${dest}   echo  >> ${dest}
541    
542   # pgkname and state   # pgkname and state
543   echo "PKGNAME=\"${PNAME}${suffix}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}   echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}
544   echo "STATE=\"${STATE}\"" >> ${dest}   echo "STATE=\"${STATE}\"" >> ${dest}
545   echo >> ${dest}   echo >> ${dest}
546    
# Line 475  alx_create_mage_file() Line 549  alx_create_mage_file()
549   echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}   echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}
550   echo >> ${dest}   echo >> ${dest}
551    
552   # special tags   # special tags and vars
553   echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}   echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}
554    
555     # echo MAGE_TARGETS ## note -target is needed !
556     echo "MAGE_TARGETS=\"${target}\"" >> ${dest}
557     echo >> ${dest}
558    
559     # add special vars
560     if [ -n "${SPECIAL_VARS}" ]
561     then
562     local i
563     for i in ${SPECIAL_VARS}
564     do
565     # being tricky here :)
566     echo "${i}=\"$(eval echo \$${i})\"" >> ${dest}
567     done
568     echo  >> ${dest}
569     fi
570    
571     # add at least all includes
572   if [ -n "${INHERITS}" ]   if [ -n "${INHERITS}" ]
573   then   then
574   echo -n "minclude"  >> ${dest}   echo -n "minclude"  >> ${dest}
# Line 490  alx_create_mage_file() Line 582  alx_create_mage_file()
582   echo >> ${dest}   echo >> ${dest}
583    
584   # deps and provides   # deps and provides
585   echo "DEPEND=\"${DEPEND}\"" >> ${dest}   echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest}
586   echo "SDEPEND=\"${SDEPEND}\"" >> ${dest}   echo >> ${dest}
587     echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest}
588     echo >> ${dest}
589   echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}   echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}
590   echo >> ${dest}   echo >> ${dest}
591    
# Line 503  alx_create_mage_file() Line 597  alx_create_mage_file()
597   do   do
598   # add to mage (quotes needed !)   # add to mage (quotes needed !)
599   typeset -f "${i}" >> ${dest}   typeset -f "${i}" >> ${dest}
600     echo >> ${dest}
601   # unset to be safe (quotes needed !)   # unset to be safe (quotes needed !)
602   unset "${i}"   #unset "${i}" <-- later to get every target built
603   done   done
604     echo  >> ${dest}
605   fi   fi
606    
607   # pre|post-install|removes   # pre|post-install|removes
# Line 526  regen_mage_tree() Line 622  regen_mage_tree()
622   # build them only if requested   # build them only if requested
623   if [[ ${REGEN_MAGE_TREE} = true ]]   if [[ ${REGEN_MAGE_TREE} = true ]]
624   then   then
625   # build for each target an mage file   # run it without targets
626   for i in ${MAGE_TARGETS}   if [ -z "${MAGE_TARGETS}" ]
627   do   then
628   echo   echo
629   alx_create_mage_file "${i}"   build_mage_script
630   echo   echo
631   done   else
632    
633     # build for each target an mage file
634     # run it with several targets
635     for i in ${MAGE_TARGETS}
636     do
637     echo
638     build_mage_script "${i}"
639     echo
640     done
641     fi
642   fi   fi
643    
644   # now unset all uneeded vars to be safe   # now unset all uneeded vars to be safe
645   unset PKGNAME   # unset PKGNAME <-- don't do that; smage needs this var
646     # unset to be safe (quotes needed !)
647     for i in ${SPECIAL_FUNCTIONS}
648     do
649     unset "${i}"
650     done
651     unset SPECIAL_FUNCTIONS
652     for i in ${SPECIAL_VARS}
653     do
654     unset "${i}"
655     done
656     unset SPECIAL_VARS
657   unset STATE   unset STATE
658   unset DESCRIPTION   unset DESCRIPTION
659   unset HOMEPAGE   unset HOMEPAGE
# Line 545  regen_mage_tree() Line 662  regen_mage_tree()
662   unset DEPEND   unset DEPEND
663   unset SDEPEND   unset SDEPEND
664   unset PROVIDE   unset PROVIDE
  unset SPECIAL_FUNCTIONS  
665   unset preinstall   unset preinstall
666   unset postinstall   unset postinstall
667   unset preremove   unset preremove
668   unset postremove   unset postremove
669  }  }
670    
671    export_inherits()
672    {
673     local include="$1"
674     shift
675    
676     while [ "$1" ]
677     do
678     local functions="$1"
679    
680     # sanity checks
681     [ -z "${include}" ] && die "export_inherits(): \$include not given."
682     [ -z "${functions}" ] && die "export_inherits(): \$functions not given."
683    
684     eval "${functions}() { ${include}_${functions} ; }"
685    
686     # debug
687     [[ ${MAGEDEBUG} = on ]] && typeset -f "${functions}"
688    
689     shift
690     done
691    }
692    
693    generate_package_md5sum()
694    {
695     local dest
696     local pcat
697     local pname
698     local pver
699     local pbuild
700     local parch
701     local target
702     local pkgname
703    
704     # very basic getops
705     for i in $*
706     do
707     case $1 in
708     --pcat|-c) shift; pcat="$1" ;;
709     --pname|-n) shift; pname="$1" ;;
710     --pver|-v) shift; pver="$1" ;;
711     --pbuild|-b) shift; pbuild="$1" ;;
712     --parch|a) shift; parch="$1" ;;
713     --target|t) shift; target="$1" ;;
714     esac
715     shift
716     done
717    
718     # sanity checks; abort if not given
719     [ -z "${pcat}" ] && die "generate_package_md5sum() \$pcat not given."
720     [ -z "${pname}" ] && die "generate_package_md5sum() \$pname not given."
721     [ -z "${pver}" ] && die "generate_package_md5sum() \$pver not given."
722     [ -z "${pbuild}" ] && die "generate_package_md5sum() \$pbuild not given."
723     [ -z "${parch}" ] && die "generate_package_md5sum() \$parch not given."
724    
725     # check needed global vars
726     [ -z "${PKGDIR}" ] && die "generate_package_md5sum() \$PKGDIR not set."
727     [ -z "${PKGSUFFIX}" ] && die "generate_package_md5sum() \$PKGSUFFIX not set."
728    
729     # fix target as it may be empty !
730     [ -n "${target}" ] && target="-${target}"
731    
732     # build pkgname
733     pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"
734    
735     # build pkg-md5-sum only if requested
736     if [[ ${REGEN_MAGE_TREE} = true ]]
737     then
738     echo -n "Generating a md5sum for ${pkgname}.${PKGSUFFIX} ... "
739    
740     # abort if not exist
741     if [ ! -f ${PKGDIR}/${pkgname}.${PKGSUFFIX} ]
742     then
743     echo "! exists"
744     return 0
745     fi
746    
747     # if MAGE_TREE_DEST not set use BUILDDIR
748     : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}
749    
750     # setup md5 dir
751     dest="${MAGE_TREE_DEST}/${pcat}/${pname}/md5"
752     install -d ${dest}
753    
754     # gen md5sum
755     ( cd ${PKGDIR}; md5sum "${pkgname}.${PKGSUFFIX}" ) \
756     > ${dest}/${pkgname}.md5
757     echo "done"
758     fi
759    }
760    
761    source_pkg_build()
762    {
763     if [[ ${PKGTYPE} = virtual ]]
764     then
765     echo "Virtual package detected; src-pkg-tarball not necessary ..."
766     return 0
767     fi
768    
769     if [[ ! -d ${SOURCEDIR}/${PNAME} ]]
770     then
771     echo "No SRC_URI defined; src-pkg-tarball not necessary ..."
772     return 0
773     fi
774    
775     [ -z "${SRCPKGDIR}" ] && die "\$SRCPKGDIR not found. Please setup your mage.rc correctly."
776    
777     echo -e "${COLGREEN}Creating source package tarball ... ${COLDEFAULT}"
778    
779     # include the smage2 file
780     cp ${SMAGENAME} ${SOURCEDIR}/${PNAME}
781    
782     ( cd ${SOURCEDIR}; tar cvjf ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${PNAME}; )
783     [[ ! -d ${SRCPKGDIR} ]] && install -d ${SRCPKGDIR}
784     mv ${BUILDDIR}/${PNAME}-${PVER}-${PBUILD}.tar.bz2 ${SRCPKGDIR}/${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX}
785    
786     echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}"
787    }
788    
789    
790  # print out our version  # print out our version
791  showversion  showversion
792  echo  echo
# Line 563  then Line 798  then
798   exit 1   exit 1
799  fi  fi
800    
801  #updating smage2-scripts  # updating smage2-scripts
802  if [ "$1" == "update" ]  if [[ $1 = update ]]
803  then  then
804   if [ ! -d ${SOURCEDIR} ]   if [ ! -d ${SOURCEDIR} ]
805   then   then
# Line 574  then Line 809  then
809   exit 0   exit 0
810  fi  fi
811    
812  #creates md5sums for smages to given dir  # creates md5sums for smages to given dir
813  if [ "$1" == "calcmd5" ]  if [[ $1 = calcmd5 ]]
814  then  then
815   if [ $# -ge 3 ]   if [ $# -ge 3 ]
816   then   then
# Line 627  then Line 862  then
862   unset my_SRC_URI_MIRROR   unset my_SRC_URI_MIRROR
863   unset my_SOURCEDIR   unset my_SOURCEDIR
864   done   done
865    
866   echo   echo
867   echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done."   echo "Calculating of md5 sums for '$(basename ${SMAGENAME} .${SMAGESUFFIX})' done."
868   echo   echo
# Line 640  then Line 875  then
875   echo   echo
876   exit 1   exit 1
877   fi   fi
878    
879   exit 0   exit 0
880  fi  fi
881    
882  #download sources  # download sources
883  if [ "$1" == "download" -a -n "$2" ]  if [ "$1" == "download" -a -n "$2" ]
884  then  then
885   if [ ! -d ${SMAGESCRIPTSDIR} ]   if [ ! -d ${SMAGESCRIPTSDIR} ]
# Line 661  then Line 896  then
896   exit 0   exit 0
897  fi  fi
898    
899  if [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ]  # regen-mage-tree
900    if [ "$1" == "only-regen-tree" -a -n "$2" ]
901  then  then
902   die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."   # set correct SMAGENAME
903  fi   SMAGENAME="$2"
904     MD5DIR="$(dirname ${SMAGENAME})/md5"
905     source ${SMAGENAME} || die "regen: smage2 not found"
906    
907  if [ -z "`basename ${SMAGENAME}|grep .${SMAGESUFFIX}`" ]   regen_mage_tree
 then  
  die "File '`basename ${SMAGENAME}`' is not a sMage v${SMAGEVERSION} file. Aborting."  
 fi  
908    
909  if [ -z "${SOURCEDIR}" ]   # build md5sum for existing packages
910  then   generate_package_md5sum \
911   die "\$SOURCEDIR not found. Please setup your mage.rc correctly."   --pcat "${PCATEGORIE}" \
912  fi   --pname "${PNAME}" \
913     --pver "${PVER}" \
914     --pbuild "${PBUILD}" \
915     --parch "${ARCH}" \
916     --target "${target}"
917    
918  if [ -z "${SMAGESCRIPTSDIR}" ]   exit 0
 then  
  die "\$SMAGESCRIPTSDIR not found. Please setup your mage.rc correctly."  
919  fi  fi
920    
921  if [ -z "${SMAGE2RSYNC}" ]  if [ "$1" == "--create-src-tarball" -a -n "$2" ]
922  then  then
923   echo "\$SMAGE2RSYNC not found. Please setup your mage.rc correctly."   # set correct SMAGENAME
924   exit 1   SMAGENAME="$2"
925  fi   MD5DIR="$(dirname ${SMAGENAME})/md5"
926    
927  if [ -z "${BINDIR}" ]   echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}"
 then  
  die "no BINDIR variable found in /etc/mage.rc"  
 fi  
928    
929  if [ -z "${CHOST}" ]   source ${SMAGENAME} || die "regen: smage2 not found"
 then  
  die "no CHOST variable found in /etc/mage.rc"  
 fi  
930    
931  if [ -z "${CFLAGS}" ]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
932  then   then
933   die "no CFLAGS variable found in /etc/mage.rc"   echo -e "${COLGREEN}Deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"
934     rm -rf ${SOURCEDIR}/${PKGNAME}
935     fi
936    
937     download_sources
938     source_pkg_build ${SMAGENAME}
939     exit 0
940  fi  fi
941    
942  if [ -z "${CXXFLAGS}" ]  if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]
943  then  then
944   die "no CXXFLAGS variable found in /etc/mage.rc"   SRCPKGTARBALL="${2}"
945     USE_SRC_PKG_TARBALL=true
946    
947     # abort if given file is not a source pkg
948     [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."
949    
950     # set correct SMAGENAME; use the one that the src_pkg provide
951     # /path/to/SOURCEDIR/PNAME/SMAGENAME
952     SMAGENAME="${SOURCEDIR}/$(basename ${SRCPKGTARBALL%-*-*})/$(basename ${SRCPKGTARBALL} .${SRCPKGSUFFIX}).${SMAGESUFFIX}"
953    
954     echo -e "${COLGREEN}Using src-tarball ${COLBLUE}${SRCPKGTARBALL}${COLGREEN} ...${COLDEFAULT}"
955    
956     [[ ! -d ${SOURCEDIR} ]] && install -d ${SOURCEDIR}
957    
958     # unpack srctarball
959     [[ ! -f ${SRCPKGTARBALL} ]] && die "Error: ${SRCPKGTARBALL} does not exist. Aborting."
960    
961     tar xvjf ${SRCPKGTARBALL} -C ${SOURCEDIR} || die  "Error unpackung src-tarball ${SRCPKGTARBALL}"
962    
963     [[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}"
964  fi  fi
965    
966    
967    [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."
968    [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] &&
969     die "File '$(basename ${SMAGENAME})' is not a sMage v${SMAGEVERSION} file. Aborting."
970    [ -z "${SOURCEDIR}" ] && die "\$SOURCEDIR not found. Please setup your mage.rc correctly."
971    [ -z "${SMAGESCRIPTSDIR}" ] && die "\$SMAGESCRIPTSDIR not found. Please setup your mage.rc correctly."
972    [ -z "${SMAGE2RSYNC}" ] && die "\$SMAGE2RSYNC not found. Please setup your mage.rc correctly."
973    [ -z "${BINDIR}" ] && die "no BINDIR variable found in /etc/mage.rc"
974    [ -z "${CHOST}" ] && die "no CHOST variable found in /etc/mage.rc"
975    [ -z "${CFLAGS}" ] && die "no CFLAGS variable found in /etc/mage.rc"
976    [ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in /etc/mage.rc"
977    
978  source ${SMAGENAME} || die "source failed"  source ${SMAGENAME} || die "source failed"
979  PKGNAME="${PNAME}-${PVER}-${CHOST%%-*}-${PBUILD}"  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"
980  MD5DIR="$(dirname ${SMAGENAME})/md5"  MD5DIR="$(dirname ${SMAGENAME})/md5"
981    
982  xtitle "Compiling ${PKGNAME}"  xtitle "Compiling ${PKGNAME}"
# Line 718  echo "Compiling ${PKGNAME}" Line 985  echo "Compiling ${PKGNAME}"
985  # auto regen mage tree if requested  # auto regen mage tree if requested
986  regen_mage_tree  regen_mage_tree
987    
988  #download sources  if [[ ${CREATE_SRC_PKG_TARBALL} = true ]]
989  download_sources  then
990     if [[ -d ${SOURCEDIR}/${PNAME} ]]
991     then
992     echo -e "${COLGREEN}Deleting old sourcefiles ${COLBLUE}${SOURCEDIR}/${PNAME}${COLGREEN} ...${COLDEFAULT}"
993     rm -rf ${SOURCEDIR}/${PNAME}
994     fi
995    fi
996    
997    # download sources
998    [[ ${USE_SRC_PKG_TARBALL} != true ]] && download_sources
999    
1000  #fixes some issues with these functions  # fixes some issues with these functions
1001  export -f src_prepare || die "src_prepare export failed"  export -f src_prepare || die "src_prepare export failed"
1002  export -f src_compile || die "src_compile export failed"  export -f src_compile || die "src_compile export failed"
1003  export -f src_install || die "src_install export failed"  export -f src_install || die "src_install export failed"
1004    
1005  #fixes some compile issues  # fixes some compile issues
1006  export CHOST="${CHOST}" || die "CHOST export failed"  export CHOST="${CHOST}" || die "CHOST export failed"
1007  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"
1008  export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"  export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"
# Line 734  export BINDIR="${BINDIR}" || die "BINDIR Line 1010  export BINDIR="${BINDIR}" || die "BINDIR
1010  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"
1011    
1012    
1013  #setup distcc  # setup distcc
1014  #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
1015  if [ "${SMAGE_USE_DISTCC}" == "true" ]  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment
 then  
  setup_distcc_environment  
 fi  
   
 #setup ccache  
 if [ "${SMAGE_USE_CCACHE}" == "true" ]  
 then  
  setup_ccache_environment  
 fi  
1016    
1017    # setup ccache
1018    [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment
1019    
1020  # small sleep to show our settings  # small sleep to show our settings
1021  sleep 1  sleep 1
1022    
1023  #debug  # cleans up build if a previously one exists
 #echo "CC=${CC}"  
 #echo "CXX=${CXX}"  
 #echo "DISTCC_DIR=${DISTCC_DIR}"  
 #echo "PATH: ${PATH}"  
 #echo "--------------------------------------"  
 #env  
 #echo "--------------------------------------"  
 #read  
 #debug end  
   
 #cleans up build if a previously one exists  
1024  if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
1025  then  then
1026   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."
1027  fi  fi
1028  install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."  install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."
1029    
1030  #cleans up srcdir if a previously unpacked one exists  # cleans up srcdir if a previously unpacked one exists
1031  if [ -d ${SRCDIR} ]  if [ -d ${SRCDIR} ]
1032  then  then
1033   rm -rf ${SRCDIR}   rm -rf ${SRCDIR}
1034  fi  fi
1035    
1036  #cleans up bindir if a previous build exists or creates a new one  # cleans up bindir if a previous build exists or creates a new one
1037  if [ -d ${BINDIR} ]  if [ -d ${BINDIR} ]
1038  then  then
1039   rm -rf ${BINDIR}   rm -rf ${BINDIR}
1040  fi  fi
1041  install -d ${BINDIR} || die "couldn't create \$BINDIR."  install -d ${BINDIR} || die "couldn't create \$BINDIR."
1042    
1043  #cleans up package temp dir if a previous build exists  # cleans up package temp dir if a previous build exists
1044  if [ -d ${BUILDDIR}/${PKGNAME} ]  if [ -d ${BUILDDIR}/${PKGNAME} ]
1045  then  then
1046   rm -rf ${BUILDDIR}/${PKGNAME}   rm -rf ${BUILDDIR}/${PKGNAME}
1047  fi  fi
1048    
1049  #cleans up timestamp if one exists  # cleans up timestamp if one exists
1050  if [ -f /var/tmp/timestamp ]  if [ -f /var/tmp/timestamp ]
1051  then  then
1052   mage rmstamp   mage rmstamp
# Line 799  src_compile || die "src_compile failed" Line 1057  src_compile || die "src_compile failed"
1057  src_install || die "src_install failed"  src_install || die "src_install failed"
1058    
1059    
1060  #compressing doc, info & man files  # compressing doc, info & man files
1061  echo -e "Compressing man-pages ..."  echo -e "Compressing man-pages ..."
1062  if [ -d ${BUILDDIR}/builded/usr/share/man ]  if [ -d ${BUILDDIR}/builded/usr/share/man ]
1063  then  then
# Line 825  case ${NOSTRIP} in Line 1083  case ${NOSTRIP} in
1083   ;;   ;;
1084  esac  esac
1085    
1086  #the new buildpkg command  # the new buildpkg command
1087  case ${NOPKGBUILD} in  case ${NOPKGBUILD} in
1088   true|TRUE|yes|y)   true|TRUE|yes|y)
1089   echo -e "NOPGKBUILD=true detected; Package will not be build ..."   echo -e "NOPGKBUILD=true detected; Package will not be build ..."
1090   ;;   ;;
1091   *)   *)
1092   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"   # build several targets
1093   echo -e "\nPackage ${PKGNAME} successfully builded.\n"   if [ -n "${MAGE_TARGETS}" ]
1094     then
1095     for target in ${MAGE_TARGETS}
1096     do
1097     # check if an special target_pkgbuild exists
1098     if typeset -f ${target}_pkgbuild > /dev/null
1099     then
1100     # run it
1101     ${target}_pkgbuild
1102     fi
1103     # now create the target package
1104     ${MLIBDIR}/pkgbuild_dir.sh \
1105     "${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \
1106     ${BINDIR} || die "target: ${target} package-build failed"
1107    
1108     # build pkg-md5-sum if requested
1109     generate_package_md5sum \
1110     --pcat "${PCATEGORIE}" \
1111     --pname "${PNAME}" \
1112     --pver "${PVER}" \
1113     --pbuild "${PBUILD}" \
1114     --parch "${ARCH}" \
1115     --target "${target}"
1116    
1117     echo -e "\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n"
1118     done
1119     else
1120     ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"
1121    
1122     # build pkg-md5-sum if requested
1123     generate_package_md5sum \
1124     --pcat "${PCATEGORIE}" \
1125     --pname "${PNAME}" \
1126     --pver "${PVER}" \
1127     --pbuild "${PBUILD}" \
1128     --parch "${ARCH}"
1129    
1130     echo -e "\nPackage ${PKGNAME} successfully builded.\n"
1131     fi
1132    
1133     # build src-pkg-tarball if requested
1134     [[ ${CREATE_SRC_PKG_TARBALL} = true ]] && source_pkg_build ${SMAGENAME}
1135   ;;   ;;
1136  esac  esac
1137    
1138  #for sure  # for sure
1139  unset NOPKGBUILD  unset NOPKGBUILD
1140  unset NOSTRIP  unset NOSTRIP
1141    
1142  xtitleclean  xtitleclean
 #echo -e "\nPackage ${PKGNAME} successfully builded.\n"  

Legend:
Removed from v.191  
changed lines
  Added in v.413