--- trunk/mage/usr/lib/mage/smage2.sh 2007/11/28 10:47:50 635 +++ trunk/mage/usr/lib/mage/smage2.sh 2009/06/30 20:19:28 885 @@ -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" @@ -171,6 +173,9 @@ 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 @@ -186,7 +191,7 @@ --tries 3 \ --continue \ --progress bar \ - --directory-prefix="${my_SOURCEDIR}" \ + --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ "${my_SRC_URI_MIRROR}" if [[ $? = 0 ]] then @@ -210,7 +215,7 @@ --tries 3 \ --continue \ --progress bar \ - --directory-prefix="${my_SOURCEDIR}" \ + --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ "${my_SRC_URI_MIRROR}" if [[ $? = 0 ]] then @@ -234,7 +239,7 @@ --tries 3 \ --continue \ --progress bar \ - --directory-prefix="${my_SOURCEDIR}" \ + --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ "${my_SRC_URI_MIRROR}" if [[ $? = 0 ]] then @@ -258,7 +263,7 @@ --tries 3 \ --continue \ --progress bar \ - --directory-prefix="${my_SOURCEDIR}" \ + --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ "${my_SRC_URI_MIRROR}" if [[ $? = 0 ]] then @@ -282,7 +287,7 @@ --tries 3 \ --continue \ --progress bar \ - --directory-prefix="${my_SOURCEDIR}" \ + --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI_MIRROR})" \ "${my_SRC_URI_MIRROR}" if [[ $? = 0 ]] then @@ -301,7 +306,7 @@ --tries 3 \ --continue \ --progress bar \ - --directory-prefix="${my_SOURCEDIR}" \ + --output-document="${my_SOURCEDIR}/$(basename ${my_SRC_URI})" \ "${my_SRC_URI}" fi fi @@ -362,6 +367,7 @@ ./configure \ --prefix=/usr \ --host=${CHOST} \ + --build=${CHOST} \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --datadir=/usr/share \ @@ -650,7 +656,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 @@ -936,6 +942,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 +1218,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 +1308,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