Magellan Linux

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

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

revision 1572 by niro, Wed Dec 28 10:31:45 2011 UTC revision 1630 by niro, Fri Jan 13 13:17:21 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   # always use verbose mode for source downloads
181   unset my_SRC_URI_DEST   FVERBOSE=off msetfeature "verbose"
182   unset my_SRC_URI_MIRROR   # do not die here, mchecksum catches download errors
183   unset my_SOURCEDIR   mdownload --uri "${uri}" --dir "${outputdir}"
184   done  
185     # unset them to be sure
186     unset uri
187     unset subdir
188     unset outputdir
189     done
190    
191   # recheck md5 sums   # recheck md5 sums after download
192   echo   echo
193   echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} Checking MD5 sums:${COLDEFAULT}"
194   ( 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"
195   echo   echo
196     else
197     echo -e "${COLBLUE}===${COLGREEN} All sources already fetched, nothing to do${COLDEFAULT}"
198     fi
199    
200   # not needed anymore   # not needed anymore
201   unset SRC_URI   unset SRC_URI
202  }  }
203    
204  # dummy function, used if that not exist in smage file  # dummy function, used if that does not exist in smage file
205  src_prepare()  src_prepare()
206  {  {
207   echo "no src_prepare defined"   echo "no src_prepare defined; doing nothing ..."
  sleep 2  
208   return 0   return 0
209  }  }
210    
211  # dummy function, used if that not exist in smage file  # dummy function, used if that does not exist in smage file
212  src_compile()  src_compile()
213  {  {
214   echo "no src_compile defined"   echo "no src_compile defined; doing nothing ..."
  sleep 2  
215   return 0   return 0
216  }  }
217    
218  # dummy function, used if that not exist in smage file  # dummy function, used if that does not exist in smage file
219    src_check()
220    {
221     echo "no src_check defined; doing nothing ..."
222     return 0
223    }
224    
225    # dummy function, used if that does not exist in smage file
226  src_install()  src_install()
227  {  {
228   echo "no src_install defined"   echo "no src_install defined; doing nothing ..."
  sleep 2  
229   return 0   return 0
230  }  }
231    
# Line 355  mlibdir() Line 239  mlibdir()
239    
240  mconfigure()  mconfigure()
241  {  {
242     local myopts
243     if [[ ! -z ${CTARGET} ]]
244     then
245     myopts="--target=${CTARGET}"
246     fi
247    
248   if [ -x ./configure ]   if [ -x ./configure ]
249   then   then
250   ./configure \   ./configure \
# Line 367  mconfigure() Line 257  mconfigure()
257   --sysconfdir=/etc \   --sysconfdir=/etc \
258   --localstatedir=/var/lib \   --localstatedir=/var/lib \
259   --libdir=/usr/$(mlibdir) \   --libdir=/usr/$(mlibdir) \
260     ${myopts} \
261   "$@" || die "mconfigure failed"   "$@" || die "mconfigure failed"
262   else   else
263   echo "configure is not an executable ..."   echo "configure is not an executable ..."
# Line 462  munpack() Line 353  munpack()
353   rar)   rar)
354   unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST}  || die ".rar unpack failed."   unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST}  || die ".rar unpack failed."
355   ;;   ;;
356   zip|xpi)   zip|xpi|jar)
357   unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed."   unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed."
358   ;;   ;;
359   rpm)   rpm)
# Line 528  mautoreconf() Line 419  mautoreconf()
419  minstalldocs()  minstalldocs()
420  {  {
421   local docfiles   local docfiles
422     local doc
423   docfiles="$@"   docfiles="$@"
424    
425   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]   if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ]
# Line 535  minstalldocs() Line 427  minstalldocs()
427   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."   install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs."
428   fi   fi
429    
430   local i   for doc in ${docfiles}
  for i in ${docfiles}  
