Magellan Linux

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

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

revision 891 by niro, Tue Aug 4 19:51:42 2009 UTC revision 1574 by niro, Wed Dec 28 10:44:37 2011 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    # $Id$
3    
4  # compiles/installs .smage2 source install scripts  # compiles/installs .smage2 source install scripts
5  # needs pkgbuild_dir (mage)  # needs pkgbuild_dir (mage)
6    
7  # SMAGE2  # TODO: record dynlib, gz | xz database
 # $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    
 #01.10.2004  
 # added ccache support  
 # added distcc support  
9    
10  # set default user mage.rc  # set default user mage.rc
11  : ${MAGERC="/etc/mage.rc"}  : ${MAGERC="/etc/mage.rc"}
12    
13  ## setup ##  ## setup ##
 PKGSUFFIX="mpk"  
 SRCPKGSUFFIX="mpks"  
14  SMAGENAME="$1"  SMAGENAME="$1"
 SMAGESUFFIX="smage2"  
 MLIBDIR=/usr/lib/mage  
15  SMAGEVERSION="$( < ${MLIBDIR}/version)"  SMAGEVERSION="$( < ${MLIBDIR}/version)"
 SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log"  
   
   
 ## only for tests -> normally in /etc/rc.d/init.d/functions  
 COLRED="\033[1;6m\033[31m"  
 COLGREEN="\033[1;6m\033[32m"  
 COLYELLOW="\033[1;6m\033[33m"  
 COLBLUE="\033[1;6m\033[34m"  
 COLMAGENTA="\033[1;6m\033[35m"  
 COLWHITE="\033[1;6m\033[37m"  
 COLGRAY="\033[0;6m\033[37m"  
 COLBOLD="\033[1m"  
 COLDEFAULT="\033[0m"  
   
 if [[ ${NOCOLORS} = true ]]  
 then  
  COLRED=""  
  COLGREEN=""  
  COLYELLOW=""  
  COLBLUE=""  
  COLMAGENTA=""  
  COLWHITE=""  
  COLGRAY=""  
  COLBOLD=""  
  COLDEFAULT=""  
 fi  
16    
17  # export default C locale  # export default C locale
18  export LC_ALL=C  export LC_ALL=C
19    
20  source /etc/mage.rc.global  source /etc/mage.rc.global
21  source ${MAGERC}  source ${MAGERC}
22    source ${MLIBDIR}/mage4.functions.sh
23    
24  # set PKGDIR and BUILDDIR and BINDIR to MROOT  # set PKGDIR and BUILDDIR and BINDIR to MROOT
25  if [[ -n ${MROOT} ]]  if [[ -n ${MROOT} ]]
# Line 61  then Line 29  then
29   export BINDIR=${MROOT}/${BINDIR}   export BINDIR=${MROOT}/${BINDIR}
30  fi  fi
31    
32    # sources the smage file and uses state from distribution file if exist
33    # may helpful for repository support later on
34    smagesource()
35    {
36     local file="$1"
37     local mystate
38     local mycodename
39    
40     source ${file}
41    
42     [[ -n ${STATE} ]] && mystate="${STATE}"
43    
44     # do not overide if local state was broken or disabled!
45     case ${STATE} in
46     broken) return ;;
47     disabled) return ;;
48     esac
49    
50     if [ -f ${SMAGESCRIPTSDIR}/distribution ]
51     then
52     source ${SMAGESCRIPTSDIR}/distribution
53     [[ -n ${STATE} ]] && mystate="${STATE}"
54     fi
55     # now switch state and export it
56     STATE="${mystate}"
57    }
58    
59  showversion()  showversion()
60  {  {
61   echo -en "Magellan Source Install v${SMAGEVERSION} "   echo -en "Magellan Source Install v${SMAGEVERSION} "
# Line 75  die() Line 70  die()
70   exit 1   exit 1
71  }  }
72    
73    die_pipestatus()
74    {
75     # the status change if we do any parameter declarations!!
76     # dont do this anymore, keep this in mind!
77     #
78     # local pos="$1"
79     # local comment="$2"
80     #
81     # [ ${PIPESTATUS[${pos}]} -ne 0 ] && die "${comment}"
82     #
83     [ ${PIPESTATUS[$1]} -ne 0 ] && die "$2"
84    }
85    
86  xtitle()  xtitle()
87  {  {
88   if [[ ${TERM} = xterm ]]   if [[ ${TERM} = xterm ]]
# Line 142  download_sources() Line 150  download_sources()
150   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
151   local FETCHING   local FETCHING
152   local i mirror   local i mirror
153     local wget_opts
154    
155     # filter wget command if busybox was found
156     wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})"
157    
158   # install SRCDIR/PNAME if not exist   # install SRCDIR/PNAME if not exist
159   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}   [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}
160    
161   # check if FETCHING is needed   # check if FETCHING is needed
162   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} &> /dev/null )   ( cd ${SOURCEDIR}/${PNAME}; md5sum -c ${DB_MD5_SUM_FILE} &> /dev/null )
163   if [[ $? = 0 ]]   if [[ $? = 0 ]]
164   then   then
165   # md5's ok, no fetching needed   # md5's ok, no fetching needed
# Line 187  download_sources() Line 198  download_sources()
198   then   then
199   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
200   wget \   wget \
201   --passive-ftp \   ${wget_opts} \
  --tries 3 \  
  --continue \  
  --progress bar \  
