10 |
# set default user mage.rc |
# set default user mage.rc |
11 |
: ${MAGERC="/etc/mage.rc"} |
: ${MAGERC="/etc/mage.rc"} |
12 |
|
|
|
## setup ## |
|
|
SMAGENAME="$1" |
|
|
SMAGEVERSION="$( < ${MLIBDIR}/version)" |
|
|
|
|
13 |
# export default C locale |
# export default C locale |
14 |
export LC_ALL=C |
export LC_ALL=C |
15 |
|
|
17 |
source ${MAGERC} |
source ${MAGERC} |
18 |
source ${MLIBDIR}/mage4.functions.sh |
source ${MLIBDIR}/mage4.functions.sh |
19 |
|
|
20 |
|
## setup ## |
21 |
|
SMAGENAME="$1" |
22 |
|
SMAGEVERSION="$(< ${MLIBDIR}/version)" |
23 |
|
|
24 |
# set PKGDIR and BUILDDIR and BINDIR to MROOT |
# set PKGDIR and BUILDDIR and BINDIR to MROOT |
25 |
if [[ -n ${MROOT} ]] |
if [[ -n ${MROOT} ]] |
26 |
then |
then |
177 |
fi |
fi |
178 |
|
|
179 |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${uri}${COLDEFAULT}" |
echo -e "${COLBLUE}==>${COLGREEN} fetching ${uri}${COLDEFAULT}" |
180 |
mdownload --uri "${uri}" --dir "${outputdir}" || die "Could not download '${uri}'" |
# do not die here, mchecksum catches download errors |
181 |
|
mdownload --uri "${uri}" --dir "${outputdir}" |
182 |
|
|
183 |
# unset them to be sure |
# unset them to be sure |
184 |
unset uri |
unset uri |
202 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
203 |
src_prepare() |
src_prepare() |
204 |
{ |
{ |
205 |
echo "no src_prepare defined" |
echo "no src_prepare defined; doing nothing ..." |
206 |
return 0 |
return 0 |
207 |
} |
} |
208 |
|
|
209 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
210 |
src_compile() |
src_compile() |
211 |
{ |
{ |
212 |
echo "no src_compile defined" |
echo "no src_compile defined; doing nothing ..." |
213 |
return 0 |
return 0 |
214 |
} |
} |
215 |
|
|
216 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
217 |
src_check() |
src_check() |
218 |
{ |
{ |
219 |
echo "no src_check defined" |
echo "no src_check defined; doing nothing ..." |
220 |
return 0 |
return 0 |
221 |
} |
} |
222 |
|
|
223 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
224 |
src_install() |
src_install() |
225 |
{ |
{ |
226 |
echo "no src_install defined" |
echo "no src_install defined; doing nothing ..." |
227 |
return 0 |
return 0 |
228 |
} |
} |
229 |
|
|
422 |
do |
do |
423 |
if [ -f ${doc} ] |
if [ -f ${doc} ] |
424 |
then |
then |
425 |
if [[ ${SMAGE_COMPRESSDOC} = true ]] |
if mqueryfeature "compressdoc" |
426 |
then |
then |
427 |
cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "gzipping +installing ${doc}." |
cat ${doc} | gzip -9c > ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "gzipping +installing ${doc}." |
428 |
chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "fixing permissions of ${doc}." |
chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "fixing permissions of ${doc}." |
465 |
local stripdir="$@" |
local stripdir="$@" |
466 |
|
|
467 |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
468 |
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 --no-run-if-empty file | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null |
469 |
} |
} |
470 |
|
|
471 |
mpurgetargets() |
mpurgetargets() |
545 |
fi |
fi |
546 |
} |
} |
547 |
|
|
|
|
|
548 |
# fixes given dependencies to match a MAGE_TARGET |
# fixes given dependencies to match a MAGE_TARGET |
549 |
# fix_mage_deps -target s/depend # <-- note -target ! |
# fix_mage_deps -target s/depend # <-- note -target ! |
550 |
fix_mage_deps() |
fix_mage_deps() |
731 |
local subpackage |
local subpackage |
732 |
|
|
733 |
# build them only if requested |
# build them only if requested |
734 |
if [[ ${REGEN_MAGE_TREE} = true ]] |
if mqueryfeature regentree |
735 |
then |
then |
736 |
# run it without targets |
# run it without targets |
737 |
if [[ -n ${MAGE_TARGETS} ]] |
if [[ -n ${MAGE_TARGETS} ]] |
794 |
unset STATE |
unset STATE |
795 |
unset DESCRIPTION |
unset DESCRIPTION |
796 |
unset HOMEPAGE |
unset HOMEPAGE |
797 |
unset PKGTYPE |
# unset PKGTYPE <-- don't do that either; smage needs this var |
798 |
unset INHERITS |
unset INHERITS |
799 |
unset DEPEND |
unset DEPEND |
800 |
unset SDEPEND |
unset SDEPEND |
820 |
export SAVED_DEPEND="${DEPEND}" |
export SAVED_DEPEND="${DEPEND}" |
821 |
export SAVED_SDEPEND="${SDEPEND}" |
export SAVED_SDEPEND="${SDEPEND}" |
822 |
export SAVED_PROVIDE="${PROVIDE}" |
export SAVED_PROVIDE="${PROVIDE}" |
|
export SAVED_NOPKGBUILD="${NOPKGBUILD}" |
|
823 |
export SAVED_PKGTYPE="${PKGTYPE}" |
export SAVED_PKGTYPE="${PKGTYPE}" |
824 |
|
|
825 |
|
# special handling needed for mage features |
826 |
|
# pkgbuild |
827 |
|
mqueryfeature "pkgbuild" && export SAVED_FEATURE_PKGBUILD="pkgbuild" |
828 |
|
mqueryfeature "!pkgbuild" && export SAVED_FEATURE_PKGBUILD="!pkgbuild" |
829 |
|
# strip |
830 |
|
mqueryfeature "strip" && export SAVED_FEATURE_STRIP="strip" |
831 |
|
mqueryfeature "!strip" && export SAVED_FEATURE_STRIP="!strip" |
832 |
|
# libtool |
833 |
|
mqueryfeature "libtool" && export SAVED_FEATURE_LIBTOOL="libtool" |
834 |
|
mqueryfeature "!libtool" && export SAVED_FEATURE_LIBTOOL="!libtool" |
835 |
|
# compressdoc |
836 |
|
mqueryfeature "compressdoc" && export SAVED_FEATURE_COMPRESSDOC="compressdoc" |
837 |
|
mqueryfeature "!compressdoc" && export SAVED_FEATURE_COMPRESSDOC="!compressdoc" |
838 |
|
|
839 |
# bindir too |
# bindir too |
840 |
export SAVED_BINDIR="${BINDIR}" |
export SAVED_BINDIR="${BINDIR}" |
841 |
|
|
895 |
export DEPEND="${SAVED_DEPEND}" |
export DEPEND="${SAVED_DEPEND}" |
896 |
export SDEPEND="${SAVED_SDEPEND}" |
export SDEPEND="${SAVED_SDEPEND}" |
897 |
export PROVIDE="${SAVED_PROVIDE}" |
export PROVIDE="${SAVED_PROVIDE}" |
|
export NOPKGBUILD="${SAVED_NOPKGBUILD}" |
|
898 |
export PKGTYPE="${SAVED_PKGTYPE}" |
export PKGTYPE="${SAVED_PKGTYPE}" |
899 |
|
|
900 |
|
# special handling needed for mage features |
901 |
|
# pkgbuild |
902 |
|
msetfeature "${SAVED_FEATURE_PKGBUILD}" |
903 |
|
# strip |
904 |
|
msetfeature "${SAVED_FEATURE_STRIP}" |
905 |
|
# libtool |
906 |
|
msetfeature "${SAVED_FEATURE_LIBTOOL}" |
907 |
|
# compressdoc |
908 |
|
msetfeature "${SAVED_FEATURE_COMPRESSDOC}" |
909 |
|
|
910 |
# bindir too |
# bindir too |
911 |
export BINDIR="${SAVED_BINDIR}" |
export BINDIR="${SAVED_BINDIR}" |
912 |
|
|
965 |
unset SAVED_SDEPEND |
unset SAVED_SDEPEND |
966 |
unset SAVED_PROVIDE |
unset SAVED_PROVIDE |
967 |
unset SAVED_BINDIR |
unset SAVED_BINDIR |
|
unset SAVED_NOPKGBUILD |
|
968 |
unset SAVED_PKGTYPE |
unset SAVED_PKGTYPE |
969 |
|
unset SAVED_FEATURE_PKGBUILD |
970 |
|
unset SAVED_FEATURE_STRIP |
971 |
|
unset SAVED_FEATURE_LIBTOOL |
972 |
|
unset SAVED_FEATURE_COMPRESSDOC |
973 |
unset SPLIT_PACKAGE_BASE |
unset SPLIT_PACKAGE_BASE |
974 |
unset -f SAVED_preinstall |
unset -f SAVED_preinstall |
975 |
unset -f SAVED_postinstall |
unset -f SAVED_postinstall |
1069 |
# fix target as it may be empty ! |
# fix target as it may be empty ! |
1070 |
[ -n "${target}" ] && target="-${target}" |
[ -n "${target}" ] && target="-${target}" |
1071 |
|
|
|
|
|
1072 |
# build pkgname |
# build pkgname |
1073 |
pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" |
pkgname="${pname}${target}-${pver}-${parch}-${pbuild}" |
1074 |
|
|
1075 |
# build pkg-md5-sum only if requested |
# build pkg-md5-sum only if requested |
1076 |
if [[ ${REGEN_MAGE_TREE} = true ]] |
if mqueryfeature regentree |
1077 |
then |
then |
1078 |
echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}" |
echo -ne "${COLBLUE}===${COLGREEN} generating md5's for ${pkgname}.${PKGSUFFIX} ... ${COLDEFAULT}" |
1079 |
|
|
1128 |
|
|
1129 |
step_by_step() |
step_by_step() |
1130 |
{ |
{ |
1131 |
if [[ ${STEP_BY_STEP} = true ]] |
if mqueryfeature stepbystep |
1132 |
then |
then |
1133 |
echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}" |
echo -e "${COLRED}Step-by-step enabled! Paused after $1.${COLDEFAULT}" |
1134 |
echo "Press [enter] to continue" |
echo "Press [enter] to continue" |
1148 |
exit 1 |
exit 1 |
1149 |
fi |
fi |
1150 |
|
|
1151 |
|
# load supported mage features |
1152 |
|
load_mage_features |
1153 |
|
|
1154 |
# updating smage2-scripts |
# updating smage2-scripts |
1155 |
if [[ $1 = update ]] |
if [[ $1 = update ]] |
1156 |
then |
then |
1335 |
if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ] |
if [ "$1" == "--src-tarball" -a -n "$2" ] || [ "$1" == "-st" -a -n "$2" ] |
1336 |
then |
then |
1337 |
SRCPKGTARBALL="${2}" |
SRCPKGTARBALL="${2}" |
1338 |
USE_SRC_PKG_TARBALL=true |
msetfeature "srcpkgtarball" |
1339 |
|
|
1340 |
# abort if given file is not a source pkg |
# abort if given file is not a source pkg |
1341 |
[[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file." |
[[ ${SRCPKGTARBALL##*.} != ${SRCPKGSUFFIX} ]] && die "${SRCPKGTARBALL} is not a valid src-pkg file." |
1379 |
# auto regen mage tree if requested |
# auto regen mage tree if requested |
1380 |
regen_mage_tree |
regen_mage_tree |
1381 |
|
|
1382 |
if [[ ${CREATE_SRC_PKG_TARBALL} = true ]] |
if mqueryfeature "srcpkg" |
1383 |
then |
then |
1384 |
if [[ -d ${SOURCEDIR}/${PNAME} ]] |
if [[ -d ${SOURCEDIR}/${PNAME} ]] |
1385 |
then |
then |
1389 |
fi |
fi |
1390 |
|
|
1391 |
# download sources |
# download sources |
1392 |
[[ ${USE_SRC_PKG_TARBALL} != true ]] && download_sources |
mqueryfeature "srcpkgtarball" || download_sources |
1393 |
|
|
1394 |
# fixes some issues with these functions |
# fixes some issues with these functions |
1395 |
export -f src_prepare || die "src_prepare export failed" |
export -f src_prepare || die "src_prepare export failed" |
1404 |
export BINDIR="${BINDIR}" || die "BINDIR export failed" |
export BINDIR="${BINDIR}" || die "BINDIR export failed" |
1405 |
export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed" |
export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed" |
1406 |
|
|
|
|
|
1407 |
# setup distcc |
# setup distcc |
1408 |
# setup for distcc goes *before* ccache, so ccache comes before distcc in path |
# setup for distcc goes *before* ccache, so ccache comes before distcc in path |
1409 |
[[ ${SMAGE_USE_DISTCC} = true ]] && setup_distcc_environment |
mqueryfeature "distcc" && setup_distcc_environment |
1410 |
|
|
1411 |
# setup ccache |
# setup ccache |
1412 |
[[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment |
mqueryfeature "ccache" && setup_ccache_environment |
1413 |
|
|
1414 |
# clean up builddir if a previously one exist |
# clean up builddir if a previously one exist |
1415 |
if [ -d ${BUILDDIR} ] |
if [ -d ${BUILDDIR} ] |
1441 |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
1442 |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
1443 |
|
|
1444 |
src_prepare | ${SMAGE_LOG_CMD} |
if [[ ${PKGTYPE} = virtual ]] |
|
die_pipestatus 0 "src_prepare failed" |
|
|
step_by_step $_ |
|
|
|
|
|
src_compile | ${SMAGE_LOG_CMD} |
|
|
die_pipestatus 0 "src_compile failed" |
|
|
step_by_step $_ |
|
|
|
|
|
# only run checks if requested |
|
|
if [[ ${MAGE_CHECK} != true ]] |
|
1445 |
then |
then |
1446 |
echo "MAGE_CHECK not requested; src_check() will not be run!" | ${SMAGE_LOG_CMD} |
echo "virtual package detected; nothing will be build ..." |
1447 |
step_by_step src_check |
# automatically set !pkgbuild here too |
1448 |
|
msetfeature "!pkgbuild" |
1449 |
else |
else |
1450 |
src_check | ${SMAGE_LOG_CMD} |
src_prepare | ${SMAGE_LOG_CMD} |
1451 |
die_pipestatus 0 "src_check failed" |
die_pipestatus 0 "src_prepare failed" |
1452 |
step_by_step $_ |
step_by_step $_ |
|
fi |
|
|
|
|
|
# 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}" |
|
1453 |
|
|
1454 |
echo |
src_compile | ${SMAGE_LOG_CMD} |
1455 |
echo -en "${COLBLUE}*** ${COLDEFAULT}" |
die_pipestatus 0 "src_compile failed" |
|
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 |
|
|
else |
|
|
src_install | ${SMAGE_LOG_CMD} |
|
|
die_pipestatus 0 "src_install failed" |
|
1456 |
step_by_step $_ |
step_by_step $_ |
1457 |
|
|
1458 |
|
# only run checks if requested |
1459 |
|
if mqueryfeature "!check" |
1460 |
|
then |
1461 |
|
echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD} |
1462 |
|
step_by_step src_check |
1463 |
|
else |
1464 |
|
src_check | ${SMAGE_LOG_CMD} |
1465 |
|
die_pipestatus 0 "src_check failed" |
1466 |
|
step_by_step $_ |
1467 |
|
fi |
1468 |
|
|
1469 |
|
# build several subpackages |
1470 |
|
if [[ -n ${SPLIT_PACKAGES} ]] |
1471 |
|
then |
1472 |
|
# save bindir & pname |
1473 |
|
split_save_variables |
1474 |
|
export SAVED_BINDIR="${BINDIR}" |
1475 |
|
for subpackage in ${SPLIT_PACKAGES} |
1476 |
|
do |
1477 |
|
if typeset -f src_install_${subpackage} > /dev/null |
1478 |
|
then |
1479 |
|
# export subpackage bindir |
1480 |
|
export BINDIR="${SAVED_BINDIR}_${subpackage}" |
1481 |
|
# export PNAME, several internal function and include |
1482 |
|
# rely on this variable |
1483 |
|
export PNAME="${subpackage}" |
1484 |
|
|
1485 |
|
echo |
1486 |
|
echo -en "${COLBLUE}*** ${COLDEFAULT}" |
1487 |
|
echo -en " Running ${COLGREEN}split src_install()${COLDEFAULT}" |
1488 |
|
echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" |
1489 |
|
echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." |
1490 |
|
|
1491 |
|
src_install_${subpackage} | ${SMAGE_LOG_CMD} |
1492 |
|
die_pipestatus 0 "src_install_${subpackage} failed" |
1493 |
|
step_by_step $_ |
1494 |
|
fi |
1495 |
|
done |
1496 |
|
# restore bindir & pname |
1497 |
|
split_restore_variables |
1498 |
|
# unset all saved smage variables |
1499 |
|
split_unset_variables |
1500 |
|
else |
1501 |
|
src_install | ${SMAGE_LOG_CMD} |
1502 |
|
die_pipestatus 0 "src_install failed" |
1503 |
|
step_by_step $_ |
1504 |
|
fi |
1505 |
fi |
fi |
1506 |
|
|
1507 |
# compressing doc, info & man files |
# echo for sake of good-looking |
1508 |
if [[ -n ${SPLIT_PACKAGES} ]] |
echo |
1509 |
|
|
1510 |
|
if mqueryfeature "!compressdoc" |
1511 |
then |
then |
1512 |
for subpackage in ${SPLIT_PACKAGES} |
echo -e "!compressdoc detected; documentation will not be compressed ..." |
1513 |
do |
elif mqueryfeature "!pkgbuild" |
1514 |
mcompressdocs ${BINDIR}_${subpackage} |
then |
1515 |
done |
echo "!pkgbuild detected; skipping documentation compression..." |
1516 |
else |
else |
1517 |
mcompressdocs ${BINDIR} |
# compressing doc, info & man files |
1518 |
|
if [[ -n ${SPLIT_PACKAGES} ]] |
1519 |
|
then |
1520 |
|
for subpackage in ${SPLIT_PACKAGES} |
1521 |
|
do |
1522 |
|
mcompressdocs ${BINDIR}_${subpackage} |
1523 |
|
done |
1524 |
|
else |
1525 |
|
mcompressdocs ${BINDIR} |
1526 |
|
fi |
1527 |
fi |
fi |
1528 |
|
|
1529 |
if [[ ${SMAGE_STRIP_LIBTOOL} = true ]] |
if mqueryfeature "!libtool" |
1530 |
then |
then |
1531 |
|
if mqueryfeature "!pkgbuild" |
1532 |
|
then |
1533 |
|
echo "!pkgbuild detected; skipping libtool archive stripping ..." |
1534 |
|
else |
1535 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1536 |
then |
then |
1537 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1543 |
echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" |
1544 |
mstriplibtoolarchive ${BINDIR} |
mstriplibtoolarchive ${BINDIR} |
1545 |
fi |
fi |
1546 |
|
fi |
1547 |
fi |
fi |
1548 |
|
|
1549 |
if [[ ${SMAGE_PURGE} = true ]] |
if mqueryfeature "purge" |
1550 |
then |
then |
1551 |
|
if mqueryfeature "!pkgbuild" |
1552 |
|
then |
1553 |
|
echo "!pkgbuild detected; skipping file purgation..." |
1554 |
|
else |
1555 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1556 |
then |
then |
1557 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1563 |
echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" |
1564 |
mpurgetargets ${BINDIR} |
mpurgetargets ${BINDIR} |
1565 |
fi |
fi |
1566 |
|
fi |
1567 |
fi |
fi |
1568 |
|
|
1569 |
# stripping all bins and libs |
# stripping all bins and libs |
1570 |
case ${NOSTRIP} in |
if mqueryfeature "!strip" |
1571 |
true|TRUE|yes|y) |
then |
1572 |
echo -e "NOSTRIP=true detected; Package will not be stripped ..." |
echo -e "!strip detected; Package will not be stripped ..." |
1573 |
;; |
elif mqueryfeature "!pkgbuild" |
1574 |
*) |
then |
1575 |
if [[ -n ${SPLIT_PACKAGES} ]] |
echo "!pkgbuild detected; skipping stripping of the package ..." |
1576 |
then |
else |
1577 |
for subpackage in ${SPLIT_PACKAGES} |
if [[ -n ${SPLIT_PACKAGES} ]] |
1578 |
do |
then |
1579 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
for subpackage in ${SPLIT_PACKAGES} |
1580 |
mstripbins ${BINDIR}_${subpackage} |
do |
1581 |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
1582 |
mstriplibs ${BINDIR}_${subpackage} |
mstripbins ${BINDIR}_${subpackage} |
1583 |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" |
1584 |
mstripstatic ${BINDIR}_${subpackage} |
mstriplibs ${BINDIR}_${subpackage} |
1585 |
done |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" |
1586 |
else |
mstripstatic ${BINDIR}_${subpackage} |
1587 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
done |
1588 |
mstripbins ${BINDIR} |
else |
1589 |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
1590 |
mstriplibs ${BINDIR} |
mstripbins ${BINDIR} |
1591 |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" |
1592 |
mstripstatic ${BINDIR} |
mstriplibs ${BINDIR} |
1593 |
fi |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" |
1594 |
;; |
mstripstatic ${BINDIR} |
1595 |
esac |
fi |
1596 |
|
fi |
1597 |
|
|
1598 |
# the new buildpkg command |
if mqueryfeature "!pkgbuild" |
1599 |
case ${NOPKGBUILD} in |
then |
1600 |
true|TRUE|yes|y) |
echo -e "!pkgbuild detected; Package will not be build ..." |
1601 |
echo -e "NOPGKBUILD=true detected; Package will not be build ..." |
else |
|
;; |
|
|
*) |
|
1602 |
# build several targets |
# build several targets |
1603 |
if [[ -n ${MAGE_TARGETS} ]] |
if [[ -n ${MAGE_TARGETS} ]] |
1604 |
then |
then |
1637 |
export PNAME="${subpackage}" |
export PNAME="${subpackage}" |
1638 |
split_info_${PNAME} |
split_info_${PNAME} |
1639 |
|
|
1640 |
# jump to next one if NOPKGBUILD is set in split_info |
# jump to next one if !pkgbuild is set in split_info |
1641 |
case ${NOPKGBUILD} in |
mqueryfeature "!pkgbuild" && continue |
|
true|TRUE|yes|y) continue ;; |
|
|
esac |
|
1642 |
|
|
1643 |
# check if an special subpackage_pkgbuild exists |
# check if an special subpackage_pkgbuild exists |
1644 |
if typeset -f ${PNAME}_pkgbuild > /dev/null |
if typeset -f ${PNAME}_pkgbuild > /dev/null |
1682 |
fi |
fi |
1683 |
|
|
1684 |
# build src-pkg-tarball if requested |
# build src-pkg-tarball if requested |
1685 |
[[ ${CREATE_SRC_PKG_TARBALL} = true ]] && source_pkg_build ${SMAGENAME} |
mqueryfeature "srcpkg" && source_pkg_build ${SMAGENAME} |
1686 |
;; |
fi |
|
esac |
|
1687 |
|
|
1688 |
if [[ ${SMAGE_BUILD_LOGGING} != false ]] |
if mqueryfeature "buildlog" |
1689 |
then |
then |
1690 |
bzip2 -9f /var/log/smage/${PKGNAME}.log |
bzip2 -9f /var/log/smage/${PKGNAME}.log |
1691 |
else |
else |
1692 |
[[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log |
[[ -f /var/log/smage/${PKGNAME}.log ]] && rm /var/log/smage/${PKGNAME}.log |
1693 |
fi |
fi |
1694 |
|
|
|
# for sure |
|
|
unset NOPKGBUILD |
|
|
unset NOSTRIP |
|
|
|
|
1695 |
xtitleclean |
xtitleclean |