431   do   do
432   if [ -f ${i} ]   if [ -f ${doc} ]
433   then   then
434   cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs."   if mqueryfeature "compressdoc"
435   install -m 0644 ${SRCDIR}/${i}.gz \   then
436   ${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}."
437     chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "fixing permissions of ${doc}."
438     else
439     install -m 0644 ${SRCDIR}/${i} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}."
440     fi
441   fi   fi
442   done   done
443  }  }
# Line 551  mstriplibs() Line 446  mstriplibs()
446  {  {
447   local stripdir="$@"   local stripdir="$@"
448    
449   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
450   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"
451     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
452  }  }
453    
454  mstripbins()  mstripbins()
455  {  {
456   local stripdir="$@"   local stripdir="$@"
457    
458   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
459   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"
460     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
461  }  }
462    
463  mstripstatic()  mstripstatic()
464  {  {
465   local stripdir="$@"   local stripdir="$@"
466    
467   [ -z "${stripdir}" ] && stripdir=${BINDIR}   [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
468   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"
469     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
470    }
471    
472    mstriplibtoolarchive()
473    {
474     local stripdir="$@"
475    
476     [[ -z ${stripdir} ]] && stripdir="${BINDIR}"
477     find ${stripdir} ! -type d -name \*.la | xargs | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null
478    }
479    
480    mpurgetargets()
481    {
482     local stripdir="$@"
483     local target
484    
485     [[ -z ${stripdir} ]] && stripdir=${BINDIR}
486     # nothing to do in this case
487     [[ -z ${PURGE_TARGETS[*]} ]] && return
488    
489     for target in ${PURGE_TARGETS[*]}
490     do
491     # check if target is a regex pattern without any slashes
492     if [[ ${target} = ${target//\/} ]]
493     then
494     find ${BINDIR} -type f -name "${target}" | xargs --no-run-if-empty rm -f -- 2> /dev/null
495     else
496     rm -f -- ${target} 2> /dev/null
497     fi
498     done
499  }  }
500    
501  mcompressdocs()  mcompressdocs()
# Line 627  setup_ccache_environment() Line 554  setup_ccache_environment()
554   fi   fi
555  }  }
556    
   
557  # fixes given dependencies to match a MAGE_TARGET  # fixes given dependencies to match a MAGE_TARGET
558  # fix_mage_deps -target s/depend # <-- note -target !  # fix_mage_deps -target s/depend # <-- note -target !
559  fix_mage_deps()  fix_mage_deps()
# Line 814  regen_mage_tree() Line 740  regen_mage_tree()
740   local subpackage   local subpackage
741    
742   # build them only if requested   # build them only if requested
743   if [[ ${REGEN_MAGE_TREE} = true ]]   if mqueryfeature regentree
744   then   then
745   # run it without targets   # run it without targets
746   if [[ -n ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
# Line 877  regen_mage_tree() Line 803  regen_mage_tree()
803   unset STATE   unset STATE
804   unset DESCRIPTION   unset DESCRIPTION
805   unset HOMEPAGE   unset HOMEPAGE
806   unset PKGTYPE   # unset PKGTYPE <-- don't do that either; smage needs this var
807   unset INHERITS   unset INHERITS
808   unset DEPEND   unset DEPEND
809   unset SDEPEND   unset SDEPEND
# Line 903  split_save_variables() Line 829  split_save_variables()
829   export SAVED_DEPEND="${DEPEND}"   export SAVED_DEPEND="${DEPEND}"
830   export SAVED_SDEPEND="${SDEPEND}"   export SAVED_SDEPEND="${SDEPEND}"
831   export SAVED_PROVIDE="${PROVIDE}"   export SAVED_PROVIDE="${PROVIDE}"
832   export SAVED_NOPKGBUILD="${NOPKGBUILD}"   export SAVED_PKGTYPE="${PKGTYPE}"
833    
834     # special handling needed for mage features
835     # pkgbuild
836     mqueryfeature "pkgbuild" && export SAVED_FEATURE_PKGBUILD="pkgbuild"
837     mqueryfeature "!pkgbuild" && export SAVED_FEATURE_PKGBUILD="!pkgbuild"
838     # strip
839     mqueryfeature "strip" && export SAVED_FEATURE_STRIP="strip"
840     mqueryfeature "!strip" && export SAVED_FEATURE_STRIP="!strip"
841     # libtool
842     mqueryfeature "libtool" && export SAVED_FEATURE_LIBTOOL="libtool"
843     mqueryfeature "!libtool" && export SAVED_FEATURE_LIBTOOL="!libtool"
844     # compressdoc
845     mqueryfeature "compressdoc" && export SAVED_FEATURE_COMPRESSDOC="compressdoc"
846     mqueryfeature "!compressdoc" && export SAVED_FEATURE_COMPRESSDOC="!compressdoc"
847    
848   # bindir too   # bindir too
849   export SAVED_BINDIR="${BINDIR}"   export SAVED_BINDIR="${BINDIR}"
# Line 964  split_restore_variables() Line 904  split_restore_variables()
904   export DEPEND="${SAVED_DEPEND}"   export DEPEND="${SAVED_DEPEND}"
905   export SDEPEND="${SAVED_SDEPEND}"   export SDEPEND="${SAVED_SDEPEND}"
906   export PROVIDE="${SAVED_PROVIDE}"   export PROVIDE="${SAVED_PROVIDE}"
907   export NOPKGBUILD="${SAVED_NOPKGBUILD}"   export PKGTYPE="${SAVED_PKGTYPE}"
908    
909     # special handling needed for mage features
910     # pkgbuild
911     FVERBOSE=off msetfeature "${SAVED_FEATURE_PKGBUILD}"
912     # strip
913     FVERBOSE=off msetfeature "${SAVED_FEATURE_STRIP}"
914     # libtool
915     FVERBOSE=off msetfeature "${SAVED_FEATURE_LIBTOOL}"
916     # compressdoc
917     FVERBOSE=off msetfeature "${SAVED_FEATURE_COMPRESSDOC}"
918    
919   # bindir too   # bindir too
920   export BINDIR="${SAVED_BINDIR}"   export BINDIR="${SAVED_BINDIR}"
# Line 1024  split_unset_variables() Line 974  split_unset_variables()
974   unset SAVED_SDEPEND   unset SAVED_SDEPEND
975   unset SAVED_PROVIDE   unset SAVED_PROVIDE
976   unset SAVED_BINDIR   unset SAVED_BINDIR
977   unset SAVED_NOPKGBUILD   unset SAVED_PKGTYPE
978     unset SAVED_FEATURE_PKGBUILD
979     unset SAVED_FEATURE_STRIP
980     unset SAVED_FEATURE_LIBTOOL
981     unset SAVED_FEATURE_COMPRESSDOC
982   unset SPLIT_PACKAGE_BASE   unset SPLIT_PACKAGE_BASE
983   unset -f SAVED_preinstall   unset -f SAVED_preinstall
984   unset -f SAVED_postinstall   unset -f SAVED_postinstall
# Line 1124  generate_package_md5sum() Line 1078  generate_package_md5sum()
1078   # fix target as it may be empty !   # fix target as it may be empty !
1079   [ -n "${target}" ] && target="-${target}"   [ -n "${target}" ] && target="-${target}"
1080    
   
1081   # build pkgname   # build pkgname
1082   pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"   pkgname="${pname}${target}-${pver}-${parch}-${pbuild}"
1083    
1084   # build pkg-md5-sum only if requested   # build pkg-md5-sum only if requested
1085   if [[ ${REGEN_MAGE_TREE} = true ]]   if mqueryfeature regentree
1086   then   then
1087   echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}"   echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}"
1088    
# Line 1184  source_pkg_build() Line 1137  source_pkg_build()
1137    
1138  step_by_step()  step_by_step()
1139  {  {
1140   if [[ ${STEP_BY_STEP} = true ]]   if mqueryfeature stepbystep
1141   then   then
1142   echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"   echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}"
1143   echo "Press [enter] to continue"   echo "Press [enter] to continue"
# Line 1192  step_by_step() Line 1145  step_by_step()
1145   fi   fi
1146  }  }
1147    
1148    resume_stamp()
1149    {
1150     local step="$1"
1151     [[ ! -d ${BUILDDIR}/.stamps ]] && install -d ${BUILDDIR}/.stamps
1152     touch ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step}
1153    }
1154    
1155    run_resume()
1156    {
1157     local step="$1"
1158    
1159     if mqueryfeature "resume" && [[ -f ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step} ]]
1160     then
1161     echo -e "${COLMAGENTA}${step} already processed; doing nothing${COLDEFAULT}"
1162     return 0
1163     else
1164     return 1
1165     fi
1166    }
1167    
1168  # print out our version  # print out our version
1169  showversion  showversion
# Line 1204  then Line 1176  then
1176   exit 1   exit 1
1177  fi  fi
1178    
1179    # load supported mage features
1180    load_mage_features
1181    
1182  # updating smage2-scripts  # updating smage2-scripts
1183  if [[ $1 = update ]]  if [[ $1 = update ]]
1184  then  then
# Line 1388  fi Line 1363  fi
1363  if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]  if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ]
1364  then  then
1365   SRCPKGTARBALL="${2}"   SRCPKGTARBALL="${2}"
1366   USE_SRC_PKG_TARBALL=true   msetfeature "srcpkgtarball"
1367    
1368   # abort if given file is not a source pkg   # abort if given file is not a source pkg
1369   [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."   [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file."
# Line 1409  then Line 1384  then
1384   [[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}"   [[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}"
1385  fi  fi
1386    
1387    if [ "$1" == "--resume" -a -n "$2" ]
1388    then
1389     msetfeature "resume"
1390     SMAGENAME="$2"
1391    fi
1392    
1393  [ ! -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."
1394  [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] &&  [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] &&
# Line 1432  echo -e "${COLGREEN}Compiling ${PKGNAME} Line 1412  echo -e "${COLGREEN}Compiling ${PKGNAME}
1412  # auto regen mage tree if requested  # auto regen mage tree if requested
1413  regen_mage_tree  regen_mage_tree
1414    
1415  if [[ ${CREATE_SRC_PKG_TARBALL} = true ]]  if mqueryfeature "srcpkg"
1416  then  then
1417   if [[ -d ${SOURCEDIR}/${PNAME} ]]   if [[ -d ${SOURCEDIR}/${PNAME} ]]
1418   then   then
# Line 1442  then Line 1422  then
1422  fi  fi
1423    
1424  # download sources  # download sources
1425  [[ ${USE_SRC_PKG_TARBALL} != true ]] && download_sources  mqueryfeature "srcpkgtarball" || download_sources
1426    
1427  # fixes some issues with these functions  # fixes some issues with these functions
1428  export -f src_prepare || die "src_prepare export failed"  export -f src_prepare || die "src_prepare export failed"
1429  export -f src_compile || die "src_compile export failed"  export -f src_compile || die "src_compile export failed"
1430    export -f src_check || die "src_check export failed"
1431  export -f src_install || die "src_install export failed"  export -f src_install || die "src_install export failed"
1432    
1433  # fixes some compile issues  # fixes some compile issues
1434  export CHOST="${CHOST}" || die "CHOST export failed"  export CHOST="${CHOST}" || die "CHOST export failed"
1435  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"  export CFLAGS="${CFLAGS}" || die "CFLAGS export failed"
1436  export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"  if [[ -z ${CXXFLAGS} ]]
1437    then
1438     export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed"
1439    else
1440     export CXXFLAGS="${CXXFLAGS}" || die "CXXFLAGS export failed"
1441    fi
1442    export LDFLAGS="${LDFLAGS}" || die "LDFLAGS export failed"
1443  export BINDIR="${BINDIR}" || die "BINDIR export failed"  export BINDIR="${BINDIR}" || die "BINDIR export failed"
1444  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"  export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed"
1445    
   
1446  # setup distcc  # setup distcc
1447  # 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
1448  [[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment  mqueryfeature "distcc" && setup_distcc_environment
1449    
1450  # setup ccache  # setup ccache
1451  [[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment  mqueryfeature "ccache" && setup_ccache_environment
1452    
1453  # small sleep to show our settings  if mqueryfeature "resume"
 sleep 1  
   
 # cleans up build if a previously one exists  
 if [ -d ${BUILDDIR} ]  
1454  then  then
1455   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."  
1456    
1457  # cleans up srcdir if a previously unpacked one exists   # setup build logging
1458  if [ -d ${SRCDIR} ]   [[ ! -d /var/log/smage ]] && install -d /var/log/smage
1459  then   if [[ -f /var/log/smage/${PKGNAME}.log.bz2 ]]
1460   rm -rf ${SRCDIR}   then
1461  fi   bunzip2 -f /var/log/smage/${PKGNAME}.log.bz2
1462     fi
1463     echo -e "### Resume started on $(date) ###\n" >> /var/log/smage/${PKGNAME}.log
1464    
1465  # cleans up bindir if a previous build exists or creates a new one  else
1466  if [ -d ${BINDIR} ]   # clean up builddir if a previously one exist
1467  then   if [ -d ${BUILDDIR} ]
1468   rm -rf ${BINDIR}   then
1469  fi   rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR."
1470  install -d ${BINDIR} || die "couldn't create \$BINDIR."   fi
1471     install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR."
1472    
1473  # cleans up package temp dir if a previous build exists   # clean up srcdir if a previously unpacked one exist
1474  if [ -d ${BUILDDIR}/${PKGNAME} ]   if [ -d ${SRCDIR} ]
1475  then   then
1476   rm -rf ${BUILDDIR}/${PKGNAME}   rm -rf ${SRCDIR}
1477     fi
1478    
1479     # clean up bindir if a previous build exist or create a new one
1480     if [ -d ${BINDIR} ]
1481     then
1482     rm -rf ${BINDIR}
1483     fi
1484     install -d ${BINDIR} || die "couldn't create \$BINDIR."
1485    
1486     # clean up package temp dir if a previous build exist
1487     if [ -d ${BUILDDIR}/${PKGNAME} ]
1488     then
1489     rm -rf ${BUILDDIR}/${PKGNAME}
1490     fi
1491    
1492     # clean up stamps dir
1493     if [ -d ${BUILDDIR}/.stamps ]
1494     then
1495     rm -rf ${BUILDDIR}/.stamps
1496     fi
1497    
1498     # setup build logging
1499     [[ ! -d /var/log/smage ]] && install -d /var/log/smage
1500     echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log
1501  fi  fi
1502    
1503  # cleans up timestamp if one exists  if [[ ${PKGTYPE} = virtual ]]
 if [ -f /var/tmp/timestamp ]  
1504  then  then
1505   mage rmstamp   echo "virtual package detected; nothing will be build ..."
1506  fi   # automatically set !pkgbuild here too
1507     msetfeature "!pkgbuild"
1508    else
1509     ( run_resume src_prepare || src_prepare ) | ${SMAGE_LOG_CMD}
1510     die_pipestatus 0 "src_prepare failed"
1511     resume_stamp src_prepare
1512     step_by_step src_prepare
1513    
1514     ( run_resume src_compile || src_compile ) | ${SMAGE_LOG_CMD}
1515     die_pipestatus 0 "src_compile failed"
1516     resume_stamp src_compile
1517     step_by_step src_compile
1518    
1519  # setup build loggins   # only run checks if requested
1520  [[ ! -d /var/log/smage ]] && install -d /var/log/smage   if mqueryfeature "!check"
1521  echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log   then
1522     echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD}
1523  src_prepare | ${SMAGE_LOG_CMD}   else
1524  die_pipestatus 0 "src_prepare failed"   ( run_resume src_check || src_check ) | ${SMAGE_LOG_CMD}
1525  step_by_step $_   die_pipestatus 0 "src_check failed"
1526     resume_stamp src_check
1527  src_compile | ${SMAGE_LOG_CMD}   fi
1528  die_pipestatus 0 "src_compile failed"   step_by_step src_check
 step_by_step $_  
1529    
1530  # build several subpackages   # build several subpackages
1531  if [[ -n ${SPLIT_PACKAGES} ]]   if [[ -n ${SPLIT_PACKAGES} ]]
1532  then   then
1533   # save bindir & pname   # save bindir & pname
1534   split_save_variables   split_save_variables
1535   export SAVED_BINDIR="${BINDIR}"   export SAVED_BINDIR="${BINDIR}"
1536   for subpackage in ${SPLIT_PACKAGES}   for subpackage in ${SPLIT_PACKAGES}
1537   do   do
1538   if typeset -f src_install_${subpackage} > /dev/null   if typeset -f src_install_${subpackage} > /dev/null
1539   then   then
1540   # export subpackage bindir   # export subpackage bindir
1541   export BINDIR="${SAVED_BINDIR}_${subpackage}"   export BINDIR="${SAVED_BINDIR}_${subpackage}"
1542   # export PNAME, several internal function and include   # export PNAME, several internal function and include
1543   # rely on this variable   # rely on this variable
1544   export PNAME="${subpackage}"   export PNAME="${subpackage}"
1545    
1546   echo   echo
1547   echo -en "${COLBLUE}*** ${COLDEFAULT}"   echo -en "${COLBLUE}*** ${COLDEFAULT}"
1548   echo -en "  Running ${COLGREEN}split src_install()${COLDEFAULT}"   echo -en "  Running ${COLGREEN}split src_install()${COLDEFAULT}"
1549   echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}"   echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}"
1550   echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..."   echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..."
1551    
1552   src_install_${subpackage} | ${SMAGE_LOG_CMD}   ( run_resume src_install_${subpackage} || src_install_${subpackage} ) | ${SMAGE_LOG_CMD}
1553   die_pipestatus 0 "src_install_${subpackage} failed"   die_pipestatus 0 "src_install_${subpackage} failed"
1554   step_by_step $_   resume_stamp src_install_${subpackage}
1555   fi   step_by_step src_install_${subpackage}
1556   done   fi
1557   # restore bindir & pname   done
1558   split_restore_variables   # restore bindir & pname
1559   # unset all saved smage variables   split_restore_variables
1560   split_unset_variables   # unset all saved smage variables
1561  else   split_unset_variables
1562   src_install | ${SMAGE_LOG_CMD}   else
1563   die_pipestatus 0 "src_install failed"   ( run_resume src_install || src_install ) | ${SMAGE_LOG_CMD}
1564   step_by_step $_   die_pipestatus 0 "src_install failed"
1565     resume_stamp src_install
1566     step_by_step src_install
1567     fi
1568  fi  fi
1569    
1570  # compressing doc, info & man files  # echo for sake of good-looking
1571  if [[ -n ${SPLIT_PACKAGES} ]]  echo
1572    
1573    if mqueryfeature "!compressdoc"
1574  then  then
1575   for subpackage in ${SPLIT_PACKAGES}   echo -e "!compressdoc detected; documentation will not be compressed ..."
1576   do  elif mqueryfeature "!pkgbuild"
1577   mcompressdocs ${BINDIR}_${subpackage}  then
1578   done   echo "!pkgbuild detected; skipping documentation compression..."
1579  else  else
1580   mcompressdocs ${BINDIR}   # compressing doc, info & man files
1581     if [[ -n ${SPLIT_PACKAGES} ]]
1582     then
1583     for subpackage in ${SPLIT_PACKAGES}
1584     do
1585     run_resume mcompressdoc_${subpackage} || mcompressdocs ${BINDIR}_${subpackage}
1586     resume_stamp mcompressdoc_${subpackage}
1587     done
1588     else
1589     run_resume mcompressdoc || mcompressdocs ${BINDIR}
1590     resume_stamp mcompressdoc
1591     fi
1592  fi  fi
1593    
1594    if mqueryfeature "!libtool"
1595    then
1596     if mqueryfeature "!pkgbuild"
1597     then
1598     echo "!pkgbuild detected; skipping libtool archive stripping ..."
1599     else
1600     if [[ -n ${SPLIT_PACKAGES} ]]
1601     then
1602     for subpackage in ${SPLIT_PACKAGES}
1603     do
1604     echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives for '${subpackage}' ...${COLDEFAULT}"
1605     run_resume mstriplibtoolarchive_${subpackage} || mstriplibtoolarchive ${BINDIR}_${subpackage}
1606     resume_stamp mstriplibtoolarchive_${subpackage}
1607     done
1608     else
1609     echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}"
1610     run_resume mstriplibtoolarchive || mstriplibtoolarchive ${BINDIR}
1611     resume_stamp mstriplibtoolarchive
1612     fi
1613     fi
1614    fi
1615    
1616  # stripping all bins and libs  if mqueryfeature "purge"
1617  case ${NOSTRIP} in  then
1618   true|TRUE|yes|y)   if mqueryfeature "!pkgbuild"
1619   echo -e "NOSTRIP=true detected; Package will not be stripped ..."   then
1620   ;;   echo "!pkgbuild detected; skipping file purgation..."
1621   *)   else
1622   if [[ -n ${SPLIT_PACKAGES} ]]   if [[ -n ${SPLIT_PACKAGES} ]]
1623   then   then
1624   for subpackage in ${SPLIT_PACKAGES}   for subpackage in ${SPLIT_PACKAGES}
1625   do   do
1626   echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} purging all purge targets in '${subpackage}' ...${COLDEFAULT}"
1627   mstripbins ${BINDIR}_${subpackage}   run_resume mpurgetargets_${subpackage} || mpurgetargets ${BINDIR}_${subpackage}
1628   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}  
1629   done   done
1630   else   else
1631   echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}"   echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}"
1632   mstripbins ${BINDIR}   run_resume mpurgetargets || mpurgetargets ${BINDIR}
1633   echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}"   resume_stamp mpurgetargets
  mstriplibs ${BINDIR}  
  echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}"  
  mstripstatic ${BINDIR}  
