300 |
smagesource ${SMAGENAME} || die "source failed" |
smagesource ${SMAGENAME} || die "source failed" |
301 |
PKGNAME="${PNAME}-${PVER}-${ARCH}$(print_distrotag)-${PBUILD}" |
PKGNAME="${PNAME}-${PVER}-${ARCH}$(print_distrotag)-${PBUILD}" |
302 |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
303 |
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
SMAGE_LOG_CMD="tee -a ${SMAGELOGDIR}/${PKGNAME}.log" |
304 |
|
|
305 |
xtitle "Compiling ${PKGNAME}" |
xtitle "Compiling ${PKGNAME}" |
306 |
echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}" |
echo -e "${COLGREEN}Compiling ${PKGNAME}${COLDEFAULT}" |
318 |
mqueryfeature "srcpkgtarball" || download_sources |
mqueryfeature "srcpkgtarball" || download_sources |
319 |
|
|
320 |
# fixes some issues with these functions |
# fixes some issues with these functions |
321 |
export -f src_setup || die "src_setup export failed" |
export -f pkg_setup || die "pkg_setup export failed" |
322 |
export -f src_prepare || die "src_prepare export failed" |
export -f src_prepare || die "src_prepare export failed" |
323 |
export -f src_compile || die "src_compile export failed" |
export -f src_compile || die "src_compile export failed" |
324 |
export -f src_check || die "src_check export failed" |
export -f src_check || die "src_check export failed" |
353 |
echo -e "${COLMAGENTA}Resume requested; continuing previous build${COLDEFAULT}" |
echo -e "${COLMAGENTA}Resume requested; continuing previous build${COLDEFAULT}" |
354 |
|
|
355 |
# setup build logging |
# setup build logging |
356 |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
[[ ! -d ${SMAGELOGDIR} ]] && install -d ${SMAGELOGDIR} |
357 |
if [[ -f /var/log/smage/${PKGNAME}.log.bz2 ]] |
if [[ -f ${SMAGELOGDIR}/${PKGNAME}.log.bz2 ]] |
358 |
then |
then |
359 |
bunzip2 -f /var/log/smage/${PKGNAME}.log.bz2 |
bunzip2 -f ${SMAGELOGDIR}/${PKGNAME}.log.bz2 |
360 |
fi |
fi |
361 |
echo -e "### Resume started on $(date) ###\n" >> /var/log/smage/${PKGNAME}.log |
echo -e "### Resume started on $(date) ###\n" >> ${SMAGELOGDIR}/${PKGNAME}.log |
362 |
|
|
363 |
else |
else |
364 |
# clean up builddir if a previously one exist |
# clean up builddir if a previously one exist |
394 |
fi |
fi |
395 |
|
|
396 |
# setup build logging |
# setup build logging |
397 |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
[[ ! -d ${SMAGELOGDIR} ]] && install -d ${SMAGELOGDIR} |
398 |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
echo -e "### Build started on $(date) ###\n" > ${SMAGELOGDIR}/${PKGNAME}.log |
399 |
fi |
fi |
400 |
|
|
401 |
if [[ ${PKGTYPE} = virtual ]] |
if [[ ${PKGTYPE} = virtual ]] |
404 |
# automatically set !pkgbuild here too |
# automatically set !pkgbuild here too |
405 |
msetfeature "!pkgbuild" |
msetfeature "!pkgbuild" |
406 |
else |
else |
407 |
( run_resume src_setup || src_setup ) | ${SMAGE_LOG_CMD} |
( run_resume pkg_setup || pkg_setup ) |& ${SMAGE_LOG_CMD} |
408 |
die_pipestatus 0 "src_setup failed" |
die_pipestatus 0 "pkg_setup failed" |
409 |
resume_stamp src_setup |
resume_stamp pkg_setup |
410 |
step_by_step src_setup |
step_by_step pkg_setup |
411 |
|
|
412 |
( run_resume src_prepare || src_prepare ) | ${SMAGE_LOG_CMD} |
( run_resume src_prepare || src_prepare ) |& ${SMAGE_LOG_CMD} |
413 |
die_pipestatus 0 "src_prepare failed" |
die_pipestatus 0 "src_prepare failed" |
414 |
resume_stamp src_prepare |
resume_stamp src_prepare |
415 |
step_by_step src_prepare |
step_by_step src_prepare |
416 |
|
|
417 |
( run_resume src_compile || src_compile ) | ${SMAGE_LOG_CMD} |
( run_resume src_compile || src_compile ) |& ${SMAGE_LOG_CMD} |
418 |
die_pipestatus 0 "src_compile failed" |
die_pipestatus 0 "src_compile failed" |
419 |
resume_stamp src_compile |
resume_stamp src_compile |
420 |
step_by_step src_compile |
step_by_step src_compile |
422 |
# only run checks if requested |
# only run checks if requested |
423 |
if mqueryfeature "!check" |
if mqueryfeature "!check" |
424 |
then |
then |
425 |
echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD} |
echo "!check detected; src_check() will not be run!" |& ${SMAGE_LOG_CMD} |
426 |
else |
else |
427 |
( run_resume src_check || src_check ) | ${SMAGE_LOG_CMD} |
( run_resume src_check || src_check ) |& ${SMAGE_LOG_CMD} |
428 |
die_pipestatus 0 "src_check failed" |
die_pipestatus 0 "src_check failed" |
429 |
resume_stamp src_check |
resume_stamp src_check |
430 |
fi |
fi |
465 |
echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" |
echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" |
466 |
echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." |
echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." |
467 |
|
|
468 |
( run_resume src_install_${subpackage} || src_install_${subpackage} ) | ${SMAGE_LOG_CMD} |
( run_resume src_install_${subpackage} || src_install_${subpackage} ) |& ${SMAGE_LOG_CMD} |
469 |
die_pipestatus 0 "src_install_${subpackage} failed" |
die_pipestatus 0 "src_install_${subpackage} failed" |
470 |
resume_stamp src_install_${subpackage} |
resume_stamp src_install_${subpackage} |
471 |
step_by_step src_install_${subpackage} |
step_by_step src_install_${subpackage} |
477 |
# unset all saved smage variables |
# unset all saved smage variables |
478 |
split_unset_variables |
split_unset_variables |
479 |
else |
else |
480 |
( run_resume src_install || src_install ) | ${SMAGE_LOG_CMD} |
( run_resume src_install || src_install ) |& ${SMAGE_LOG_CMD} |
481 |
die_pipestatus 0 "src_install failed" |
die_pipestatus 0 "src_install failed" |
482 |
resume_stamp src_install |
resume_stamp src_install |
483 |
step_by_step src_install |
step_by_step src_install |
813 |
|
|
814 |
if mqueryfeature "buildlog" |
if mqueryfeature "buildlog" |
815 |
then |
then |
816 |
bzip2 -9f /var/log/smage/${PKGNAME}.log |
bzip2 -9f ${SMAGELOGDIR}/${PKGNAME}.log |
817 |
else |
else |
818 |
[[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log |
[[ -f ${SMAGELOGDIR}/${PKGNAME}.log ]] && rm ${SMAGELOGDIR}/${PKGNAME}.log |
819 |
fi |
fi |
820 |
|
|
821 |
xtitleclean |
xtitleclean |