202   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \
203   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
204   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 211  download_sources() Line 219  download_sources()
219   then   then
220   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
221   wget \   wget \
222   --passive-ftp \   ${wget_opts} \
  --tries 3 \  
  --continue \  
  --progress bar \  
223   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \
224   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
225   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 235  download_sources() Line 240  download_sources()
240   then   then
241   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
242   wget \   wget \
243   --passive-ftp \   ${wget_opts} \
  --tries 3 \  
  --continue \  
  --progress bar \  
244   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \
245   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
246   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 259  download_sources() Line 261  download_sources()
261   then   then
262   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
263   wget \   wget \
264   --passive-ftp \   ${wget_opts} \
  --tries 3 \  
  --continue \  
  --progress bar \  
265   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \
266   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
267   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 283  download_sources() Line 282  download_sources()
282   then   then
283   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"
284   wget \   wget \
285   --passive-ftp \   ${wget_opts} \
  --tries 3 \  
  --continue \  
  --progress bar \  
286   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \
287   "${my_SRC_URI_MIRROR}"   "${my_SRC_URI_MIRROR}"
288   if [[ $? = 0 ]]   if [[ $? = 0 ]]
# Line 302  download_sources() Line 298  download_sources()
298   then   then
299   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}"   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}"
300   wget \   wget \
301   --passive-ftp \   ${wget_opts} \
  --tries 3 \  
  --continue \  
  --progress bar \  