1634   fi   fi
1635   ;;   fi
1636  esac  fi
1637    
1638    # stripping all bins and libs
1639    if mqueryfeature "!strip"
1640    then
1641     echo -e "!strip detected; Package will not be stripped ..."
1642    elif mqueryfeature "!pkgbuild"
1643    then
1644     echo "!pkgbuild detected; skipping stripping of the package ..."
1645    else
1646     if [[ -n ${SPLIT_PACKAGES} ]]
1647     then
1648     for subpackage in ${SPLIT_PACKAGES}
1649     do
1650     echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}"
1651     run_resume mstripbins_${subpackage} || mstripbins ${BINDIR}_${subpackage}
1652     resume_stamp mstripbins_${subpackage}
1653     echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}"
1654     run_resume mstriplibs_${subpackage} || mstriplibs ${BINDIR}_${subpackage}
1655     resume_stamp mstriplibs_${subpackage}
1656     echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}"
1657     run_resume mstripstatic_${subpackage} || mstripstatic ${BINDIR}_${subpackage}
1658     resume_stamp mstripstatic_${subpackage}
1659     done
1660     else
1661     echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}"
1662     run_resume mstripbins || mstripbins ${BINDIR}
1663     resume_stamp mstripbins
1664     echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}"
1665     run_resume mstriplibs || mstriplibs ${BINDIR}
1666     resume_stamp mstriplibs
1667     echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}"
1668     run_resume mstripstatic || mstripstatic ${BINDIR}
1669     resume_stamp mstripstatic
1670     fi
1671    fi
1672    
1673  # the new buildpkg command  if mqueryfeature "!pkgbuild"
1674  case ${NOPKGBUILD} in  then
1675   true|TRUE|yes|y)   echo -e "!pkgbuild detected; Package will not be build ..."
1676   echo -e "NOPGKBUILD=true detected; Package will not be build ..."  else
  ;;  
  *)  
