--- trunk/mage/usr/lib/mage/smage2.sh 2007/11/05 19:05:22 602 +++ trunk/mage/usr/lib/mage/smage2.sh 2009/05/21 19:06:26 875 @@ -4,7 +4,7 @@ # needs pkgbuild_dir (mage) # SMAGE2 -# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.61 2007-11-05 19:05:22 niro Exp $ +# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.62 2007-11-28 10:47:50 niro Exp $ #01.10.2004 # added ccache support @@ -20,6 +20,8 @@ SMAGESUFFIX="smage2" MLIBDIR=/usr/lib/mage SMAGEVERSION="$( < ${MLIBDIR}/version)" +SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" + ## only for tests -> normally in /etc/rc.d/init.d/functions COLRED="\033[1;6m\033[31m" @@ -362,6 +364,7 @@ ./configure \ --prefix=/usr \ --host=${CHOST} \ + --build=${CHOST} \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --datadir=/usr/share \ @@ -452,12 +455,12 @@ unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed." ;; rpm) - pushd ${BUILDDIR} > /dev/null + pushd ${DEST} > /dev/null rpm2targz ${SOURCEDIR}/${PNAME}/${SRCFILE} || die "rpm2targz: .rpm unpack failed." tar --no-same-owner -xvzf ${SRCFILE/.rpm/.tar.gz} || die "tar: .rpm unpack failed." - if [[ -f ${BUILDDIR}/${SRCFILE/.rpm/.tar.gz} ]] + if [[ -f ${DEST}/${SRCFILE/.rpm/.tar.gz} ]] then - rm ${BUILDDIR}/${SRCFILE/.rpm/.tar.gz} + rm ${DEST}/${SRCFILE/.rpm/.tar.gz} fi ;; *) @@ -650,7 +653,7 @@ # special tags: # PKGTYPE type of pkg # INHERITS which functions get included -# SPECIAL_FUNCTIONS special functions wich should also be added +# SPECIAL_FUNCTIONS special functions which should also be added # warning: they get killed before the build starts ! # # MAGE_TREE_DEST target destination of the generated tree @@ -686,7 +689,7 @@ > ${dest} # header - echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.61 2007-11-05 19:05:22 niro Exp $' >> ${dest} + echo '# $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/smage2.sh,v 1.62 2007-11-28 10:47:50 niro Exp $' >> ${dest} echo >> ${dest} # pgkname and state @@ -936,6 +939,16 @@ echo -e "${COLGREEN}Source package ${COLBLUE}${PNAME}-${PVER}-${PBUILD}.${SRCPKGSUFFIX} ${COLGREEN}successfully builded.${COLDEFAULT}" } +step_by_step() +{ + if [[ ${STEP_BY_STEP} = true ]] + then + echo "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}" + echo "Press [enter] to continue" + read + fi +} + # print out our version showversion @@ -1202,9 +1215,16 @@ mage rmstamp fi -src_prepare || die "src_prepare failed" -src_compile || die "src_compile failed" -src_install || die "src_install failed" +# setup build loggins +[[ ! -d /var/log/smage ]] && install -d /var/log/smage +echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log + +( src_prepare || die "src_prepare failed" ) | ${SMAGE_LOG_CMD} +step_by_step $_ +( src_compile || die "src_compile failed" ) | ${SMAGE_LOG_CMD} +step_by_step $_ +( src_install || die "src_install failed" ) | ${SMAGE_LOG_CMD} +step_by_step $_ # compressing doc, info & man files @@ -1285,6 +1305,13 @@ ;; esac +if [[ ${SMAGE_BUILD_LOGGING} != false ]] +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