302   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \   --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \
303   "${my_SRC_URI}"   "${my_SRC_URI}"
304   fi   fi
# Line 321  download_sources() Line 314  download_sources()
314   # recheck md5 sums   # recheck md5 sums
315   echo   echo
316   echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}"
317   ( cd ${SOURCEDIR}/${PNAME}; md5sum --check ${DB_MD5_SUM_FILE} ) || die "md5 failed"   ( cd ${SOURCEDIR}/${PNAME}; md5sum -c ${DB_MD5_SUM_FILE} ) || die "md5 failed"
318   echo   echo
319    
320   # not needed anymore   # not needed anymore
321   unset SRC_URI   unset SRC_URI
322  }  }
323    
324  # dummy function, used if that not exist in smage file  # dummy function, used if that does not exist in smage file
325  src_prepare()  src_prepare()
326  {  {
327   echo "no src_prepare defined"   echo "no src_prepare defined"
  sleep 2  
328   return 0   return 0
329  }  }
330    
331  # dummy function, used if that not exist in smage file  # dummy function, used if that does not exist in smage file
332  src_compile()  src_compile()
333  {  {
334   echo "no src_compile defined"   echo "no src_compile defined"
  sleep 2  
335   return 0   return 0
336  }  }
337    
338  # dummy function, used if that not exist in smage file  # dummy function, used if that does not exist in smage file
339  src_install()  src_install()
340  {  {
341   echo "no src_install defined"   echo "no src_install defined"
  sleep 2  
342   return 0   return 0
343  }  }
344    
# Line 445  munpack() Line 435  munpack()
435   popd > /dev/null   popd > /dev/null
436   fi   fi
437   ;;   ;;
438     xz)
439     IFTAR="$(basename $SRCFILE .xz)"
440     IFTAR="${IFTAR##*.}"
441     if [[ ${IFTAR} = tar ]]
442     then
443     tar --no-same-owner -xvJf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tar.xz unpack failed."
444     else
445     pushd ${DEST} > /dev/null
446     xzcat ${SOURCEDIR}/${PNAME}/${SRCFILE} > ${DEST}/$(basename ${SRCFILE} .xz) || die ".xz unpack failed."
447     popd > /dev/null
448     fi
449     ;;
450   tbz2|mpks|mpk)   tbz2|mpks|mpk)
451   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tbz2 unpack failed."   tar --no-same-owner -xvjf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tbz2 unpack failed."
452   ;;   ;;
453   tgz)   tgz)
454   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tgz unpack failed."   tar --no-same-owner -xvzf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".tgz unpack failed."
455   ;;   ;;
456     txz|mpkzs|mpkz)
457     tar --no-same-owner -xvJf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${DEST} || die ".txz unpack failed."
458     ;;
459   rar)   rar)
460   unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST}  || die ".rar unpack failed."   unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST}  || die ".rar unpack failed."
461   ;;   ;;
# Line 504  mpatch() Line 509  mpatch()
509  mlibtoolize()  mlibtoolize()
510  {  {
511   local opts="$@"   local opts="$@"
512   [[ -z ${opts} ]] && opts="--copy --force"   [[ -z ${opts} ]] && opts="--verbose --install --force"
513    
514   libtoolize ${opts} || die "running: mlibtoolize ${opts}"   libtoolize ${opts} || die "running: mlibtoolize ${opts}"
515  }  }
516    
517    mautoreconf()
518    {
519     local opts="$@"
520     [[ -z ${opts} ]] && opts="--verbose --install --force"
521    
522     autoreconf ${opts} || die "running: mautoreconf ${opts}"
523    }
524    
525  minstalldocs()  minstalldocs()
526  {  {
527   local docfiles   local docfiles
# Line 519  minstalldocs() Line 532  minstalldocs()
532   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."
533   fi   fi
534    
535     local i
536   for i in ${docfiles}   for i in ${docfiles}
537   do   do
538   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."   if [ -f ${i} ]
539   install -m 0644 ${SRCDIR}/${i}.gz \   then
540   ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "coping docs."   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."
541     install -m 0644 ${SRCDIR}/${i}.gz \
542     ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "coping docs."
543     fi
544   done   done
545  }  }
546    
# Line 532  mstriplibs() Line 549  mstriplibs()
549   local stripdir="$@"   local stripdir="$@"
550    
551   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [ -z "${stripdir}" ] && stripdir=${BINDIR}
552   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_DYN_LIB} 2> /dev/null
553  }  }
554    
555  mstripbins()  mstripbins()
# Line 540  mstripbins() Line 557  mstripbins()
557   local stripdir="$@"   local stripdir="$@"
558    
559   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [ -z "${stripdir}" ] && stripdir=${BINDIR}
560   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_DYN_BIN} 2> /dev/null
561    }
562    
563    mstripstatic()
564    {
565     local stripdir="$@"
566    
567     [ -z "${stripdir}" ] && stripdir=${BINDIR}
568     find ${stripdir} | xargs file | grep "ar archive" | cut -f 1 -d : | xargs strip ${STRIP_STATIC_LIB} 2> /dev/null
569    }
570    
571    mcompressdocs()
572    {
573     local bindir="$@"
574    
575     if [ -d ${bindir}/usr/share/man ]
576     then
577     echo -e "${COLBLUE}===${COLGREEN} compressing man-pages ...${COLDEFAULT}"
578     ${MLIBDIR}/compressdoc -g -9 ${bindir}/usr/share/man
579     fi
580    
581     if [ -d ${bindir}/usr/share/info ]
582     then
583     echo -e "${COLBLUE}===${COLGREEN} compressing info-pages ...${COLDEFAULT}"
584     ${MLIBDIR}/compressdoc -g -9 ${bindir}/usr/share/info
585     fi
586  }  }
587    
588  sminclude()  sminclude()
# Line 658  EOF Line 700  EOF
700  #   INHERITS              which functions get included  #   INHERITS              which functions get included
701  #   SPECIAL_FUNCTIONS     special functions which should also be added  #   SPECIAL_FUNCTIONS     special functions which should also be added
702  #                         warning: they get killed before the build starts !  #                         warning: they get killed before the build starts !
703    #   SPLIT_PACKAGES        names of all subpackages which are splitted from parent
704    #   SPLIT_PACKAGE_BASE    base package name for splitpackages
705    #                         (only in the resulting magefile}
706  #  #
707  #   MAGE_TREE_DEST        target destination of the generated tree  #   MAGE_TREE_DEST        target destination of the generated tree
708  #   REGEN_MAGE_TREE       set to 'true' to enable this  #   REGEN_MAGE_TREE       set to 'true' to enable this
# Line 668  build_mage_script() Line 713  build_mage_script()
713   local magefile   local magefile
714   local dest   local dest
715   local target   local target
716     local split_pkg_base
717   local sym   local sym
718   local depname   local depname
719    
# Line 675  build_mage_script() Line 721  build_mage_script()
721   : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}   : ${MAGE_TREE_DEST=${BUILDDIR}/mage-tree}
722    
723   # determinate which suffix this mage file should get, if any   # determinate which suffix this mage file should get, if any
724   [ -n "$1" ] && target="-$1"   [[ $1 = --target ]] && shift && target="-$1"
725    
726     # mark package as splitpackage
727     [[ $1 = --split-pkg-base ]] && shift && split_pkg_base="$1"
728    
729   # name of magefile   # name of magefile
730   magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage"   magefile="${PNAME}${target}-${PVER}-${PBUILD}.mage"
# Line 691  build_mage_script() Line 740  build_mage_script()
740   # now build the mage file   # now build the mage file
741   > ${dest}   > ${dest}
742    
  # header  
  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}  
  echo  >> ${dest}  
   
743   # pgkname and state   # pgkname and state
744   echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}   echo "PKGNAME=\"${PNAME}${target}-${PVER}-\${ARCH}-${PBUILD}\"" >> ${dest}
745   echo "STATE=\"${STATE}\"" >> ${dest}   echo "STATE=\"${STATE}\"" >> ${dest}
  echo >> ${dest}  
746    
747   # description and homepage   # description and homepage
748   echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest}   echo "DESCRIPTION=\"${DESCRIPTION}\"" >> ${dest}
749   echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}   echo "HOMEPAGE=\"${HOMEPAGE}\"" >> ${dest}
  echo >> ${dest}  