1677   # build several targets   # build several targets
1678   if [[ -n ${MAGE_TARGETS} ]]   if [[ -n ${MAGE_TARGETS} ]]
1679   then   then
1680   for target in ${MAGE_TARGETS}   for target in ${MAGE_TARGETS}
1681   do   do
1682   # check if an special target_pkgbuild exists   # check if a special target_pkgbuild exists
1683   if typeset -f ${target}_pkgbuild > /dev/null   if typeset -f ${target}_pkgbuild > /dev/null
1684   then   then
1685   # run it   # run it
1686   ${target}_pkgbuild   run_resume ${target}_pkgbuild || ${target}_pkgbuild
1687     resume_stamp ${target}_pkgbuild
1688   fi   fi
1689   # now create the target package   # now create the target package
1690   ${MLIBDIR}/pkgbuild_dir.sh \   run_resume pkg_builddir_${target} || ${MLIBDIR}/pkgbuild_dir.sh \
1691   "${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \   "${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \
1692   ${BINDIR} || die "target: ${target} package-build failed"   ${BINDIR} || die "target: ${target} package-build failed"
1693     resume_stamp pkg_builddir_${target}
1694    
1695   # build pkg-md5-sum if requested   # build pkg-md5-sum if requested
1696   generate_package_md5sum \   run_resume md5sum_${target} || generate_package_md5sum \
1697   --pcat "${PCATEGORIE}" \   --pcat "${PCATEGORIE}" \
1698   --pname "${PNAME}" \   --pname "${PNAME}" \
1699   --pver "${PVER}" \   --pver "${PVER}" \
1700   --pbuild "${PBUILD}" \   --pbuild "${PBUILD}" \
1701   --parch "${ARCH}" \   --parch "${ARCH}" \
1702   --target "${target}"   --target "${target}"
1703     resume_stamp md5sum_${target}
1704    
1705   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}"
1706   done   done
# Line 1632  case ${NOPKGBUILD} in Line 1715  case ${NOPKGBUILD} in
1715   export PNAME="${subpackage}"   export PNAME="${subpackage}"
1716   split_info_${PNAME}   split_info_${PNAME}
1717    
1718   # jump to next one if NOPKGBUILD is set in split_info   # jump to next one if !pkgbuild is set in split_info
1719   case ${NOPKGBUILD} in   mqueryfeature "!pkgbuild" && continue
  true|TRUE|yes|y) continue ;;  
  esac  
