Magellan Linux

Diff of /branches/mage-next/src/smage2.sh

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

revision 1576 by niro, Wed Dec 28 10:50:26 2011 UTC revision 1621 by niro, Tue Jan 10 15:48:33 2012 UTC
# Line 10  Line 10 
10  # set default user mage.rc  # set default user mage.rc
11  : ${MAGERC="/etc/mage.rc"}  : ${MAGERC="/etc/mage.rc"}
12    
 ## setup ##  
 SMAGENAME="$1"  
 SMAGEVERSION="$( < ${MLIBDIR}/version)"  
   
13  # export default C locale  # export default C locale
14  export LC_ALL=C  export LC_ALL=C
15    
# Line 21  source /etc/mage.rc.global Line 17  source /etc/mage.rc.global
17  source ${MAGERC}  source ${MAGERC}
18  source ${MLIBDIR}/mage4.functions.sh  source ${MLIBDIR}/mage4.functions.sh
19    
20    ## setup ##
21    SMAGENAME="$1"
22    SMAGEVERSION="$(< ${MLIBDIR}/version)"
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} ]]
26  then  then
# Line 139  get_db_md5_sum() Line 139  get_db_md5_sum()
139    
140  download_sources()  download_sources()
141  {  {
   
142   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0   [ -z "${SRC_URI}" ] && echo -e "\nNothing declared to download.\n" && return 0
143    
144   local EOA=${#SRC_URI[*]}   local count=${#SRC_URI[*]}
145   local my_SRC_URI   local uri
146   local my_SRC_URI_DEST   local subdir
147   local my_SRC_URI_MIRROR   local outputdir
148   local my_SOURCEDIR   local db_md5_file="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"
149   local DB_MD5_SUM_FILE="${MD5DIR}/$(basename ${SMAGENAME} .${SMAGESUFFIX}).md5"   local fetching
150   local FETCHING   local i
  local i mirror  
  local wget_opts  
   
  # filter wget command if busybox was found  
  wget_opts="$(busybox_filter_wget_options ${WGET_FETCH_OPTIONS})"  
   
  # install SRCDIR/PNAME if not exist  
  [ ! -d ${SOURCEDIR}/${PNAME} ] && install -d ${SOURCEDIR}/${PNAME}  
151    
152   # check if FETCHING is needed   # check if FETCHING is needed
153   ( cd ${SOURCEDIR}/${PNAME}; md5sum -c ${DB_MD5_SUM_FILE} &> /dev/null )   if mchecksum --rundir "${SOURCEDIR}/${PNAME}" --file "${db_md5_file}" --method md5
  if [[ $? = 0 ]]  
154   then   then
155   # md5's ok, no fetching needed   # md5's ok, no fetching needed
156   FETCHING=false   fetching=false
157   else   else
158   FETCHING=true   fetching=true
159   fi   fi
160    
161   for ((i=0; i < EOA; i++))   if [[ ${fetching} = true ]]
162   do   then
163   # url to file   for ((i=0; i < count; i++))
164   my_SRC_URI="$(echo ${SRC_URI[${i}]} | cut -d' ' -f1)"   do
165     # url to file
166   # subdir in sources dir; the my_SRCI_URI file goes to there   uri="${SRC_URI[${i}]%%' '*}"
  my_SRC_URI_DEST="$(echo ${SRC_URI[${i}]} | cut -d' ' -f2)"  
   
  # if my_src_uri_dest is not equal my_src_uri; than an other dir is used  
  if [[ ${my_SRC_URI_DEST} != ${my_SRC_URI} ]]  
  then  
  my_SOURCEDIR="${SOURCEDIR}/${PNAME}/${my_SRC_URI_DEST}"  
  else  
  my_SOURCEDIR="${SOURCEDIR}/${PNAME}"  
  fi  
   
  # create the SOURCEDIR  
  install -d ${my_SOURCEDIR}  
   
  # if an mirrored file than replace first the mirror uri  
  if [[ -n $(echo ${my_SRC_URI} | grep 'mirror://') ]]  
  then  
  for mirror in ${MIRRORS}  
  do  
  my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|mirror:/|${mirror}/sources|g")"  
   
  if [[ ${FETCHING} = true ]]  
  then  
  echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"  
  wget \  
  ${wget_opts} \  
  --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \  
  "${my_SRC_URI_MIRROR}"  
  if [[ $? = 0 ]]  
  then  
  break  
  else  
  continue  
  fi  
  fi  
  done  
  elif [[ -n $(echo ${my_SRC_URI} | grep 'sourceforge://') ]]  
  then  
  for mirror in ${SOURCEFORGE_MIRRORS}  
  do  
  my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|sourceforge:/|${mirror}|g")"  
   
  if [[ ${FETCHING} = true ]]  
  then  
  echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"  
  wget \  
  ${wget_opts} \  
  --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \  
  "${my_SRC_URI_MIRROR}"  
  if [[ $? = 0 ]]  
  then  
  break  
  else  
  continue  
  fi  
  fi  
  done  
  elif [[ -n $(echo ${my_SRC_URI} | grep 'gnu://') ]]  
  then  
  for mirror in ${GNU_MIRRORS}  
  do  
  my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|gnu:/|${mirror}|g")"  
   
  if [[ ${FETCHING} = true ]]  
  then  
  echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"  
  wget \  
  ${wget_opts} \  
  --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \  
  "${my_SRC_URI_MIRROR}"  
  if [[ $? = 0 ]]  
  then  
  break  
  else  
  continue  
  fi  
  fi  
  done  
  elif [[ -n $(echo ${my_SRC_URI} | grep 'kde://') ]]  
  then  
  for mirror in ${KDE_MIRRORS}  
  do  
  my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|kde:/|${mirror}|g")"  
167    
168   if [[ ${FETCHING} = true ]]   # subdir in sources dir; the my_SRCI_URI file goes to there
169   then   subdir="${SRC_URI[${i}]##*' '}"
  echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"  
  wget \  
  ${wget_opts} \  
  --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \  
  "${my_SRC_URI_MIRROR}"  
  if [[ $? = 0 ]]  
  then  
  break  
  else  
  continue  
  fi  
  fi  
  done  
  elif [[ -n $(echo ${my_SRC_URI} | grep 'gnome://') ]]  
  then  
  for mirror in ${GNOME_MIRRORS}  
  do  
  my_SRC_URI_MIRROR="$(echo ${my_SRC_URI} | sed "s|gnome:/|${mirror}|g")"  
170    
171   if [[ ${FETCHING} = true ]]   # if $subdir is not equal with $uri then an other dir is used
172   then   if [[ ${uri} != ${subdir} ]]
  echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI_MIRROR}${COLDEFAULT}"  
  wget \  
  ${wget_opts} \  
  --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \  
  "${my_SRC_URI_MIRROR}"  
  if [[ $? = 0 ]]  
  then  
  break  
  else  
  continue  
  fi  
  fi  
  done  
  else  
  if [[ ${FETCHING} = true ]]  
173   then   then
174   echo -e "${COLBLUE}==>${COLGREEN} fetching ${my_SRC_URI}${COLDEFAULT}"   outputdir="${SOURCEDIR}/${PNAME}/${subdir}"
175   wget \   else
176   ${wget_opts} \   outputdir="${SOURCEDIR}/${PNAME}"
  --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \  
  "${my_SRC_URI}"  
177   fi   fi
  fi  
178    
179   # unset them to be shure   echo -e "${COLBLUE}==>${COLGREEN} fetching ${uri}${COLDEFAULT}"
180   unset my_SRC_URI   # do not die here, mchecksum catches download errors
181   unset my_SRC_URI_DEST   mdownload --uri "${uri}" --dir "${outputdir}"
182   unset my_SRC_URI_MIRROR  
183   unset my_SOURCEDIR   # unset them to be sure
184   done   unset uri
185     unset subdir
186     unset outputdir
187     done
188    
189   # recheck md5 sums   # recheck md5 sums after download
190   echo   echo
191   echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}"
192   ( cd ${SOURCEDIR}/${PNAME}; md5sum -c ${DB_MD5_SUM_FILE} ) || die "md5 failed"   mchecksum --rundir "${SOURCEDIR}/${PNAME}" --file "${db_md5_file}" --method md5 || die "md5 failed"
193   echo   echo
194     else
195     echo -e "${COLBLUE}===${COLGREEN} All sources already fetched, nothing to do${COLDEFAULT}"
196     fi
197    
198   # not needed anymore   # not needed anymore
199   unset SRC_URI   unset SRC_URI
# Line 324  download_sources() Line 202  download_sources()
202  # dummy function, used if that does not exist in smage file  # dummy function, used if that does not exist in smage file
203  src_prepare()  src_prepare()
204  {  {
205   echo "no src_prepare defined"   echo "no src_prepare defined; doing nothing ..."
206   return 0   return 0
207  }  }
208    
209  # dummy function, used if that does not exist in smage file  # dummy function, used if that does not exist in smage file
210  src_check()  src_compile()
211  {  {
212   echo "no src_check defined"   echo "no src_compile defined; doing nothing ..."
213   return 0   return 0
214  }  }
215    
216  # dummy function, used if that does not exist in smage file  # dummy function, used if that does not exist in smage file
217  src_compile()  src_check()
218  {  {
219   echo "no src_compile defined"   echo "no src_check defined; doing nothing ..."
220   return 0   return 0
221  }  }
222    
223  # dummy function, used if that does not exist in smage file  # dummy function, used if that does not exist in smage file
224  src_install()  src_install()
225  {  {
226   echo "no src_install defined"   echo "no src_install defined; doing nothing ..."
227   return 0   return 0
228  }  }
229    
# Line 359  mlibdir() Line 237  mlibdir()
237    
238  mconfigure()  mconfigure()
239  {  {
240     local myopts
241     if [[ ! -z ${CTARGET} ]]
242     then
243     myopts="--target=${CTARGET}"
244     fi
245    
246   if [ -x ./configure ]   if [ -x ./configure ]
247   then   then
248   ./configure \   ./configure \
# Line 371  mconfigure() Line 255  mconfigure()
255   --sysconfdir=/etc \   --sysconfdir=/etc \
256   --localstatedir=/var/lib \   --localstatedir=/var/lib \
257   --libdir=/usr/$(mlibdir) \   --libdir=/usr/$(mlibdir) \
258     ${myopts} \
259   "$@" || die "mconfigure failed"   "$@" || die "mconfigure failed"
260   else   else
261   echo "configure is not an executable ..."   echo "configure is not an executable ..."
# Line 466  munpack() Line 351  munpack()
351   rar)   rar)
352   unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST}  || die ".rar unpack failed."   unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST}  || die ".rar unpack failed."
353   ;;   ;;
354   zip|xpi)   zip|xpi|jar)
355   unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed."   unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed."
356   ;;   ;;
357   rpm)   rpm)
# Line 532  mautoreconf() Line 417  mautoreconf()
417  minstalldocs()  minstalldocs()
418  {  {
419   local docfiles   local docfiles
420     local doc
421   docfiles="$@"   docfiles="$@"
422    
423   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]
# Line 539  minstalldocs() Line 425  minstalldocs()
425   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."
426   fi   fi
427    
428   local i   for doc in ${docfiles}
  for i in ${docfiles}  
429   do   do
430   if [ -f ${i} ]   if [ -f ${doc} ]
431   then   then
432   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."   if mqueryfeature "compressdoc"
433   install -m 0644 ${SRCDIR}/${i}.gz \   then
434   ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "coping docs."   cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "gzipping +installing ${doc}."
435     chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "fixing permissions of ${doc}."
436     else
437     install -m 0644 ${SRCDIR}/${i} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}."
438     fi
439   fi   fi
440   done   done
441  }  }
# Line 555  mstriplibs() Line 444  mstriplibs()
444  {  {
445   local stripdir="$@"   local stripdir="$@"
446    
447   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
448   find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_LIB} 2> /dev/null   [[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug"
449     find ${stripdir} ! -type d | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null
450  }  }
451    
452  mstripbins()  mstripbins()
453  {  {
454   local stripdir="$@"   local stripdir="$@"
455    
456   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
457   find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_BIN} 2> /dev/null   [[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug"
458     find ${stripdir} ! -type d | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null
459  }  }
460    
461  mstripstatic()  mstripstatic()
462  {  {
463   local stripdir="$@"   local stripdir="$@"
464    
465   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
466   find ${stripdir} | xargs file | grep "ar archive" | cut -f 1 -d : | xargs strip ${STRIP_STATIC_LIB} 2> /dev/null   [[ -z ${STRIP_STATIC_LIB} ]] && STRIP_STATIC_LIB="--strip-debug"
467     find ${stripdir} ! -type d | xargs file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_STATIC_LIB} 2> /dev/null
468    }
469    
470    mstriplibtoolarchive()
471    {
472     local stripdir="$@"
473    
474     [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
475     find ${stripdir} ! -type d -name \*.la | xargs | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null
476    }
477    
478    mpurgetargets()
479    {
480     local stripdir="$@"
481     local target
482    
483     [[ -z ${stripdir} ]] && stripdir=${BINDIR}
484     # nothing to do in this case
485     [[ -z ${PURGE_TARGETS[*]} ]] && return
486    
487     for target in ${PURGE_TARGETS[*]}
488     do
489     # check if target is a regex pattern without any slashes
490     if [[ ${target} = ${target//\/} ]]
491     then
492     find ${BINDIR} -type f -name "${target}" | xargs --no-run-if-empty rm -f -- 2> /dev/null
493     else
494     rm -f -- ${target} 2> /dev/null
495     fi
496     done
497  }  }
498    
499  mcompressdocs()  mcompressdocs()
# Line 631  setup_ccache_environment() Line 552  setup_ccache_environment()
552   fi   fi
553  }  }
554    
   
555  # fixes given dependencies to match a MAGE_TARGET  # fixes given dependencies to match a MAGE_TARGET
556  # fix_mage_deps -target s/depend # <-- note -target !  # fix_mage_deps -target s/depend # <-- note -target !
557  fix_mage_deps()  fix_mage_deps()
# Line 818  regen_mage_tree() Line 738  regen_mage_tree()
738   local subpackage   local subpackage
739    
740   # build them only if requested   # build them only if requested
741   if [[ ${REGEN_MAGE_TREE} = true ]]   if mqueryfeature regentree
742   then   then
743   # run it without targets   # run it without targets
744   if [[ -n ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
# Line 881  regen_mage_tree() Line 801  regen_mage_tree()
801   unset STATE   unset STATE
802   unset DESCRIPTION   unset DESCRIPTION
803   unset HOMEPAGE   unset HOMEPAGE
804   unset PKGTYPE   # unset PKGTYPE <-- don't do that either; smage needs this var
805   unset INHERITS   unset INHERITS
806   unset DEPEND   unset DEPEND
807   unset SDEPEND   unset SDEPEND
# Line 907  split_save_variables() Line 827  split_save_variables()
827   export SAVED_DEPEND="${DEPEND}"   export SAVED_DEPEND="${DEPEND}"
828   export SAVED_SDEPEND="${SDEPEND}"   export SAVED_SDEPEND="${SDEPEND}"
829   export SAVED_PROVIDE="${PROVIDE}"   export SAVED_PROVIDE="${PROVIDE}"
830   export SAVED_NOPKGBUILD="${NOPKGBUILD}"   export SAVED_PKGTYPE="${PKGTYPE}"
831    
832     # special handling needed for mage features
833     # pkgbuild
834     mqueryfeature "pkgbuild" && export SAVED_FEATURE_PKGBUILD="pkgbuild"
835     mqueryfeature "!pkgbuild" && export SAVED_FEATURE_PKGBUILD="!pkgbuild"
836     # strip
837     mqueryfeature "strip" && export SAVED_FEATURE_STRIP="strip"
838     mqueryfeature "!strip" && export SAVED_FEATURE_STRIP="!strip"
839     # libtool
840     mqueryfeature "libtool" && export SAVED_FEATURE_LIBTOOL="libtool"
841     mqueryfeature "!libtool" && export SAVED_FEATURE_LIBTOOL="!libtool"
842     # compressdoc
843     mqueryfeature "compressdoc" && export SAVED_FEATURE_COMPRESSDOC="compressdoc"
844     mqueryfeature "!compressdoc" && export SAVED_FEATURE_COMPRESSDOC="!compressdoc"
845    
846   # bindir too   # bindir too
847   export SAVED_BINDIR="${BINDIR}"   export SAVED_BINDIR="${BINDIR}"
# Line 968  split_restore_variables() Line 902  split_restore_variables()
902   export DEPEND="${SAVED_DEPEND}"   export DEPEND="${SAVED_DEPEND}"
903   export SDEPEND="${SAVED_SDEPEND}"   export SDEPEND="${SAVED_SDEPEND}"
904   export PROVIDE="${SAVED_PROVIDE}"   export PROVIDE="${SAVED_PROVIDE}"
905   export NOPKGBUILD="${SAVED_NOPKGBUILD}"   export PKGTYPE="${SAVED_PKGTYPE}"
906    
907     # special handling needed for mage features
908     # pkgbuild
909     FVERBOSE=off msetfeature "${SAVED_FEATURE_PKGBUILD}"
910     # strip
911     FVERBOSE=off msetfeature "${SAVED_FEATURE_STRIP}"
912     # libtool
913     FVERBOSE=off msetfeature "${SAVED_FEATURE_LIBTOOL}"
914     # compressdoc
915     FVERBOSE=off msetfeature "${SAVED_FEATURE_COMPRESSDOC}"
916    
917   # bindir too   # bindir too
918   export BINDIR="${SAVED_BINDIR}"   export BINDIR="${SAVED_BINDIR}"
# Line 1028  split_unset_variables() Line 972  split_unset_variables()
972   unset SAVED_SDEPEND   unset SAVED_SDEPEND
973   unset SAVED_PROVIDE   unset SAVED_PROVIDE
974   unset SAVED_BINDIR   unset SAVED_BINDIR
975   unset SAVED_NOPKGBUILD   unset SAVED_PKGTYPE
976     unset SAVED_FEATURE_PKGBUILD
977     unset SAVED_FEATURE_STRIP
978     unset SAVED_FEATURE_LIBTOOL
979     unset SAVED_FEATURE_COMPRESSDOC
980   unset SPLIT_PACKAGE_BASE   unset SPLIT_PACKAGE_BASE
981   unset -f SAVED_preinstall   unset -f SAVED_preinstall
982   unset -f SAVED_postinstall   unset -f SAVED_postinstall
# Line 1128  generate_package_md5sum() Line 1076  generate_package_md5sum()
1076   # fix target as it may be empty !   # fix target as it may be empty !
1077   [ -n "${target}" ] && target="-${target}"   [ -n "${target}" ] && target="-${target}"
1078    
   
1079   # build pkgname   # build pkgname
1080   pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"   pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"
1081    
1082   # build pkg-md5-sum only if requested   # build pkg-md5-sum only if requested
1083   if [[ ${REGEN_MAGE_TREE} = true ]]   if mqueryfeature regentree
1084   then   then
1085   echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}"   echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}"
1086    
# Line 1188  source_pkg_build() Line 1135  source_pkg_build()
1135    
1136  step_by_step()  step_by_step()
1137  {  {
1138   if [[ ${STEP_BY_STEP} = true ]]   if mqueryfeature stepbystep
1139   then   then
1140   echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"   echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"
1141   echo "Press [enter] to continue"   echo "Press [enter] to continue"
# Line 1196  step_by_step() Line 1143  step_by_step()
1143   fi   fi
1144  }  }
1145    
1146    resume_stamp()
1147    {
1148     local step="$1"
1149     [[ ! -d ${BUILDDIR}/.stamps ]] && install -d ${BUILDDIR}/.stamps
1150     touch ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step}
1151    }
1152    
1153    run_resume()
1154    {
1155     local step="$1"
1156    
1157     if mqueryfeature "resume" && [[ -f ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step} ]]
1158     then
1159     echo -e "${COLMAGENTA}${step} already processed; doing nothing${COLDEFAULT}"
1160     return 0
1161     else
1162     return 1
1163     fi
1164    }
1165    
1166  # print out our version  # print out our version
1167  showversion  showversion
# Line 1208  then Line 1174  then
1174   exit 1   exit 1
1175  fi  fi
1176    
1177    # load supported mage features
1178    load_mage_features
1179    
1180  # updating smage2-scripts  # updating smage2-scripts
1181  if [[ $1 = update ]]  if [[ $1 = update ]]
1182  then  then
# Line 1392  fi Line 1361  fi
1361  if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]  if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]
1362  then  then
1363   SRCPKGTARBALL="${2}"   SRCPKGTARBALL="${2}"
1364   USE_SRC_PKG_TARBALL=true   msetfeature "srcpkgtarball"
1365    
1366   # abort if given file is not a source pkg   # abort if given file is not a source pkg
1367   [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."   [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."
# Line 1413  then Line 1382  then
1382   [[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}"   [[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}"
1383  fi  fi
1384    
1385    if [ "$1" == "--resume" -a -n "$2" ]
1386    then
1387     msetfeature "resume"
1388     SMAGENAME="$2"
1389    fi
1390    
1391  [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."  [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting."
1392  [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] &&  [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] &&
# Line 1436  echo -e "${COLGREEN}Compiling ${PKGNAME} Line 1410  echo -e "${COLGREEN}Compiling ${PKGNAME}
1410  # auto regen mage tree if requested  # auto regen mage tree if requested
1411  regen_mage_tree  regen_mage_tree
1412    
1413  if [[ ${CREATE_SRC_PKG_TARBALL} = true ]]  if mqueryfeature "srcpkg"
1414  then  then
1415   if [[ -d ${SOURCEDIR}/${PNAME} ]]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1416   then   then
# Line 1446  then Line 1420  then
1420  fi  fi
1421    
1422  # download sources  # download sources
1423  [[ ${USE_SRC_PKG_TARBALL} != true ]] && download_sources  mqueryfeature "srcpkgtarball" || download_sources
1424    
1425  # fixes some issues with these functions  # fixes some issues with these functions
1426  export -f src_prepare || die "src_prepare export failed"  export -f src_prepare || die "src_prepare export failed"
# Line 1457  export -f src_install || die "src_instal Line 1431  export -f src_install || die "src_instal
1431  # fixes some compile issues  # fixes some compile issues
1432  export CHOST="${CHOST}" || die "CHOST export failed"  export CHOST="${CHOST}" || die "CHOST export failed"
1433  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"
1434  export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"  if [[ -z ${CXXFLAGS} ]]
1435    then
1436     export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"
1437    else
1438     export CXXFLAGS="${CXXFLAGS}" || die "CXXFLAGS export failed"
1439    fi
1440    export LDFLAGS="${LDFLAGS}" || die "LDFLAGS export failed"
1441  export BINDIR="${BINDIR}" || die "BINDIR export failed"  export BINDIR="${BINDIR}" || die "BINDIR export failed"
1442  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"
1443    
   
1444  # setup distcc  # setup distcc
1445  # setup for distcc goes *before* ccache, so ccache comes before distcc in path  # setup for distcc goes *before* ccache, so ccache comes before distcc in path
1446  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment  mqueryfeature "distcc" && setup_distcc_environment
1447    
1448  # setup ccache  # setup ccache
1449  [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment  mqueryfeature "ccache" && setup_ccache_environment
1450    
1451  # clean up builddir if a previously one exist  if mqueryfeature "resume"
 if [ -d ${BUILDDIR} ]  
1452  then  then
1453   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."   echo -e "${COLMAGENTA}Resume requested; continuing previous build${COLDEFAULT}"
 fi  
 install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."  
1454    
1455  # clean up srcdir if a previously unpacked one exist   # setup build logging
1456  if [ -d ${SRCDIR} ]   [[ ! -d /var/log/smage ]] && install -d /var/log/smage
1457  then   if [[ -f /var/log/smage/${PKGNAME}.log.bz2 ]]
1458   rm -rf ${SRCDIR}   then
1459  fi   bunzip2 -f /var/log/smage/${PKGNAME}.log.bz2
1460     fi
1461     echo -e "### Resume started on $(date) ###\n" >> /var/log/smage/${PKGNAME}.log
1462    
1463  # clean up bindir if a previous build exist or create a new one  else
1464  if [ -d ${BINDIR} ]   # clean up builddir if a previously one exist
1465  then   if [ -d ${BUILDDIR} ]
1466   rm -rf ${BINDIR}   then
1467     rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."
1468     fi
1469     install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."
1470    
1471     # clean up srcdir if a previously unpacked one exist
1472     if [ -d ${SRCDIR} ]
1473     then
1474     rm -rf ${SRCDIR}
1475     fi
1476    
1477     # clean up bindir if a previous build exist or create a new one
1478     if [ -d ${BINDIR} ]
1479     then
1480     rm -rf ${BINDIR}
1481     fi
1482     install -d ${BINDIR} || die "couldn't create \$BINDIR."
1483    
1484     # clean up package temp dir if a previous build exist
1485     if [ -d ${BUILDDIR}/${PKGNAME} ]
1486     then
1487     rm -rf ${BUILDDIR}/${PKGNAME}
1488     fi
1489    
1490     # clean up stamps dir
1491     if [ -d ${BUILDDIR}/.stamps ]
1492     then
1493     rm -rf ${BUILDDIR}/.stamps
1494     fi
1495    
1496     # setup build logging
1497     [[ ! -d /var/log/smage ]] && install -d /var/log/smage
1498     echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log
1499  fi  fi
 install -d ${BINDIR} || die "couldn't create \$BINDIR."  
1500    
1501  # cleans up package temp dir if a previous build exists  if [[ ${PKGTYPE} = virtual ]]
 if [ -d ${BUILDDIR}/${PKGNAME} ]  
1502  then  then
1503   rm -rf ${BUILDDIR}/${PKGNAME}   echo "virtual package detected; nothing will be build ..."
1504     # automatically set !pkgbuild here too
1505     msetfeature "!pkgbuild"
1506    else
1507     ( run_resume src_prepare || src_prepare ) | ${SMAGE_LOG_CMD}
1508     die_pipestatus 0 "src_prepare failed"
1509     resume_stamp src_prepare
1510     step_by_step src_prepare
1511    
1512     ( run_resume src_compile || src_compile ) | ${SMAGE_LOG_CMD}
1513     die_pipestatus 0 "src_compile failed"
1514     resume_stamp src_compile
1515     step_by_step src_compile
1516    
1517     # only run checks if requested
1518     if mqueryfeature "!check"
1519     then
1520     echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD}
1521     else
1522     ( run_resume src_check || src_check ) | ${SMAGE_LOG_CMD}
1523     die_pipestatus 0 "src_check failed"
1524     resume_stamp src_check
1525     fi
1526     step_by_step src_check
1527    
1528     # build several subpackages
1529     if [[ -n ${SPLIT_PACKAGES} ]]
1530     then
1531     # save bindir & pname
1532     split_save_variables
1533     export SAVED_BINDIR="${BINDIR}"
1534     for subpackage in ${SPLIT_PACKAGES}
1535     do
1536     if typeset -f src_install_${subpackage} > /dev/null
1537     then
1538     # export subpackage bindir
1539     export BINDIR="${SAVED_BINDIR}_${subpackage}"
1540     # export PNAME, several internal function and include
1541     # rely on this variable
1542     export PNAME="${subpackage}"
1543    
1544     echo
1545     echo -en "${COLBLUE}*** ${COLDEFAULT}"
1546     echo -en "  Running ${COLGREEN}split src_install()${COLDEFAULT}"
1547     echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}"
1548     echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..."
1549    
1550     ( run_resume src_install_${subpackage} || src_install_${subpackage} ) | ${SMAGE_LOG_CMD}
1551     die_pipestatus 0 "src_install_${subpackage} failed"
1552     resume_stamp src_install_${subpackage}
1553     step_by_step src_install_${subpackage}
1554     fi
1555     done
1556     # restore bindir & pname
1557     split_restore_variables
1558     # unset all saved smage variables
1559     split_unset_variables
1560     else
1561     ( run_resume src_install || src_install ) | ${SMAGE_LOG_CMD}
1562     die_pipestatus 0 "src_install failed"
1563     resume_stamp src_install
1564     step_by_step src_install
1565     fi
1566  fi  fi
1567    
1568  # setup build logging  # echo for sake of good-looking
1569  [[ ! -d /var/log/smage ]] && install -d /var/log/smage  echo
 echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log  
   
 src_prepare | ${SMAGE_LOG_CMD}  
 die_pipestatus 0 "src_prepare failed"  
 step_by_step $_  
   
 src_compile | ${SMAGE_LOG_CMD}  
 die_pipestatus 0 "src_compile failed"  
 step_by_step $_  
1570    
1571  # only run checks if requested  if mqueryfeature "!compressdoc"
 if [[ ${MAGE_CHECK} != true ]]  
1572  then  then
1573   echo "MAGE_CHECK not requested; src_check() will not be run!" | ${SMAGE_LOG_CMD}   echo -e "!compressdoc detected; documentation will not be compressed ..."
1574   step_by_step src_check  elif mqueryfeature "!pkgbuild"
1575    then
1576     echo "!pkgbuild detected; skipping documentation compression..."
1577  else  else
1578   src_check | ${SMAGE_LOG_CMD}   # compressing doc, info & man files
1579   die_pipestatus 0 "src_check failed"   if [[ -n ${SPLIT_PACKAGES} ]]
1580   step_by_step $_   then
1581     for subpackage in ${SPLIT_PACKAGES}
1582     do
1583     run_resume mcompressdoc_${subpackage} || mcompressdocs ${BINDIR}_${subpackage}
1584     resume_stamp mcompressdoc_${subpackage}
1585     done
1586     else
1587     run_resume mcompressdoc || mcompressdocs ${BINDIR}
1588     resume_stamp mcompressdoc
1589     fi
1590  fi  fi
1591    
1592  # build several subpackages  if mqueryfeature "!libtool"
 if [[ -n ${SPLIT_PACKAGES} ]]  
1593  then  then
1594   # save bindir & pname   if mqueryfeature "!pkgbuild"
1595   split_save_variables   then
1596   export SAVED_BINDIR="${BINDIR}"   echo "!pkgbuild detected; skipping libtool archive stripping ..."
1597   for subpackage in ${SPLIT_PACKAGES}   else
1598   do   if [[ -n ${SPLIT_PACKAGES} ]]
  if typeset -f src_install_${subpackage} > /dev/null  
1599   then   then
1600   # export subpackage bindir   for subpackage in ${SPLIT_PACKAGES}
1601   export BINDIR="${SAVED_BINDIR}_${subpackage}"   do
1602   # export PNAME, several internal function and include   echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives for '${subpackage}' ...${COLDEFAULT}"
1603   # rely on this variable   run_resume mstriplibtoolarchive_${subpackage} || mstriplibtoolarchive ${BINDIR}_${subpackage}
1604   export PNAME="${subpackage}"   resume_stamp mstriplibtoolarchive_${subpackage}
1605     done
1606   echo   else
1607   echo -en "${COLBLUE}*** ${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}"
1608   echo -en "  Running ${COLGREEN}split src_install()${COLDEFAULT}"   run_resume mstriplibtoolarchive || mstriplibtoolarchive ${BINDIR}
1609   echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}"   resume_stamp mstriplibtoolarchive
  echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..."  
   
  src_install_${subpackage} | ${SMAGE_LOG_CMD}  
  die_pipestatus 0 "src_install_${subpackage} failed"  
  step_by_step $_  
1610   fi   fi
1611   done   fi
  # restore bindir & pname  
  split_restore_variables  
  # unset all saved smage variables  
  split_unset_variables  
 else  
  src_install | ${SMAGE_LOG_CMD}  
  die_pipestatus 0 "src_install failed"  
  step_by_step $_  
1612  fi  fi
1613    
1614  # compressing doc, info & man files  if mqueryfeature "purge"
 if [[ -n ${SPLIT_PACKAGES} ]]  
1615  then  then
1616   for subpackage in ${SPLIT_PACKAGES}   if mqueryfeature "!pkgbuild"
1617   do   then
1618   mcompressdocs ${BINDIR}_${subpackage}   echo "!pkgbuild detected; skipping file purgation..."
1619   done   else
 else  
  mcompressdocs ${BINDIR}  
 fi  
   
   
 # stripping all bins and libs  
 case ${NOSTRIP} in  
  true|TRUE|yes|y)  
  echo -e "NOSTRIP=true detected; Package will not be stripped ..."  
  ;;  
  *)  