750    
751   # special tags and vars   # special tags and vars
752   echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}   echo "PKGTYPE=\"${PKGTYPE}\""  >> ${dest}
753    
754   # echo MAGE_TARGETS ## note -target is needed !   # echo MAGE_TARGETS ## note -target is needed !
755   echo "MAGE_TARGETS=\"${target}\"" >> ${dest}   echo "MAGE_TARGETS=\"${target}\"" >> ${dest}
756   echo >> ${dest}  
757     # split package base
758     echo "SPLIT_PACKAGE_BASE=\"${split_pkg_base}\"" >> ${dest}
759    
760   # add special vars   # add special vars
761   if [ -n "${SPECIAL_VARS}" ]   if [ -n "${SPECIAL_VARS}" ]
# Line 721  build_mage_script() Line 766  build_mage_script()
766   # being tricky here :)   # being tricky here :)
767   echo "${i}=\"$(eval echo \$${i})\"" >> ${dest}   echo "${i}=\"$(eval echo \$${i})\"" >> ${dest}
768   done   done
  echo  >> ${dest}  
769   fi   fi
770    
771   # add at least all includes   # add at least all includes
# Line 733  build_mage_script() Line 777  build_mage_script()
777   do   do
778   echo -n " ${i}"  >> ${dest}   echo -n " ${i}"  >> ${dest}
779   done   done
780   echo  >> ${dest}   # a CRLF is needed here!
781     echo >> ${dest}
782   fi   fi
  echo >> ${dest}  
783    
784   # deps and provides   # deps and provides
785   echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest}   echo "DEPEND=\"$(fix_mage_deps "${target}" "${DEPEND}")\"" >> ${dest}
  echo >> ${dest}  
786   echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest}   echo "SDEPEND=\"$(fix_mage_deps "${target}" "${SDEPEND}")\"" >> ${dest}
  echo >> ${dest}  
787   echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}   echo "PROVIDE=\"${PROVIDE}\"" >> ${dest}
  echo >> ${dest}  
788    
789   # add special functions   # add special functions
790   if [ -n "${SPECIAL_FUNCTIONS}" ]   if [ -n "${SPECIAL_FUNCTIONS}" ]
# Line 753  build_mage_script() Line 794  build_mage_script()
794   do   do
795   # add to mage (quotes needed !)   # add to mage (quotes needed !)
796   typeset -f "${i}" >> ${dest}   typeset -f "${i}" >> ${dest}
  echo >> ${dest}  
797   # unset to be safe (quotes needed !)   # unset to be safe (quotes needed !)
798   #unset "${i}" <-- later to get every target built   #unset "${i}" <-- later to get every target built
799   done   done
  echo  >> ${dest}  
800   fi   fi
801    
802   # pre|post-install|removes   # pre|post-install|removes
803   typeset -f preinstall >> ${dest}   typeset -f preinstall >> ${dest}
  echo  >> ${dest}  
804   typeset -f postinstall >> ${dest}   typeset -f postinstall >> ${dest}
  echo  >> ${dest}  
805   typeset -f preremove >> ${dest}   typeset -f preremove >> ${dest}
  echo  >> ${dest}  
806   typeset -f postremove >> ${dest}   typeset -f postremove >> ${dest}
  echo  >> ${dest}  