1720    
1721   # check if an special subpackage_pkgbuild exists   # check if an special subpackage_pkgbuild exists
1722   if typeset -f ${PNAME}_pkgbuild > /dev/null   if typeset -f ${PNAME}_pkgbuild > /dev/null
1723   then   then
1724   # run it   # run it
1725   ${PNAME}_pkgbuild   run_resume ${PNAME}_pkgbuild || ${PNAME}_pkgbuild
1726     resume_stamp ${PNAME}_pkgbuild
1727   fi   fi
1728   # now create the target package   # now create the target package
1729   ${MLIBDIR}/pkgbuild_dir.sh \   run_resume pkg_builddir_${PNAME} || ${MLIBDIR}/pkgbuild_dir.sh \
1730   "${PNAME}-${PVER}-${ARCH}-${PBUILD}" \   "${PNAME}-${PVER}-${ARCH}-${PBUILD}" \
1731   "${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed"   "${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed"
1732     resume_stamp pkg_builddir_${PNAME}
1733    
1734   # build pkg-md5-sum if requested   # build pkg-md5-sum if requested
1735   generate_package_md5sum \   run_resume md5sum_${PNAME} || generate_package_md5sum \
1736   --pcat "${PCATEGORIE}" \   --pcat "${PCATEGORIE}" \
1737   --pname "${PNAME}" \   --pname "${PNAME}" \
1738   --pver "${PVER}" \   --pver "${PVER}" \
1739   --pbuild "${PBUILD}" \   --pbuild "${PBUILD}" \
1740   --parch "${ARCH}"   --parch "${ARCH}"
1741     resume_stamp md5sum_${PNAME}
1742    
1743   echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"   echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}"
1744    
# Line 1665  case ${NOPKGBUILD} in Line 1749  case ${NOPKGBUILD} in
1749   split_unset_variables   split_unset_variables
1750    
1751   else   else
1752   ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"   run_resume pkg_builddir || ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed"
1753     resume_stamp pkg_builddir
1754    
1755   # build pkg-md5-sum if requested   # build pkg-md5-sum if requested
1756   generate_package_md5sum \   run_resume md5sum || generate_package_md5sum \
1757   --pcat "${PCATEGORIE}" \   --pcat "${PCATEGORIE}" \
1758   --pname "${PNAME}" \   --pname "${PNAME}" \
1759   --pver "${PVER}" \   --pver "${PVER}" \
1760   --pbuild "${PBUILD}" \   --pbuild "${PBUILD}" \
1761   --parch "${ARCH}"   --parch "${ARCH}"
1762     resume_stamp md5sum
1763    
1764   echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}"   echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}"
1765   fi   fi
1766    
1767   # build src-pkg-tarball if requested   # build src-pkg-tarball if requested
1768   [[ ${CREATE_SRC_PKG_TARBALL} = true ]] && source_pkg_build ${SMAGENAME}   if mqueryfeature "srcpkg"
1769   ;;   then
1770  esac   run_resume srcpkgbuild || source_pkg_build ${SMAGENAME}
1771     resume_stamp srcpkgbuild
1772     fi
1773    fi
1774    
1775  if [[ ${SMAGE_BUILD_LOGGING} != false ]]  if mqueryfeature "buildlog"
1776  then  then
1777   bzip2 -9f /var/log/smage/${PKGNAME}.log   bzip2 -9f /var/log/smage/${PKGNAME}.log
1778  else  else
1779   [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log   [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log
1780  fi  fi
1781    
 # for sure  
 unset NOPKGBUILD  
 unset NOSTRIP  
   
1782  xtitleclean  xtitleclean

Legend:
Removed from v.1572  
changed lines
  Added in v.1630