1620   if [[ -n ${SPLIT_PACKAGES} ]]   if [[ -n ${SPLIT_PACKAGES} ]]
1621   then   then
1622   for subpackage in ${SPLIT_PACKAGES}   for subpackage in ${SPLIT_PACKAGES}
1623   do   do
1624   echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} purging all purge targets in '${subpackage}' ...${COLDEFAULT}"
1625   mstripbins ${BINDIR}_${subpackage}   run_resume mpurgetargets_${subpackage} || mpurgetargets ${BINDIR}_${subpackage}
1626   echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}"   resume_stamp mpurgetargets_${subpackage}
  mstriplibs ${BINDIR}_${subpackage}  
  echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}"  
  mstripstatic ${BINDIR}_${subpackage}  
1627   done   done
1628   else   else
1629   echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}"
1630   mstripbins ${BINDIR}   run_resume mpurgetargets || mpurgetargets ${BINDIR}
1631   echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}"   resume_stamp mpurgetargets
  mstriplibs ${BINDIR}  
  echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}"  
  mstripstatic ${BINDIR}  
1632   fi   fi
1633   ;;   fi
1634  esac  fi
1635    
1636    # stripping all bins and libs
1637    if mqueryfeature "!strip"
1638    then
1639     echo -e "!strip detected; Package will not be stripped ..."
1640    elif mqueryfeature "!pkgbuild"
1641    then
1642     echo "!pkgbuild detected; skipping stripping of the package ..."
1643    else
1644     if [[ -n ${SPLIT_PACKAGES} ]]
1645     then
1646     for subpackage in ${SPLIT_PACKAGES}
1647     do
1648     echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}"
1649     run_resume mstripbins_${subpackage} || mstripbins ${BINDIR}_${subpackage}
1650     resume_stamp mstripbins_${subpackage}
1651     echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}"
1652     run_resume mstriplibs_${subpackage} || mstriplibs ${BINDIR}_${subpackage}
1653     resume_stamp mstriplibs_${subpackage}
1654     echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}"
1655     run_resume mstripstatic_${subpackage} || mstripstatic ${BINDIR}_${subpackage}
1656     resume_stamp mstripstatic_${subpackage}
1657     done
1658     else
1659     echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}"
1660     run_resume mstripbins || mstripbins ${BINDIR}
1661     resume_stamp mstripbins
1662     echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}"
1663     run_resume mstriplibs || mstriplibs ${BINDIR}
1664     resume_stamp mstriplibs
1665     echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}"
1666     run_resume mstripstatic || mstripstatic ${BINDIR}
1667     resume_stamp mstripstatic
1668     fi
1669    fi
1670    
1671  # the new buildpkg command  if mqueryfeature "!pkgbuild"
1672  case ${NOPKGBUILD} in  then
1673   true|TRUE|yes|y)   echo -e "!pkgbuild detected; Package will not be build ..."
1674   echo -e "NOPGKBUILD=true detected; Package will not be build ..."  else
  ;;  
  *)  
