201 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
202 |
src_prepare() |
src_prepare() |
203 |
{ |
{ |
204 |
echo "no src_prepare defined" |
echo "no src_prepare defined; doing nothing ..." |
205 |
return 0 |
return 0 |
206 |
} |
} |
207 |
|
|
208 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
209 |
src_compile() |
src_compile() |
210 |
{ |
{ |
211 |
echo "no src_compile defined" |
echo "no src_compile defined; doing nothing ..." |
212 |
return 0 |
return 0 |
213 |
} |
} |
214 |
|
|
215 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
216 |
src_check() |
src_check() |
217 |
{ |
{ |
218 |
echo "no src_check defined" |
echo "no src_check defined; doing nothing ..." |
219 |
return 0 |
return 0 |
220 |
} |
} |
221 |
|
|
222 |
# dummy function, used if that does not exist in smage file |
# dummy function, used if that does not exist in smage file |
223 |
src_install() |
src_install() |
224 |
{ |
{ |
225 |
echo "no src_install defined" |
echo "no src_install defined; doing nothing ..." |
226 |
return 0 |
return 0 |
227 |
} |
} |
228 |
|
|
793 |
unset STATE |
unset STATE |
794 |
unset DESCRIPTION |
unset DESCRIPTION |
795 |
unset HOMEPAGE |
unset HOMEPAGE |
796 |
unset PKGTYPE |
# unset PKGTYPE <-- don't do that either; smage needs this var |
797 |
unset INHERITS |
unset INHERITS |
798 |
unset DEPEND |
unset DEPEND |
799 |
unset SDEPEND |
unset SDEPEND |
1440 |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
1441 |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
1442 |
|
|
1443 |
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 mqueryfeature "!check" |
|
1444 |
then |
then |
1445 |
echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD} |
echo "virtual package detected; nothing will be build ..." |
1446 |
step_by_step src_check |
# automatically set !pkgbuild here too |
1447 |
|
msetfeature "!pkgbuild" |
1448 |
else |
else |
1449 |
src_check | ${SMAGE_LOG_CMD} |
src_prepare | ${SMAGE_LOG_CMD} |
1450 |
die_pipestatus 0 "src_check failed" |
die_pipestatus 0 "src_prepare failed" |
1451 |
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}" |
|
1452 |
|
|
1453 |
echo |
src_compile | ${SMAGE_LOG_CMD} |
1454 |
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" |
|
1455 |
step_by_step $_ |
step_by_step $_ |
1456 |
|
|
1457 |
|
# only run checks if requested |
1458 |
|
if mqueryfeature "!check" |
1459 |
|
then |
1460 |
|
echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD} |
1461 |
|
step_by_step src_check |
1462 |
|
else |
1463 |
|
src_check | ${SMAGE_LOG_CMD} |
1464 |
|
die_pipestatus 0 "src_check failed" |
1465 |
|
step_by_step $_ |
1466 |
|
fi |
1467 |
|
|
1468 |
|
# build several subpackages |
1469 |
|
if [[ -n ${SPLIT_PACKAGES} ]] |
1470 |
|
then |
1471 |
|
# save bindir & pname |
1472 |
|
split_save_variables |
1473 |
|
export SAVED_BINDIR="${BINDIR}" |
1474 |
|
for subpackage in ${SPLIT_PACKAGES} |
1475 |
|
do |
1476 |
|
if typeset -f src_install_${subpackage} > /dev/null |
1477 |
|
then |
1478 |
|
# export subpackage bindir |
1479 |
|
export BINDIR="${SAVED_BINDIR}_${subpackage}" |
1480 |
|
# export PNAME, several internal function and include |
1481 |
|
# rely on this variable |
1482 |
|
export PNAME="${subpackage}" |
1483 |
|
|
1484 |
|
echo |
1485 |
|
echo -en "${COLBLUE}*** ${COLDEFAULT}" |
1486 |
|
echo -en " Running ${COLGREEN}split src_install()${COLDEFAULT}" |
1487 |
|
echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" |
1488 |
|
echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." |
1489 |
|
|
1490 |
|
src_install_${subpackage} | ${SMAGE_LOG_CMD} |
1491 |
|
die_pipestatus 0 "src_install_${subpackage} failed" |
1492 |
|
step_by_step $_ |
1493 |
|
fi |
1494 |
|
done |
1495 |
|
# restore bindir & pname |
1496 |
|
split_restore_variables |
1497 |
|
# unset all saved smage variables |
1498 |
|
split_unset_variables |
1499 |
|
else |
1500 |
|
src_install | ${SMAGE_LOG_CMD} |
1501 |
|
die_pipestatus 0 "src_install failed" |
1502 |
|
step_by_step $_ |
1503 |
|
fi |
1504 |
fi |
fi |
1505 |
|
|
1506 |
|
# echo for sake of good-looking |
1507 |
|
echo |
1508 |
|
|
1509 |
if mqueryfeature "!compressdoc" |
if mqueryfeature "!compressdoc" |
1510 |
then |
then |
1511 |
echo -e "!compressdoc detected; documentation will not be compressed ..." |
echo -e "!compressdoc detected; documentation will not be compressed ..." |
1512 |
|
elif mqueryfeature "!pkgbuild" |
1513 |
|
then |
1514 |
|
echo "!pkgbuild detected; skipping documentation compression..." |
1515 |
else |
else |
1516 |
# compressing doc, info & man files |
# compressing doc, info & man files |
1517 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1527 |
|
|
1528 |
if mqueryfeature "!libtool" |
if mqueryfeature "!libtool" |
1529 |
then |
then |
1530 |
|
if mqueryfeature "!pkgbuild" |
1531 |
|
then |
1532 |
|
echo "!pkgbuild detected; skipping libtool archive stripping ..." |
1533 |
|
else |
1534 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1535 |
then |
then |
1536 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1542 |
echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" |
1543 |
mstriplibtoolarchive ${BINDIR} |
mstriplibtoolarchive ${BINDIR} |
1544 |
fi |
fi |
1545 |
|
fi |
1546 |
fi |
fi |
1547 |
|
|
1548 |
if mqueryfeature "purge" |
if mqueryfeature "purge" |
1549 |
then |
then |
1550 |
|
if mqueryfeature "!pkgbuild" |
1551 |
|
then |
1552 |
|
echo "!pkgbuild detected; skipping file purgation..." |
1553 |
|
else |
1554 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1555 |
then |
then |
1556 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1562 |
echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" |
1563 |
mpurgetargets ${BINDIR} |
mpurgetargets ${BINDIR} |
1564 |
fi |
fi |
1565 |
|
fi |
1566 |
fi |
fi |
1567 |
|
|
1568 |
# stripping all bins and libs |
# stripping all bins and libs |
1569 |
if mqueryfeature "!strip" |
if mqueryfeature "!strip" |
1570 |
then |
then |
1571 |
echo -e "!strip detected; Package will not be stripped ..." |
echo -e "!strip detected; Package will not be stripped ..." |
1572 |
|
elif mqueryfeature "!pkgbuild" |
1573 |
|
then |
1574 |
|
echo "!pkgbuild detected; skipping stripping of the package ..." |
1575 |
else |
else |
1576 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1577 |
then |
then |
1578 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1579 |
do |
do |
1580 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
1581 |
mstripbins ${BINDIR}_${subpackage} |
mstripbins ${BINDIR}_${subpackage} |
1582 |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" |
1583 |
mstriplibs ${BINDIR}_${subpackage} |
mstriplibs ${BINDIR}_${subpackage} |
1584 |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" |
1585 |
mstripstatic ${BINDIR}_${subpackage} |
mstripstatic ${BINDIR}_${subpackage} |
1586 |
done |
done |
1587 |
else |
else |
1588 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
1589 |
mstripbins ${BINDIR} |
mstripbins ${BINDIR} |
1590 |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" |
1591 |
mstriplibs ${BINDIR} |
mstriplibs ${BINDIR} |
1592 |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" |
1593 |
mstripstatic ${BINDIR} |
mstripstatic ${BINDIR} |
1594 |
fi |
fi |
1595 |
fi |
fi |
1596 |
|
|
1597 |
if mqueryfeature "!buildpkg" |
if mqueryfeature "!pkgbuild" |
1598 |
then |
then |
1599 |
echo -e "!buildpkg detected; Package will not be build ..." |
echo -e "!pkgbuild detected; Package will not be build ..." |
1600 |
else |
else |
1601 |
# build several targets |
# build several targets |
1602 |
if [[ -n ${MAGE_TARGETS} ]] |
if [[ -n ${MAGE_TARGETS} ]] |
1636 |
export PNAME="${subpackage}" |
export PNAME="${subpackage}" |
1637 |
split_info_${PNAME} |
split_info_${PNAME} |
1638 |
|
|
1639 |
# jump to next one if !buildpkg is set in split_info |
# jump to next one if !pkgbuild is set in split_info |
1640 |
mqueryfeature "!buildpkg" && continue |
mqueryfeature "!pkgbuild" && continue |
1641 |
|
|
1642 |
# check if an special subpackage_pkgbuild exists |
# check if an special subpackage_pkgbuild exists |
1643 |
if typeset -f ${PNAME}_pkgbuild > /dev/null |
if typeset -f ${PNAME}_pkgbuild > /dev/null |