807  }  }
808    
809  regen_mage_tree()  regen_mage_tree()
810  {  {
811   local i   local subpackage
812    
813   # build them only if requested   # build them only if requested
814   if [[ ${REGEN_MAGE_TREE} = true ]]   if [[ ${REGEN_MAGE_TREE} = true ]]
815   then   then
816   # run it without targets   # run it without targets
817   if [ -z "${MAGE_TARGETS}" ]   if [[ -n ${MAGE_TARGETS} ]]
818   then   then
819     # build for each target a mage file
820     # run it with several targets
821   echo   echo
822   build_mage_script   for subpackage in ${MAGE_TARGETS}
823     do
824     build_mage_script --target "${subpackage}"
825     done
826   echo   echo
  else  
827    
828   # build for each target an mage file   # run it for splitpackages
829     elif [[ -n ${SPLIT_PACKAGES} ]]
830     then
831     local split_pkg_base="${PNAME}"
832     # save smage environment
833     split_save_variables
834     # build for each subpackage a mage file
835   # run it with several targets   # run it with several targets
836   for i in ${MAGE_TARGETS}   echo
837     for subpackage in ${SPLIT_PACKAGES}
838   do   do
839   echo   # get the right variables for the split
840   build_mage_script "${i}"   export PNAME="${subpackage}"
841   echo   split_info_${subpackage}
842     # get the preinstall etc
843     split_export_inherits ${subpackage}
844     build_mage_script --split-pkg-base "${split_pkg_base}"
845     # delete split preinstall etc
846     split_delete_inherits ${subpackage}
847     # restore smage environment
848     split_restore_variables
849   done   done
850     echo
851     # unset all saved smage variables
852     split_unset_variables
853    
854     else
855     echo
856     build_mage_script
857     echo
858   fi   fi
859   fi   fi
860    
# Line 824  regen_mage_tree() Line 885  regen_mage_tree()
885   unset postremove   unset postremove
886  }  }
887    
888    split_save_variables()
889    {
890     export SAVED_PNAME="${PNAME}"
891     export SAVED_PVER="${PVER}"
892     export SAVED_PBUILD="${PBUILD}"
893     export SAVED_PCATEGORIE="${PCATEGORIE}"
894     export SAVED_DESCRIPTION="${DESCRIPTION}"
895     export SAVED_HOMEPAGE="${HOMEPAGE}"
896     export SAVED_SPECIAL_VARS="${SPECIAL_VARS}"
897     export SAVED_STATE="${STATE}"
898     export SAVED_PKGTYPE="${PKGTYPE}"
899     export SAVED_INHERITS="${INHERITS}"
900     export SAVED_DEPEND="${DEPEND}"
901     export SAVED_SDEPEND="${SDEPEND}"
902     export SAVED_PROVIDE="${PROVIDE}"
903     export SAVED_NOPKGBUILD="${NOPKGBUILD}"
904    
905     # bindir too
906     export SAVED_BINDIR="${BINDIR}"
907    
908     # export the SPLIT_PACKAGE_BASE
909     export SPLIT_PACKAGE_BASE="${SAVED_PNAME}"
910    
911     # functions
912     if [[ ! -z $(typeset -f preinstall) ]]
913     then
914     # rename the old one
915     local saved_preinstall
916     saved_preinstall=SAVED_$(typeset -f preinstall)
917     eval "${saved_preinstall}"
918     export -f SAVED_preinstall
919     fi
920    
921     if [[ ! -z $(typeset -f postinstall) ]]
922     then
923     # rename the old one
924     local saved_postinstall
925     saved_postinstall=SAVED_$(typeset -f postinstall)
926     eval "${saved_postinstall}"
927     export -f SAVED_postinstall
928     fi
929    
930     if [[ ! -z $(typeset -f preremove) ]]
931     then
932     # rename the old one
933     local saved_preremove
934     saved_preremove=SAVED_$(typeset -f preremove)
935     eval "${saved_preremove}"
936     export -f SAVED_preremove
937     fi
938    
939     if [[ ! -z $(typeset -f postremove) ]]
940     then
941     # rename the old one
942     local saved_postremove
943     saved_postremove=SAVED_$(typeset -f postremove)
944     eval "${saved_postremove}"
945     export -f SAVED_postremove
946     fi
947    }
948    
949    split_restore_variables()
950    {
951     export PNAME="${SAVED_PNAME}"
952     export PVER="${SAVED_PVER}"
953     export PBUILD="${SAVED_PBUILD}"
954     export PCATEGORIE="${SAVED_PCATEGORIE}"
955     export DESCRIPTION="${SAVED_DESCRIPTION}"
956     export HOMEPAGE="${SAVED_HOMEPAGE}"
957     export SPECIAL_VARS="${SAVED_SPECIAL_VARS}"
958     export STATE="${SAVED_STATE}"
959     export PKGTYPE="${SAVED_PKGTYPE}"
960     export INHERITS="${SAVED_INHERITS}"
961     export DEPEND="${SAVED_DEPEND}"
962     export SDEPEND="${SAVED_SDEPEND}"
963     export PROVIDE="${SAVED_PROVIDE}"
964     export NOPKGBUILD="${SAVED_NOPKGBUILD}"
965    
966     # bindir too
967     export BINDIR="${SAVED_BINDIR}"
968    
969     # functions
970     if [[ ! -z $(typeset -f SAVED_preinstall) ]]
971     then
972     # rename the old one
973     local saved_preinstall
974     saved_preinstall=$(typeset -f SAVED_preinstall)
975     eval "${saved_preinstall/SAVED_/}"
976     export -f preinstall
977     fi
978    
979     if [[ ! -z $(typeset -f SAVED_postinstall) ]]
980     then
981     # rename the old one
982     local saved_postinstall
983     saved_postinstall=$(typeset -f SAVED_postinstall)
984     eval "${saved_postinstall/SAVED_/}"
985     export -f postinstall
986     fi
987    
988     if [[ ! -z $(typeset -f SAVED_preremove) ]]
989     then
990     # rename the old one
991     local saved_preremove
992     saved_preremove=$(typeset -f SAVED_preremove)
993     eval "${saved_preremove/SAVED_/}"
994     export -f preremove
995     fi
996    
997     if [[ ! -z $(typeset -f SAVED_postremove) ]]
998     then
999     # rename the old one
1000     local saved_postremove
1001     saved_postremove=$(typeset -f SAVED_postremove)
1002     eval "${saved_postremove/SAVED_/}"
1003     export -f postremove
1004     fi
1005    }
1006    
1007    split_unset_variables()
1008    {
1009     # unset saved vars; not needed anymore
1010     unset SAVED_PNAME
1011     unset SAVED_PVER
1012     unset SAVED_PBUILD
1013     unset SAVED_PCATEGORIE
1014     unset SAVED_DESCRIPTION
1015     unset SAVED_HOMEPAGE
1016     unset SAVED_SPECIAL_VARS
1017     unset SAVED_STATE
1018     unset SAVED_PKGTYPE
1019     unset SAVED_INHERITS
1020     unset SAVED_DEPEND
1021     unset SAVED_SDEPEND
1022     unset SAVED_PROVIDE
1023     unset SAVED_BINDIR
1024     unset SAVED_NOPKGBUILD
1025     unset SPLIT_PACKAGE_BASE
1026     unset -f SAVED_preinstall
1027     unset -f SAVED_postinstall
1028     unset -f SAVED_preremove
1029     unset -f SAVED_postremove
1030    }
1031    
1032    split_export_inherits()
1033    {
1034     local subpackage="$1"
1035     local func
1036     local newfunc
1037    
1038     for func in preinstall postinstall preremove postremove
1039     do
1040     if [[ ! -z $(typeset -f ${func}_${subpackage}) ]]
1041     then
1042     newfunc=$(typeset -f ${func}_${subpackage})
1043     newfunc="${newfunc/_${subpackage} (/ (}"
1044     eval "${newfunc}"
1045     fi
1046     done
1047    }
1048    
1049    split_delete_inherits()
1050    {
1051     local subpackage="$1"
1052     local func
1053    
1054     for func in preinstall postinstall preremove postremove
1055     do
1056     if [[ ! -z $(typeset -f ${func}_${subpackage}) ]]
1057     then
1058     unset -f ${func}
1059     fi
1060     done
1061     }
1062    
1063  export_inherits()  export_inherits()
1064  {  {
1065   local include="$1"   local include="$1"
# Line 947  step_by_step() Line 1183  step_by_step()
1183  {  {
1184   if [[ ${STEP_BY_STEP} = true ]]   if [[ ${STEP_BY_STEP} = true ]]
1185   then   then
1186   echo "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"   echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"
1187   echo "Press [enter] to continue"   echo "Press [enter] to continue"
1188   read   read
1189   fi   fi
# Line 979  fi Line 1215  fi
1215  # creates md5sums for smages to given dir  # creates md5sums for smages to given dir
1216  if [[ $1 = calcmd5 ]]  if [[ $1 = calcmd5 ]]
1217  then  then
1218   if [ $# -ge 3 ]   if [ $# -ge 2 ]
1219   then   then
1220   SMAGENAME="$2"   SMAGENAME="$2"
1221   MD5DIR="$3"   MD5DIR="$3"
1222   source ${SMAGENAME} || die "download source failed"   [[ -z ${MD5DIR} ]] && MD5DIR="$(dirname ${SMAGENAME})/md5"
1223    
1224     smagesource ${SMAGENAME} || die "download source failed"
1225    
1226   # overridable sourcedir; must be declared after source of the smage2   # overridable sourcedir; must be declared after source of the smage2
1227   CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}"   CALC_SOURCEDIR="${CALC_SOURCEDIR:="${SOURCEDIR}/${PNAME}"}"
# Line 1035  then Line 1273  then
1273   echo   echo
1274   else   else
1275   echo "Usage: Calculating MD5 Sums:"   echo "Usage: Calculating MD5 Sums:"
1276   echo "    $(basename $0) calcmd5 /path/to/SMAGENAME /path/to/MD5DIR"   echo "    $(basename $0) calcmd5 /path/to/SMAGENAME [/path/to/MD5DIR]"
1277   echo   echo
1278   echo   echo
1279   echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs."   echo "Export the CALC_SOURCEDIR variable to override current SOURCEDIRs."
# Line 1057  then Line 1295  then
1295   # get smage   # get smage
1296   SMAGENAME="$2"   SMAGENAME="$2"
1297   MD5DIR="$(dirname ${SMAGENAME})/md5"   MD5DIR="$(dirname ${SMAGENAME})/md5"
1298   source ${SMAGENAME} || die "download source failed"   smagesource ${SMAGENAME} || die "download source failed"
1299    
1300   download_sources   download_sources
1301   exit 0   exit 0
# Line 1069  then Line 1307  then
1307   # set correct SMAGENAME   # set correct SMAGENAME
1308   SMAGENAME="$2"   SMAGENAME="$2"
1309   MD5DIR="$(dirname ${SMAGENAME})/md5"   MD5DIR="$(dirname ${SMAGENAME})/md5"
1310   source ${SMAGENAME} || die "regen: smage2 not found"   smagesource ${SMAGENAME} || die "regen: smage2 not found"
1311    
1312   regen_mage_tree   regen_mage_tree
1313    
1314   # build several targets   # build several targets
1315   if [ -n "${MAGE_TARGETS}" ]   if [[ -n ${MAGE_TARGETS} ]]
1316   then   then
1317   for target in ${MAGE_TARGETS}   for target in ${MAGE_TARGETS}
1318   do   do
# Line 1087  then Line 1325  then
1325   --parch "${ARCH}" \   --parch "${ARCH}" \
1326   --target "${target}"   --target "${target}"
1327   done   done
1328    
1329     # build several subpackages
1330     elif [[ -n ${SPLIT_PACKAGES} ]]
1331     then
1332     split_save_variables
1333     for subpackage in ${SPLIT_PACKAGES}
1334     do
1335     # get the right variables for the split
1336     export PNAME="${subpackage}"
1337     split_info_${subpackage}
1338     # build md5sum for existing packages
1339     generate_package_md5sum \
1340     --pcat "${PCATEGORIE}" \
1341     --pname "${PNAME}" \
1342     --pver "${PVER}" \
1343     --pbuild "${PBUILD}" \
1344     --parch "${ARCH}"
1345     # restore smage environment
1346     split_restore_variables
1347     done
1348     # unset all saved smage variables
1349     split_unset_variables
1350    
1351   else   else
1352   # build md5sum for existing packages   # build md5sum for existing packages
1353   generate_package_md5sum \   generate_package_md5sum \
# Line 1094  then Line 1355  then
1355   --pname "${PNAME}" \   --pname "${PNAME}" \
1356   --pver "${PVER}" \   --pver "${PVER}" \
1357   --pbuild "${PBUILD}" \   --pbuild "${PBUILD}" \
1358   --parch "${ARCH}" \   --parch "${ARCH}"
  --target "${target}"  
1359   fi   fi
1360    
1361   exit 0   exit 0
# Line 1109  then Line 1369  then
1369    
1370   echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}"   echo -e "${COLGREEN}create-src-tarball called for ${COLBLUE}${SMAGENAME}${COLGREEN} ...${COLDEFAULT}"
1371    
1372   source ${SMAGENAME} || die "regen: smage2 not found"   smagesource ${SMAGENAME} || die "regen: smage2 not found"
1373    
1374   if [[ -d ${SOURCEDIR}/${PNAME} ]]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1375   then   then
# Line 1158  fi Line 1418  fi
1418  [ -z "${CFLAGS}" ] && die "no CFLAGS variable found in ${MAGERC}"  [ -z "${CFLAGS}" ] && die "no CFLAGS variable found in ${MAGERC}"
1419  [ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}"  [ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}"
1420    
1421  source ${SMAGENAME} || die "source failed"  smagesource ${SMAGENAME} || die "source failed"
1422  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"  PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}"
1423  MD5DIR="$(dirname ${SMAGENAME})/md5"  MD5DIR="$(dirname ${SMAGENAME})/md5"
1424    SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log"
1425    
1426  xtitle "Compiling ${PKGNAME}"  xtitle "Compiling ${PKGNAME}"
1427  echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}"  echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}"
# Line 1200  export MAKEOPTS="${MAKEOPTS}" || die "MA Line 1461  export MAKEOPTS="${MAKEOPTS}" || die "MA
1461  # setup ccache  # setup ccache
1462  [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment  [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment
1463    
1464  # small sleep to show our settings  # clean up builddir if a previously one exist
 sleep 1  
   
 # cleans up build if a previously one exists  
1465  if [ -d ${BUILDDIR} ]  if [ -d ${BUILDDIR} ]
1466  then  then
1467   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."
1468  fi  fi
1469  install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."  install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."
1470    
1471  # cleans up srcdir if a previously unpacked one exists  # clean up srcdir if a previously unpacked one exist
1472  if [ -d ${SRCDIR} ]  if [ -d ${SRCDIR} ]
1473  then  then
1474   rm -rf ${SRCDIR}   rm -rf ${SRCDIR}
1475  fi  fi
1476    
1477  # cleans up bindir if a previous build exists or creates a new one  # clean up bindir if a previous build exist or create a new one
1478  if [ -d ${BINDIR} ]  if [ -d ${BINDIR} ]
1479  then  then
1480   rm -rf ${BINDIR}   rm -rf ${BINDIR}
# Line 1235  then Line 1493  then
1493   mage rmstamp   mage rmstamp
1494  fi  fi
1495    
1496  # setup build loggins  # setup build logging
1497  [[ ! -d /var/log/smage ]] && install -d /var/log/smage  [[ ! -d /var/log/smage ]] && install -d /var/log/smage
1498  echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log  echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log
1499    
1500  src_prepare || die "src_prepare failed" | ${SMAGE_LOG_CMD}  src_prepare | ${SMAGE_LOG_CMD}
1501  step_by_step $_  die_pipestatus 0 "src_prepare failed"
 src_compile || die "src_compile failed" | ${SMAGE_LOG_CMD}  
 step_by_step $_  
 src_install || die "src_install failed" | ${SMAGE_LOG_CMD}  
1502  step_by_step $_  step_by_step $_
1503    
1504    src_compile | ${SMAGE_LOG_CMD}
1505    die_pipestatus 0 "src_compile failed"
1506    step_by_step $_
1507    
1508  # compressing doc, info & man files  # build several subpackages
1509  if [ -d ${BUILDDIR}/builded/usr/share/man ]  if [[ -n ${SPLIT_PACKAGES} ]]
1510  then  then
1511   echo -e "${COLBLUE}===${COLGREEN} compressing man-pages ...${COLDEFAULT}"   # save bindir & pname
1512   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/man   split_save_variables
1513     export SAVED_BINDIR="${BINDIR}"
1514     for subpackage in ${SPLIT_PACKAGES}
1515     do
1516     if typeset -f src_install_${subpackage} > /dev/null
1517     then
1518     # export subpackage bindir
1519     export BINDIR="${SAVED_BINDIR}_${subpackage}"
1520     # export PNAME, several internal function and include
1521     # rely on this variable
1522     export PNAME="${subpackage}"
1523    
1524     echo
1525     echo -en "${COLBLUE}*** ${COLDEFAULT}"
1526     echo -en "  Running ${COLGREEN}split src_install()${COLDEFAULT}"
1527     echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}"
1528     echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..."
1529    
1530     src_install_${subpackage} | ${SMAGE_LOG_CMD}
1531     die_pipestatus 0 "src_install_${subpackage} failed"
1532     step_by_step $_
1533     fi
1534     done
1535     # restore bindir & pname
1536     split_restore_variables
1537     # unset all saved smage variables
1538     split_unset_variables
1539    else
1540     src_install | ${SMAGE_LOG_CMD}
1541     die_pipestatus 0 "src_install failed"
1542     step_by_step $_
1543  fi  fi
1544    
1545  if [ -d ${BUILDDIR}/builded/usr/share/info ]  # compressing doc, info & man files
1546    if [[ -n ${SPLIT_PACKAGES} ]]
1547  then  then
1548   echo -e "${COLBLUE}===${COLGREEN} compressing info-pages ...${COLDEFAULT}"   for subpackage in ${SPLIT_PACKAGES}
1549   ${MLIBDIR}/compressdoc -g -9 ${BUILDDIR}/builded/usr/share/info   do
1550     mcompressdocs ${BINDIR}_${subpackage}
1551     done
1552    else
1553     mcompressdocs ${BINDIR}
1554  fi  fi
1555    
1556    
1557  # stripping all bins and libs  # stripping all bins and libs
1558  case ${NOSTRIP} in  case ${NOSTRIP} in
1559   true|TRUE|yes|y)   true|TRUE|yes|y)
1560   echo -e "NOSTRIP=true detected; Package will not be stripped ..."   echo -e "NOSTRIP=true detected; Package will not be stripped ..."
1561   ;;   ;;
1562   *)   *)
1563   echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}"   if [[ -n ${SPLIT_PACKAGES} ]]
1564   mstripbins ${BINDIR}   then
1565   echo -e "${COLBLUE}===${COLGREEN} stripping libraries ...${COLDEFAULT}"   for subpackage in ${SPLIT_PACKAGES}
1566   mstriplibs ${BINDIR}   do
1567     echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}"
1568     mstripbins ${BINDIR}_${subpackage}
1569     echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}"
1570     mstriplibs ${BINDIR}_${subpackage}
1571     echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}"
1572     mstripstatic ${BINDIR}_${subpackage}
1573     done
1574     else
1575     echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}"
1576     mstripbins ${BINDIR}
1577     echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}"
1578     mstriplibs ${BINDIR}
1579     echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}"
1580     mstripstatic ${BINDIR}
1581     fi
1582   ;;   ;;
1583  esac  esac
1584    
# Line 1280  case ${NOPKGBUILD} in Line 1589  case ${NOPKGBUILD} in
1589   ;;   ;;
1590   *)   *)
1591   # build several targets   # build several targets
1592   if [ -n "${MAGE_TARGETS}" ]   if [[ -n ${MAGE_TARGETS} ]]
1593   then   then
1594   for target in ${MAGE_TARGETS}   for target in ${MAGE_TARGETS}
1595   do   do
1596   # check if an special target_pkgbuild exists   # check if a special target_pkgbuild exists
1597   if typeset -f ${target}_pkgbuild > /dev/null   if typeset -f ${target}_pkgbuild > /dev/null
1598   then   then
1599   # run it   # run it
# Line 1306  case ${NOPKGBUILD} in Line 1615  case ${NOPKGBUILD} in
1615    
1616   echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"   echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"
1617   done   done
1618    
1619     # build several subpackages
1620     elif [[ -n ${SPLIT_PACKAGES} ]]
1621     then
1622     split_save_variables
1623     for subpackage in ${SPLIT_PACKAGES}
1624     do
1625     # get the right variables for the split
1626     export PNAME="${subpackage}"
1627     split_info_${PNAME}
1628    
1629     # jump to next one if NOPKGBUILD is set in split_info
1630     case ${NOPKGBUILD} in
1631     true|TRUE|yes|y) continue ;;
1632     esac
1633    
1634     # check if an special subpackage_pkgbuild exists
1635     if typeset -f ${PNAME}_pkgbuild > /dev/null
1636     then
1637     # run it
1638     ${PNAME}_pkgbuild
1639     fi
1640     # now create the target package
1641     ${MLIBDIR}/pkgbuild_dir.sh \
1642     "${PNAME}-${PVER}-${ARCH}-${PBUILD}" \
1643     "${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed"
1644    
1645     # build pkg-md5-sum if requested
1646     generate_package_md5sum \
1647     --pcat "${PCATEGORIE}" \
1648     --pname "${PNAME}" \
1649     --pver "${PVER}" \
1650     --pbuild "${PBUILD}" \
1651     --parch "${ARCH}"
1652    
1653     echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"
1654    
1655     # restore smage environment
1656     split_restore_variables
1657     done
1658     # unset all saved smage variables
1659     split_unset_variables
1660    
1661   else   else
1662   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"
1663    

Legend:
Removed from v.891  
changed lines
  Added in v.1574