178 |
# get the right variables for the split |
# get the right variables for the split |
179 |
export PNAME="${subpackage}" |
export PNAME="${subpackage}" |
180 |
split_info_${subpackage} |
split_info_${subpackage} |
181 |
|
# fix PCATEGORIE -> PCAT |
182 |
|
if [[ ! -z ${PCATEGORIE} ]] |
183 |
|
then |
184 |
|
PCAT="${PCATEGORIE}" |
185 |
|
unset PCATEGORIE |
186 |
|
fi |
187 |
# build md5sum for existing packages |
# build md5sum for existing packages |
188 |
generate_package_md5sum \ |
generate_package_md5sum \ |
189 |
--pcat "${PCAT}" \ |
--pcat "${PCAT}" \ |
273 |
[ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}" |
[ -z "${CXXFLAGS}" ] && die "no CXXFLAGS variable found in ${MAGERC}" |
274 |
|
|
275 |
smagesource ${SMAGENAME} || die "source failed" |
smagesource ${SMAGENAME} || die "source failed" |
276 |
PKGNAME="${PNAME}-${PVER}-${ARCH}-${PBUILD}" |
PKGNAME="${PNAME}-${PVER}-${ARCH}$(print_distrotag)-${PBUILD}" |
277 |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
MD5DIR="$(dirname ${SMAGENAME})/md5" |
278 |
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
SMAGE_LOG_CMD="tee -a /var/log/smage/${PKGNAME}.log" |
279 |
|
|
406 |
export SAVED_BINDIR="${BINDIR}" |
export SAVED_BINDIR="${BINDIR}" |
407 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
408 |
do |
do |
409 |
if typeset -f src_install_${subpackage} > /dev/null |
split_info_${subpackage} |
410 |
|
if [[ ${PKGTYPE} = virtual ]] |
411 |
then |
then |
412 |
# export subpackage bindir |
echo "virtual package detected; nothing will be build ..." |
413 |
export BINDIR="${SAVED_BINDIR}_${subpackage}" |
# automatically set !pkgbuild here too |
414 |
# export PNAME, several internal function and include |
msetfeature "!pkgbuild" |
415 |
# rely on this variable |
else |
416 |
export PNAME="${subpackage}" |
if typeset -f src_install_${subpackage} > /dev/null |
417 |
|
then |
418 |
echo |
# export subpackage bindir |
419 |
echo -en "${COLBLUE}*** ${COLDEFAULT}" |
export BINDIR="${SAVED_BINDIR}_${subpackage}" |
420 |
echo -en " Running ${COLGREEN}split src_install()${COLDEFAULT}" |
# export PNAME, several internal function and include |
421 |
echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" |
# rely on this variable |
422 |
echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." |
export PNAME="${subpackage}" |
423 |
|
|
424 |
( run_resume src_install_${subpackage} || src_install_${subpackage} ) | ${SMAGE_LOG_CMD} |
echo |
425 |
die_pipestatus 0 "src_install_${subpackage} failed" |
echo -en "${COLBLUE}*** ${COLDEFAULT}" |
426 |
resume_stamp src_install_${subpackage} |
echo -en " Running ${COLGREEN}split src_install()${COLDEFAULT}" |
427 |
step_by_step src_install_${subpackage} |
echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" |
428 |
|
echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." |
429 |
|
|
430 |
|
( run_resume src_install_${subpackage} || src_install_${subpackage} ) | ${SMAGE_LOG_CMD} |
431 |
|
die_pipestatus 0 "src_install_${subpackage} failed" |
432 |
|
resume_stamp src_install_${subpackage} |
433 |
|
step_by_step src_install_${subpackage} |
434 |
|
fi |
435 |
fi |
fi |
436 |
done |
done |
437 |
# restore bindir & pname |
# restore bindir & pname |
567 |
fi |
fi |
568 |
# now create the target package |
# now create the target package |
569 |
run_resume post-pkg_builddir_${target} || ${MLIBDIR}/pkgbuild_dir.sh \ |
run_resume post-pkg_builddir_${target} || ${MLIBDIR}/pkgbuild_dir.sh \ |
570 |
"${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \ |
"${PNAME}-${target}-${PVER}-${ARCH}$(print_distrotag)-${PBUILD}" \ |
571 |
${BINDIR} || die "target: ${target} package-build failed" |
${BINDIR} || die "target: ${target} package-build failed" |
572 |
resume_stamp post-pkg_builddir_${target} |
resume_stamp post-pkg_builddir_${target} |
573 |
|
|
581 |
--target "${target}" |
--target "${target}" |
582 |
resume_stamp post-md5sum_${target} |
resume_stamp post-md5sum_${target} |
583 |
|
|
584 |
echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}$(print_distrotag)-${PBUILD} successfully builded.\n${COLDEFAULT}" |
585 |
done |
done |
586 |
|
|
587 |
# build several subpackages |
# build several subpackages |
593 |
# get the right variables for the split |
# get the right variables for the split |
594 |
export PNAME="${subpackage}" |
export PNAME="${subpackage}" |
595 |
split_info_${PNAME} |
split_info_${PNAME} |
596 |
|
# fix PCATEGORIE -> PCAT |
597 |
|
if [[ ! -z ${PCATEGORIE} ]] |
598 |
|
then |
599 |
|
PCAT="${PCATEGORIE}" |
600 |
|
unset PCATEGORIE |
601 |
|
fi |
602 |
|
|
603 |
# jump to next one if !pkgbuild is set in split_info |
# jump to next one if !pkgbuild is set in split_info |
604 |
mqueryfeature "!pkgbuild" && continue |
mqueryfeature "!pkgbuild" && continue |
612 |
fi |
fi |
613 |
# now create the target package |
# now create the target package |
614 |
run_resume post-pkg_builddir_${PNAME} || ${MLIBDIR}/pkgbuild_dir.sh \ |
run_resume post-pkg_builddir_${PNAME} || ${MLIBDIR}/pkgbuild_dir.sh \ |
615 |
"${PNAME}-${PVER}-${ARCH}-${PBUILD}" \ |
"${PNAME}-${PVER}-${ARCH}$(print_distrotag)-${PBUILD}" \ |
616 |
"${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed" |
"${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed" |
617 |
resume_stamp post-pkg_builddir_${PNAME} |
resume_stamp post-pkg_builddir_${PNAME} |
618 |
|
|
625 |
--parch "${ARCH}" |
--parch "${ARCH}" |
626 |
resume_stamp post-md5sum_${PNAME} |
resume_stamp post-md5sum_${PNAME} |
627 |
|
|
628 |
echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}$(print_distrotag)-${PBUILD} successfully builded.\n${COLDEFAULT}" |
629 |
|
|
630 |
# restore smage environment |
# restore smage environment |
631 |
split_restore_variables |
split_restore_variables |