--- trunk/mage/usr/lib/mage/smage2.sh 2011/12/28 11:58:28 1580 +++ trunk/mage/usr/lib/mage/smage2.sh 2012/01/09 20:13:34 1617 @@ -10,10 +10,6 @@ # set default user mage.rc : ${MAGERC="/etc/mage.rc"} -## setup ## -SMAGENAME="$1" -SMAGEVERSION="$( < ${MLIBDIR}/version)" - # export default C locale export LC_ALL=C @@ -21,6 +17,10 @@ source ${MAGERC} source ${MLIBDIR}/mage4.functions.sh +## setup ## +SMAGENAME="$1" +SMAGEVERSION="$(< ${MLIBDIR}/version)" + # set PKGDIR and BUILDDIR and BINDIR to MROOT if [[ -n ${MROOT} ]] then @@ -177,7 +177,8 @@ fi echo -e "${COLBLUE}==>${COLGREEN} fetching ${uri}${COLDEFAULT}" - mdownload --uri "${uri}" --dir "${outputdir}" || die "Could not download '${uri}'" + # do not die here, mchecksum catches download errors + mdownload --uri "${uri}" --dir "${outputdir}" # unset them to be sure unset uri @@ -201,28 +202,28 @@ # dummy function, used if that does not exist in smage file src_prepare() { - echo "no src_prepare defined" + echo "no src_prepare defined; doing nothing ..." return 0 } # dummy function, used if that does not exist in smage file src_compile() { - echo "no src_compile defined" + echo "no src_compile defined; doing nothing ..." return 0 } # dummy function, used if that does not exist in smage file src_check() { - echo "no src_check defined" + echo "no src_check defined; doing nothing ..." return 0 } # dummy function, used if that does not exist in smage file src_install() { - echo "no src_install defined" + echo "no src_install defined; doing nothing ..." return 0 } @@ -236,6 +237,12 @@ mconfigure() { + local myopts + if [[ ! -z ${CTARGET} ]] + then + myopts="--target=${CTARGET}" + fi + if [ -x ./configure ] then ./configure \ @@ -248,6 +255,7 @@ --sysconfdir=/etc \ --localstatedir=/var/lib \ --libdir=/usr/$(mlibdir) \ + ${myopts} \ "$@" || die "mconfigure failed" else echo "configure is not an executable ..." @@ -343,7 +351,7 @@ rar) unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST} || die ".rar unpack failed." ;; - zip|xpi) + zip|xpi|jar) unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed." ;; rpm) @@ -409,6 +417,7 @@ minstalldocs() { local docfiles + local doc docfiles="$@" if [ ! -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} ] @@ -416,14 +425,17 @@ install -d ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "creating doc dirs." fi - local i - for i in ${docfiles} + for doc in ${docfiles} do - if [ -f ${i} ] + if [ -f ${doc} ] then - cat ${i} | gzip -9c > ${i}.gz || die "gzipping docs." - install -m 0644 ${SRCDIR}/${i}.gz \ - ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "coping docs." + if mqueryfeature "compressdoc" + then + cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "gzipping +installing ${doc}." + chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "fixing permissions of ${doc}." + else + install -m 0644 ${SRCDIR}/${i} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}." + fi fi done } @@ -460,7 +472,7 @@ local stripdir="$@" [[ -z ${stripdir} ]] && stripdir="${BINDIR}" - find ${stripdir} ! -type d -name \*.la | xargs file | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null + find ${stripdir} ! -type d -name \*.la | xargs | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null } mpurgetargets() @@ -540,7 +552,6 @@ fi } - # fixes given dependencies to match a MAGE_TARGET # fix_mage_deps -target s/depend # <-- note -target ! fix_mage_deps() @@ -727,7 +738,7 @@ local subpackage # build them only if requested - if [[ ${REGEN_MAGE_TREE} = true ]] + if mqueryfeature regentree then # run it without targets if [[ -n ${MAGE_TARGETS} ]] @@ -790,7 +801,7 @@ unset STATE unset DESCRIPTION unset HOMEPAGE - unset PKGTYPE + # unset PKGTYPE <-- don't do that either; smage needs this var unset INHERITS unset DEPEND unset SDEPEND @@ -816,7 +827,21 @@ export SAVED_DEPEND="${DEPEND}" export SAVED_SDEPEND="${SDEPEND}" export SAVED_PROVIDE="${PROVIDE}" - export SAVED_NOPKGBUILD="${NOPKGBUILD}" + export SAVED_PKGTYPE="${PKGTYPE}" + + # special handling needed for mage features + # pkgbuild + mqueryfeature "pkgbuild" && export SAVED_FEATURE_PKGBUILD="pkgbuild" + mqueryfeature "!pkgbuild" && export SAVED_FEATURE_PKGBUILD="!pkgbuild" + # strip + mqueryfeature "strip" && export SAVED_FEATURE_STRIP="strip" + mqueryfeature "!strip" && export SAVED_FEATURE_STRIP="!strip" + # libtool + mqueryfeature "libtool" && export SAVED_FEATURE_LIBTOOL="libtool" + mqueryfeature "!libtool" && export SAVED_FEATURE_LIBTOOL="!libtool" + # compressdoc + mqueryfeature "compressdoc" && export SAVED_FEATURE_COMPRESSDOC="compressdoc" + mqueryfeature "!compressdoc" && export SAVED_FEATURE_COMPRESSDOC="!compressdoc" # bindir too export SAVED_BINDIR="${BINDIR}" @@ -877,7 +902,17 @@ export DEPEND="${SAVED_DEPEND}" export SDEPEND="${SAVED_SDEPEND}" export PROVIDE="${SAVED_PROVIDE}" - export NOPKGBUILD="${SAVED_NOPKGBUILD}" + export PKGTYPE="${SAVED_PKGTYPE}" + + # special handling needed for mage features + # pkgbuild + FVERBOSE=off msetfeature "${SAVED_FEATURE_PKGBUILD}" + # strip + FVERBOSE=off msetfeature "${SAVED_FEATURE_STRIP}" + # libtool + FVERBOSE=off msetfeature "${SAVED_FEATURE_LIBTOOL}" + # compressdoc + FVERBOSE=off msetfeature "${SAVED_FEATURE_COMPRESSDOC}" # bindir too export BINDIR="${SAVED_BINDIR}" @@ -937,7 +972,11 @@ unset SAVED_SDEPEND unset SAVED_PROVIDE unset SAVED_BINDIR - unset SAVED_NOPKGBUILD + unset SAVED_PKGTYPE + unset SAVED_FEATURE_PKGBUILD + unset SAVED_FEATURE_STRIP + unset SAVED_FEATURE_LIBTOOL + unset SAVED_FEATURE_COMPRESSDOC unset SPLIT_PACKAGE_BASE unset -f SAVED_preinstall unset -f SAVED_postinstall @@ -1037,12 +1076,11 @@ # fix target as it may be empty ! [ -n "${target}" ] && target="-${target}" - # build pkgname pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" # build pkg-md5-sum only if requested - if [[ ${REGEN_MAGE_TREE} = true ]] + if mqueryfeature regentree then echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}" @@ -1097,7 +1135,7 @@ step_by_step() { - if [[ ${STEP_BY_STEP} = true ]] + if mqueryfeature stepbystep then echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}" echo "Press [enter] to continue" @@ -1105,6 +1143,24 @@ fi } +resume_stamp() +{ + local step="$1" + touch ${BUILDDIR}/.smage-${PKGNAME}-${step} +} + +run_resume() +{ + local step="$1" + + if mqueryfeature "resume" && [[ -f ${BUILDDIR}/.smage-${PKGNAME}-${step} ]] + then + echo -e "${COLMAGENTA}${step} already processed; doing nothing${COLDEFAULT}" + return 0 + else + return 1 + fi +} # print out our version showversion @@ -1117,6 +1173,9 @@ exit 1 fi +# load supported mage features +load_mage_features + # updating smage2-scripts if [[ $1 = update ]] then @@ -1301,7 +1360,7 @@ if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ] then SRCPKGTARBALL="${2}" - USE_SRC_PKG_TARBALL=true + msetfeature "srcpkgtarball" # abort if given file is not a source pkg [[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file." @@ -1322,6 +1381,11 @@ [[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}" fi +if [ "$1" == "--resume" -a -n "$2" ] +then + msetfeature "resume" + SMAGENAME="$2" +fi [ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting." [ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] && @@ -1345,7 +1409,7 @@ # auto regen mage tree if requested regen_mage_tree -if [[ ${CREATE_SRC_PKG_TARBALL} = true ]] +if mqueryfeature "srcpkg" then if [[ -d ${SOURCEDIR}/${PNAME} ]] then @@ -1355,7 +1419,7 @@ fi # download sources -[[ ${USE_SRC_PKG_TARBALL} != true ]] && download_sources +mqueryfeature "srcpkgtarball" || download_sources # fixes some issues with these functions export -f src_prepare || die "src_prepare export failed" @@ -1366,179 +1430,241 @@ # fixes some compile issues export CHOST="${CHOST}" || die "CHOST export failed" export CFLAGS="${CFLAGS}" || die "CFLAGS export failed" -export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed" +if [[ -z ${CXXFLAGS} ]] +then + export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed" +else + export CXXFLAGS="${CXXFLAGS}" || die "CXXFLAGS export failed" +fi +export LDFLAGS="${LDFLAGS}" || die "LDFLAGS export failed" export BINDIR="${BINDIR}" || die "BINDIR export failed" export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed" - # setup distcc # setup for distcc goes *before* ccache, so ccache comes before distcc in path -[[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment +mqueryfeature "distcc" && setup_distcc_environment # setup ccache -[[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment +mqueryfeature "ccache" && setup_ccache_environment -# clean up builddir if a previously one exist -if [ -d ${BUILDDIR} ] +if mqueryfeature "resume" then - rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR." -fi -install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR." + echo -e "${COLMAGENTA}Resume requested; continuing previous build${COLDEFAULT}" -# clean up srcdir if a previously unpacked one exist -if [ -d ${SRCDIR} ] -then - rm -rf ${SRCDIR} -fi + # setup build logging + [[ ! -d /var/log/smage ]] && install -d /var/log/smage + if [[ -f /var/log/smage/${PKGNAME}.log.bz2 ]] + then + bunzip2 -f /var/log/smage/${PKGNAME}.log.bz2 + fi + echo -e "### Resume started on $(date) ###\n" >> /var/log/smage/${PKGNAME}.log -# clean up bindir if a previous build exist or create a new one -if [ -d ${BINDIR} ] -then - rm -rf ${BINDIR} -fi -install -d ${BINDIR} || die "couldn't create \$BINDIR." +else + # clean up builddir if a previously one exist + if [ -d ${BUILDDIR} ] + then + rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR." + fi + install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR." -# clean up package temp dir if a previous build exist -if [ -d ${BUILDDIR}/${PKGNAME} ] -then - rm -rf ${BUILDDIR}/${PKGNAME} -fi + # clean up srcdir if a previously unpacked one exist + if [ -d ${SRCDIR} ] + then + rm -rf ${SRCDIR} + fi -# setup build logging -[[ ! -d /var/log/smage ]] && install -d /var/log/smage -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 $_ + # clean up bindir if a previous build exist or create a new one + if [ -d ${BINDIR} ] + then + rm -rf ${BINDIR} + fi + install -d ${BINDIR} || die "couldn't create \$BINDIR." -# only run checks if requested -if [[ ${MAGE_CHECK} != true ]] -then - echo "MAGE_CHECK not requested; src_check() will not be run!" | ${SMAGE_LOG_CMD} - step_by_step src_check -else - src_check | ${SMAGE_LOG_CMD} - die_pipestatus 0 "src_check failed" - step_by_step $_ + # clean up package temp dir if a previous build exist + if [ -d ${BUILDDIR}/${PKGNAME} ] + then + rm -rf ${BUILDDIR}/${PKGNAME} + fi + + # setup build logging + [[ ! -d /var/log/smage ]] && install -d /var/log/smage + echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log fi -# build several subpackages -if [[ -n ${SPLIT_PACKAGES} ]] +if [[ ${PKGTYPE} = virtual ]] then - # save bindir & pname - split_save_variables - export SAVED_BINDIR="${BINDIR}" - for subpackage in ${SPLIT_PACKAGES} - do - if typeset -f src_install_${subpackage} > /dev/null - then - # export subpackage bindir - export BINDIR="${SAVED_BINDIR}_${subpackage}" - # export PNAME, several internal function and include - # rely on this variable - export PNAME="${subpackage}" - - echo - echo -en "${COLBLUE}*** ${COLDEFAULT}" - echo -en " Running ${COLGREEN}split src_install()${COLDEFAULT}" - echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" - echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." - - src_install_${subpackage} | ${SMAGE_LOG_CMD} - die_pipestatus 0 "src_install_${subpackage} failed" - step_by_step $_ - fi - done - # restore bindir & pname - split_restore_variables - # unset all saved smage variables - split_unset_variables + echo "virtual package detected; nothing will be build ..." + # automatically set !pkgbuild here too + msetfeature "!pkgbuild" else - src_install | ${SMAGE_LOG_CMD} - die_pipestatus 0 "src_install failed" - step_by_step $_ + ( run_resume src_prepare || src_prepare ) | ${SMAGE_LOG_CMD} + die_pipestatus 0 "src_prepare failed" + resume_stamp src_prepare + step_by_step src_prepare + + ( run_resume src_compile || src_compile ) | ${SMAGE_LOG_CMD} + die_pipestatus 0 "src_compile failed" + resume_stamp src_compile + step_by_step src_compile + + # only run checks if requested + if mqueryfeature "!check" + then + echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD} + else + ( run_resume src_check || src_check ) | ${SMAGE_LOG_CMD} + die_pipestatus 0 "src_check failed" + resume_stamp src_check + fi + step_by_step src_check + + # build several subpackages + if [[ -n ${SPLIT_PACKAGES} ]] + then + # save bindir & pname + split_save_variables + export SAVED_BINDIR="${BINDIR}" + for subpackage in ${SPLIT_PACKAGES} + do + if typeset -f src_install_${subpackage} > /dev/null + then + # export subpackage bindir + export BINDIR="${SAVED_BINDIR}_${subpackage}" + # export PNAME, several internal function and include + # rely on this variable + export PNAME="${subpackage}" + + echo + echo -en "${COLBLUE}*** ${COLDEFAULT}" + echo -en " Running ${COLGREEN}split src_install()${COLDEFAULT}" + echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" + echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." + + ( run_resume src_install_${subpackage} || src_install_${subpackage} ) | ${SMAGE_LOG_CMD} + die_pipestatus 0 "src_install_${subpackage} failed" + resume_stamp src_install_${subpackage} + step_by_step src_install_${subpackage} + fi + done + # restore bindir & pname + split_restore_variables + # unset all saved smage variables + split_unset_variables + else + ( run_resume src_install || src_install ) | ${SMAGE_LOG_CMD} + die_pipestatus 0 "src_install failed" + resume_stamp src_install + step_by_step src_install + fi fi -# compressing doc, info & man files -if [[ -n ${SPLIT_PACKAGES} ]] +# echo for sake of good-looking +echo + +if mqueryfeature "!compressdoc" then - for subpackage in ${SPLIT_PACKAGES} - do - mcompressdocs ${BINDIR}_${subpackage} - done + echo -e "!compressdoc detected; documentation will not be compressed ..." +elif mqueryfeature "!pkgbuild" +then + echo "!pkgbuild detected; skipping documentation compression..." else - mcompressdocs ${BINDIR} + # compressing doc, info & man files + if [[ -n ${SPLIT_PACKAGES} ]] + then + for subpackage in ${SPLIT_PACKAGES} + do + run_resume mcompressdoc_${subpackage} || mcompressdocs ${BINDIR}_${subpackage} + resume_stamp mcompressdoc_${subpackage} + done + else + run_resume mcompressdoc || mcompressdocs ${BINDIR} + resume_stamp mcompressdoc + fi fi -if [[ ${SMAGE_STRIP_LIBTOOL} = true ]] +if mqueryfeature "!libtool" then + if mqueryfeature "!pkgbuild" + then + echo "!pkgbuild detected; skipping libtool archive stripping ..." + else if [[ -n ${SPLIT_PACKAGES} ]] then for subpackage in ${SPLIT_PACKAGES} do echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives for '${subpackage}' ...${COLDEFAULT}" - mstriplibtoolarchive ${BINDIR}_${subpackage} + run_resume mstriplibtoolarchive_${subpackage} || mstriplibtoolarchive ${BINDIR}_${subpackage} + resume_stamp mstriplibtoolarchive_${subpackage} done else - echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" - mstriplibtoolarchive ${BINDIR} + echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" + run_resume mstriplibtoolarchive || mstriplibtoolarchive ${BINDIR} + resume_stamp mstriplibtoolarchive fi + fi fi -if [[ ${SMAGE_PURGE} = true ]] +if mqueryfeature "purge" then + if mqueryfeature "!pkgbuild" + then + echo "!pkgbuild detected; skipping file purgation..." + else if [[ -n ${SPLIT_PACKAGES} ]] then for subpackage in ${SPLIT_PACKAGES} do echo -e "${COLBLUE}===${COLGREEN} purging all purge targets in '${subpackage}' ...${COLDEFAULT}" - mpurgetargets ${BINDIR}_${subpackage} + run_resume mpurgetargets_${subpackage} || mpurgetargets ${BINDIR}_${subpackage} + resume_stamp mpurgetargets_${subpackage} done else - echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" - mpurgetargets ${BINDIR} + echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" + run_resume mpurgetargets || mpurgetargets ${BINDIR} + resume_stamp mpurgetargets fi + fi fi # stripping all bins and libs -case ${NOSTRIP} in - true|TRUE|yes|y) - echo -e "NOSTRIP=true detected; Package will not be stripped ..." - ;; - *) - if [[ -n ${SPLIT_PACKAGES} ]] - then - for subpackage in ${SPLIT_PACKAGES} - do - echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" - mstripbins ${BINDIR}_${subpackage} - echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" - mstriplibs ${BINDIR}_${subpackage} - echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" - mstripstatic ${BINDIR}_${subpackage} - done - else - echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" - mstripbins ${BINDIR} - echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" - mstriplibs ${BINDIR} - echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" - mstripstatic ${BINDIR} - fi - ;; -esac +if mqueryfeature "!strip" +then + echo -e "!strip detected; Package will not be stripped ..." +elif mqueryfeature "!pkgbuild" +then + echo "!pkgbuild detected; skipping stripping of the package ..." +else + if [[ -n ${SPLIT_PACKAGES} ]] + then + for subpackage in ${SPLIT_PACKAGES} + do + echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" + run_resume mstripbins_${subpackage} || mstripbins ${BINDIR}_${subpackage} + resume_stamp mstripbins_${subpackage} + echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" + run_resume mstriplibs_${subpackage} || mstriplibs ${BINDIR}_${subpackage} + resume_stamp mstriplibs_${subpackage} + echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" + run_resume mstripstatic_${subpackage} || mstripstatic ${BINDIR}_${subpackage} + resume_stamp mstripstatic_${subpackage} + done + else + echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" + run_resume mstripbins || mstripbins ${BINDIR} + resume_stamp mstripbins + echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" + run_resume mstriplibs || mstriplibs ${BINDIR} + resume_stamp mstriplibs + echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" + run_resume mstripstatic || mstripstatic ${BINDIR} + resume_stamp mstripstatic + fi +fi -# the new buildpkg command -case ${NOPKGBUILD} in - true|TRUE|yes|y) - echo -e "NOPGKBUILD=true detected; Package will not be build ..." - ;; - *) +if mqueryfeature "!pkgbuild" +then + echo -e "!pkgbuild detected; Package will not be build ..." +else # build several targets if [[ -n ${MAGE_TARGETS} ]] then @@ -1548,21 +1674,24 @@ if typeset -f ${target}_pkgbuild > /dev/null then # run it - ${target}_pkgbuild + run_resume ${target}_pkgbuild || ${target}_pkgbuild + resume_stamp ${target}_pkgbuild fi # now create the target package - ${MLIBDIR}/pkgbuild_dir.sh \ + run_resume pkg_builddir_${target} || ${MLIBDIR}/pkgbuild_dir.sh \ "${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \ ${BINDIR} || die "target: ${target} package-build failed" + resume_stamp pkg_builddir_${target} # build pkg-md5-sum if requested - generate_package_md5sum \ + run_resume md5sum_${target} || generate_package_md5sum \ --pcat "${PCATEGORIE}" \ --pname "${PNAME}" \ --pver "${PVER}" \ --pbuild "${PBUILD}" \ --parch "${ARCH}" \ --target "${target}" + resume_stamp md5sum_${target} echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" done @@ -1577,29 +1706,30 @@ export PNAME="${subpackage}" split_info_${PNAME} - # jump to next one if NOPKGBUILD is set in split_info - case ${NOPKGBUILD} in - true|TRUE|yes|y) continue ;; - esac + # jump to next one if !pkgbuild is set in split_info + mqueryfeature "!pkgbuild" && continue # check if an special subpackage_pkgbuild exists if typeset -f ${PNAME}_pkgbuild > /dev/null then # run it - ${PNAME}_pkgbuild + run_resume ${PNAME}_pkgbuild || ${PNAME}_pkgbuild + resume_stamp ${PNAME}_pkgbuild fi # now create the target package - ${MLIBDIR}/pkgbuild_dir.sh \ + run_resume pkg_builddir_${PNAME} || ${MLIBDIR}/pkgbuild_dir.sh \ "${PNAME}-${PVER}-${ARCH}-${PBUILD}" \ "${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed" + resume_stamp pkg_builddir_${PNAME} # build pkg-md5-sum if requested - generate_package_md5sum \ + run_resume md5sum_${PNAME} || generate_package_md5sum \ --pcat "${PCATEGORIE}" \ --pname "${PNAME}" \ --pver "${PVER}" \ --pbuild "${PBUILD}" \ --parch "${ARCH}" + resume_stamp md5sum_${PNAME} echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" @@ -1610,33 +1740,34 @@ split_unset_variables else - ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed" + run_resume pkg_builddir || ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed" + resume_stamp pkg_builddir # build pkg-md5-sum if requested - generate_package_md5sum \ + run_resume md5sum || generate_package_md5sum \ --pcat "${PCATEGORIE}" \ --pname "${PNAME}" \ --pver "${PVER}" \ --pbuild "${PBUILD}" \ --parch "${ARCH}" + resume_stamp md5sum echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}" fi # build src-pkg-tarball if requested - [[ ${CREATE_SRC_PKG_TARBALL} = true ]] && source_pkg_build ${SMAGENAME} - ;; -esac + if mqueryfeature "srcpkg" + then + resume_stamp srcpkgbuild || source_pkg_build ${SMAGENAME} + resume_stamp srcpkgbuild + fi +fi -if [[ ${SMAGE_BUILD_LOGGING} != false ]] +if mqueryfeature "buildlog" then bzip2 -9f /var/log/smage/${PKGNAME}.log else [[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log fi -# for sure -unset NOPKGBUILD -unset NOSTRIP - xtitleclean