1675   # build several targets   # build several targets
1676   if [[ -n ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
1677   then   then
# Line 1610  case ${NOPKGBUILD} in Line 1681  case ${NOPKGBUILD} in
1681   if typeset -f ${target}_pkgbuild > /dev/null   if typeset -f ${target}_pkgbuild > /dev/null
1682   then   then
1683   # run it   # run it
1684   ${target}_pkgbuild   run_resume ${target}_pkgbuild || ${target}_pkgbuild
1685     resume_stamp ${target}_pkgbuild
1686   fi   fi
1687   # now create the target package   # now create the target package
1688   ${MLIBDIR}/pkgbuild_dir.sh \   run_resume pkg_builddir_${target} || ${MLIBDIR}/pkgbuild_dir.sh \
1689   "${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \   "${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \
1690   ${BINDIR} || die "target: ${target} package-build failed"   ${BINDIR} || die "target: ${target} package-build failed"
1691     resume_stamp pkg_builddir_${target}
1692    
1693   # build pkg-md5-sum if requested   # build pkg-md5-sum if requested
1694   generate_package_md5sum \   run_resume md5sum_${target} || generate_package_md5sum \
1695   --pcat "${PCATEGORIE}" \   --pcat "${PCATEGORIE}" \
1696   --pname "${PNAME}" \   --pname "${PNAME}" \
1697   --pver "${PVER}" \   --pver "${PVER}" \
1698   --pbuild "${PBUILD}" \   --pbuild "${PBUILD}" \
1699   --parch "${ARCH}" \   --parch "${ARCH}" \
1700   --target "${target}"   --target "${target}"
1701     resume_stamp md5sum_${target}
1702    
1703   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}"
1704   done   done
# Line 1639  case ${NOPKGBUILD} in Line 1713  case ${NOPKGBUILD} in
1713   export PNAME="${subpackage}"   export PNAME="${subpackage}"
1714   split_info_${PNAME}   split_info_${PNAME}
1715    
1716   # jump to next one if NOPKGBUILD is set in split_info   # jump to next one if !pkgbuild is set in split_info
1717   case ${NOPKGBUILD} in   mqueryfeature "!pkgbuild" && continue
  true|TRUE|yes|y) continue ;;  
  esac  
1718    
1719   # check if an special subpackage_pkgbuild exists   # check if an special subpackage_pkgbuild exists
1720   if typeset -f ${PNAME}_pkgbuild > /dev/null   if typeset -f ${PNAME}_pkgbuild > /dev/null
1721   then   then
1722   # run it   # run it
1723   ${PNAME}_pkgbuild   run_resume ${PNAME}_pkgbuild || ${PNAME}_pkgbuild
1724     resume_stamp ${PNAME}_pkgbuild
1725   fi   fi
1726   # now create the target package   # now create the target package
1727   ${MLIBDIR}/pkgbuild_dir.sh \   run_resume pkg_builddir_${PNAME} || ${MLIBDIR}/pkgbuild_dir.sh \
1728   "${PNAME}-${PVER}-${ARCH}-${PBUILD}" \   "${PNAME}-${PVER}-${ARCH}-${PBUILD}" \
1729   "${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed"   "${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed"
1730     resume_stamp pkg_builddir_${PNAME}
1731    
1732   # build pkg-md5-sum if requested   # build pkg-md5-sum if requested
1733   generate_package_md5sum \   run_resume md5sum_${PNAME} || generate_package_md5sum \
1734   --pcat "${PCATEGORIE}" \   --pcat "${PCATEGORIE}" \
1735   --pname "${PNAME}" \   --pname "${PNAME}" \
1736   --pver "${PVER}" \   --pver "${PVER}" \
1737   --pbuild "${PBUILD}" \   --pbuild "${PBUILD}" \
1738   --parch "${ARCH}"   --parch "${ARCH}"
1739     resume_stamp md5sum_${PNAME}
1740    
1741   echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"   echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"
1742    
# Line 1672  case ${NOPKGBUILD} in Line 1747  case ${NOPKGBUILD} in
1747   split_unset_variables   split_unset_variables
1748    
1749   else   else
1750   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"   run_resume pkg_builddir || ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"
1751     resume_stamp pkg_builddir
1752    
1753   # build pkg-md5-sum if requested   # build pkg-md5-sum if requested
1754   generate_package_md5sum \   run_resume md5sum || generate_package_md5sum \
1755   --pcat "${PCATEGORIE}" \   --pcat "${PCATEGORIE}" \
1756   --pname "${PNAME}" \   --pname "${PNAME}" \
1757   --pver "${PVER}" \   --pver "${PVER}" \
1758   --pbuild "${PBUILD}" \   --pbuild "${PBUILD}" \
1759   --parch "${ARCH}"   --parch "${ARCH}"
1760     resume_stamp md5sum
1761    
1762   echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}"   echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}"
1763   fi   fi
1764    
1765   # build src-pkg-tarball if requested   # build src-pkg-tarball if requested
1766   [[ ${CREATE_SRC_PKG_TARBALL} = true ]] && source_pkg_build ${SMAGENAME}   if mqueryfeature "srcpkg"
1767   ;;   then
1768  esac   run_resume srcpkgbuild || source_pkg_build ${SMAGENAME}
1769     resume_stamp srcpkgbuild
1770     fi
1771    fi
1772    
1773  if [[ ${SMAGE_BUILD_LOGGING} != false ]]  if mqueryfeature "buildlog"
1774  then  then
1775   bzip2 -9f /var/log/smage/${PKGNAME}.log   bzip2 -9f /var/log/smage/${PKGNAME}.log
1776  else  else
1777   [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log   [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log
1778  fi  fi
1779    
 # for sure  
 unset NOPKGBUILD  
 unset NOSTRIP  
   
1780  xtitleclean  xtitleclean

Legend:
Removed from v.1576  
changed lines
  Added in v.1621