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}'" |
# always use verbose mode for source downloads |
181 |
|
FVERBOSE=off msetfeature "verbose" |
182 |
|
# do not die here, mchecksum catches download errors |
183 |
|
mdownload --uri "${uri}" --dir "${outputdir}" |
184 |
|
|
185 |
# unset them to be sure |
# unset them to be sure |
186 |
unset uri |
unset uri |
239 |
|
|
240 |
mconfigure() |
mconfigure() |
241 |
{ |
{ |
242 |
|
local myopts |
243 |
|
if [[ ! -z ${CTARGET} ]] |
244 |
|
then |
245 |
|
myopts+=" --target=${CTARGET}" |
246 |
|
fi |
247 |
|
# if requested disable-static |
248 |
|
if [[ ! -z $(./configure --help | grep -- '--.*able-static') ]] |
249 |
|
then |
250 |
|
if mqueryfeature '!static' |
251 |
|
then |
252 |
|
myopts+=" --disable-static" |
253 |
|
else |
254 |
|
myopts+=" --enable-static" |
255 |
|
fi |
256 |
|
fi |
257 |
|
|
258 |
|
# always enable shared by default |
259 |
|
if [[ ! -z $(./configure --help | grep -- '--.*able-shared') ]] |
260 |
|
then |
261 |
|
myopts+=" --enable-shared" |
262 |
|
fi |
263 |
|
|
264 |
if [ -x ./configure ] |
if [ -x ./configure ] |
265 |
then |
then |
266 |
./configure \ |
./configure \ |
273 |
--sysconfdir=/etc \ |
--sysconfdir=/etc \ |
274 |
--localstatedir=/var/lib \ |
--localstatedir=/var/lib \ |
275 |
--libdir=/usr/$(mlibdir) \ |
--libdir=/usr/$(mlibdir) \ |
276 |
|
${myopts} \ |
277 |
"$@" || die "mconfigure failed" |
"$@" || die "mconfigure failed" |
278 |
else |
else |
279 |
echo "configure is not an executable ..." |
echo "configure is not an executable ..." |
369 |
rar) |
rar) |
370 |
unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST} || die ".rar unpack failed." |
unrar x ${SOURCEDIR}/${PNAME}/${SRCFILE} ${DEST} || die ".rar unpack failed." |
371 |
;; |
;; |
372 |
zip|xpi) |
zip|xpi|jar) |
373 |
unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed." |
unzip ${SOURCEDIR}/${PNAME}/${SRCFILE} -d ${DEST} || die ".zip unpack failed." |
374 |
;; |
;; |
375 |
rpm) |
rpm) |
449 |
then |
then |
450 |
if mqueryfeature "compressdoc" |
if mqueryfeature "compressdoc" |
451 |
then |
then |
452 |
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}/$(basename ${doc}).gz || die "gzipping +installing ${doc}." |
453 |
chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/${doc}.gz || die "fixing permissions of ${doc}." |
chmod 0644 ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/$(basename ${doc}).gz || die "fixing permissions of ${doc}." |
454 |
else |
else |
455 |
install -m 0644 ${SRCDIR}/${i} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}." |
install -m 0644 ${SRCDIR}/${i} ${BINDIR}/usr/share/doc/${PNAME}-${PVER} || die "installing ${doc}." |
456 |
fi |
fi |
490 |
local stripdir="$@" |
local stripdir="$@" |
491 |
|
|
492 |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
493 |
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 | grep "libtool library" | cut -f 1 -d : | xargs --no-run-if-empty rm -f -- 2> /dev/null |
494 |
} |
} |
495 |
|
|
496 |
mpurgetargets() |
mpurgetargets() |
819 |
unset STATE |
unset STATE |
820 |
unset DESCRIPTION |
unset DESCRIPTION |
821 |
unset HOMEPAGE |
unset HOMEPAGE |
822 |
unset PKGTYPE |
# unset PKGTYPE <-- don't do that either; smage needs this var |
823 |
unset INHERITS |
unset INHERITS |
824 |
unset DEPEND |
unset DEPEND |
825 |
unset SDEPEND |
unset SDEPEND |
924 |
|
|
925 |
# special handling needed for mage features |
# special handling needed for mage features |
926 |
# pkgbuild |
# pkgbuild |
927 |
msetfeature "${SAVED_FEATURE_PKGBUILD}" |
FVERBOSE=off msetfeature "${SAVED_FEATURE_PKGBUILD}" |
928 |
# strip |
# strip |
929 |
msetfeature "${SAVED_FEATURE_STRIP}" |
FVERBOSE=off msetfeature "${SAVED_FEATURE_STRIP}" |
930 |
# libtool |
# libtool |
931 |
msetfeature "${SAVED_FEATURE_LIBTOOL}" |
FVERBOSE=off msetfeature "${SAVED_FEATURE_LIBTOOL}" |
932 |
# compressdoc |
# compressdoc |
933 |
msetfeature "${SAVED_FEATURE_COMPRESSDOC}" |
FVERBOSE=off msetfeature "${SAVED_FEATURE_COMPRESSDOC}" |
934 |
|
|
935 |
# bindir too |
# bindir too |
936 |
export BINDIR="${SAVED_BINDIR}" |
export BINDIR="${SAVED_BINDIR}" |
1161 |
fi |
fi |
1162 |
} |
} |
1163 |
|
|
1164 |
|
resume_stamp() |
1165 |
|
{ |
1166 |
|
local step="$1" |
1167 |
|
[[ ! -d ${BUILDDIR}/.stamps ]] && install -d ${BUILDDIR}/.stamps |
1168 |
|
touch ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step} |
1169 |
|
} |
1170 |
|
|
1171 |
|
run_resume() |
1172 |
|
{ |
1173 |
|
local step="$1" |
1174 |
|
|
1175 |
|
if mqueryfeature "resume" && [[ -f ${BUILDDIR}/.stamps/smage-${PKGNAME}-${step} ]] |
1176 |
|
then |
1177 |
|
echo -e "${COLMAGENTA}${step} already processed; doing nothing${COLDEFAULT}" |
1178 |
|
return 0 |
1179 |
|
else |
1180 |
|
return 1 |
1181 |
|
fi |
1182 |
|
} |
1183 |
|
|
1184 |
# print out our version |
# print out our version |
1185 |
showversion |
showversion |
1400 |
[[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}" |
[[ ! -f ${SMAGENAME} ]] && die "Included smage2 file in src-tarball not found: ${SMAGENAME}" |
1401 |
fi |
fi |
1402 |
|
|
1403 |
|
if [ "$1" == "--resume" -a -n "$2" ] |
1404 |
|
then |
1405 |
|
msetfeature "resume" |
1406 |
|
SMAGENAME="$2" |
1407 |
|
fi |
1408 |
|
|
1409 |
[ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting." |
[ ! -e ${MLIBDIR}/pkgbuild_dir.sh ] && die "Error: ${MLIBDIR}/pkgbuild_dir.sh not found. Aborting." |
1410 |
[ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] && |
[ -z "$(basename ${SMAGENAME} | grep .${SMAGESUFFIX})" ] && |
1449 |
# fixes some compile issues |
# fixes some compile issues |
1450 |
export CHOST="${CHOST}" || die "CHOST export failed" |
export CHOST="${CHOST}" || die "CHOST export failed" |
1451 |
export CFLAGS="${CFLAGS}" || die "CFLAGS export failed" |
export CFLAGS="${CFLAGS}" || die "CFLAGS export failed" |
1452 |
export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed" |
if [[ -z ${CXXFLAGS} ]] |
1453 |
|
then |
1454 |
|
export CXXFLAGS="${CFLAGS}" || die "CXXFLAGS export failed" |
1455 |
|
else |
1456 |
|
export CXXFLAGS="${CXXFLAGS}" || die "CXXFLAGS export failed" |
1457 |
|
fi |
1458 |
|
export LDFLAGS="${LDFLAGS}" || die "LDFLAGS export failed" |
1459 |
export BINDIR="${BINDIR}" || die "BINDIR export failed" |
export BINDIR="${BINDIR}" || die "BINDIR export failed" |
1460 |
export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed" |
export MAKEOPTS="${MAKEOPTS}" || die "MAKEOPTS export failed" |
1461 |
|
|
1466 |
# setup ccache |
# setup ccache |
1467 |
mqueryfeature "ccache" && setup_ccache_environment |
mqueryfeature "ccache" && setup_ccache_environment |
1468 |
|
|
1469 |
# clean up builddir if a previously one exist |
if mqueryfeature "resume" |
|
if [ -d ${BUILDDIR} ] |
|
1470 |
then |
then |
1471 |
rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR." |
echo -e "${COLMAGENTA}Resume requested; continuing previous build${COLDEFAULT}" |
|
fi |
|
|
install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR." |
|
1472 |
|
|
1473 |
# clean up srcdir if a previously unpacked one exist |
# setup build logging |
1474 |
if [ -d ${SRCDIR} ] |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
1475 |
then |
if [[ -f /var/log/smage/${PKGNAME}.log.bz2 ]] |
1476 |
rm -rf ${SRCDIR} |
then |
1477 |
fi |
bunzip2 -f /var/log/smage/${PKGNAME}.log.bz2 |
1478 |
|
fi |
1479 |
|
echo -e "### Resume started on $(date) ###\n" >> /var/log/smage/${PKGNAME}.log |
1480 |
|
|
1481 |
# clean up bindir if a previous build exist or create a new one |
else |
1482 |
if [ -d ${BINDIR} ] |
# clean up builddir if a previously one exist |
1483 |
then |
if [ -d ${BUILDDIR} ] |
1484 |
rm -rf ${BINDIR} |
then |
1485 |
fi |
rm -rf ${BUILDDIR}/* || die "couldn't cleanup \$BUILDDIR." |
1486 |
install -d ${BINDIR} || die "couldn't create \$BINDIR." |
fi |
1487 |
|
install -d ${BUILDDIR} || die "couldn't create \$BUILDDIR." |
1488 |
|
|
1489 |
# clean up package temp dir if a previous build exist |
# clean up srcdir if a previously unpacked one exist |
1490 |
if [ -d ${BUILDDIR}/${PKGNAME} ] |
if [ -d ${SRCDIR} ] |
1491 |
then |
then |
1492 |
rm -rf ${BUILDDIR}/${PKGNAME} |
rm -rf ${SRCDIR} |
1493 |
fi |
fi |
1494 |
|
|
1495 |
|
# clean up bindir if a previous build exist or create a new one |
1496 |
|
if [ -d ${BINDIR} ] |
1497 |
|
then |
1498 |
|
rm -rf ${BINDIR} |
1499 |
|
fi |
1500 |
|
install -d ${BINDIR} || die "couldn't create \$BINDIR." |
1501 |
|
|
1502 |
# setup build logging |
# clean up package temp dir if a previous build exist |
1503 |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
if [ -d ${BUILDDIR}/${PKGNAME} ] |
1504 |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
then |
1505 |
|
rm -rf ${BUILDDIR}/${PKGNAME} |
1506 |
|
fi |
1507 |
|
|
1508 |
|
# clean up stamps dir |
1509 |
|
if [ -d ${BUILDDIR}/.stamps ] |
1510 |
|
then |
1511 |
|
rm -rf ${BUILDDIR}/.stamps |
1512 |
|
fi |
1513 |
|
|
1514 |
|
# setup build logging |
1515 |
|
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
1516 |
|
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
1517 |
|
fi |
1518 |
|
|
1519 |
if [[ ${PKGTYPE} = virtual ]] |
if [[ ${PKGTYPE} = virtual ]] |
1520 |
then |
then |
1522 |
# automatically set !pkgbuild here too |
# automatically set !pkgbuild here too |
1523 |
msetfeature "!pkgbuild" |
msetfeature "!pkgbuild" |
1524 |
else |
else |
1525 |
src_prepare | ${SMAGE_LOG_CMD} |
( run_resume src_prepare || src_prepare ) | ${SMAGE_LOG_CMD} |
1526 |
die_pipestatus 0 "src_prepare failed" |
die_pipestatus 0 "src_prepare failed" |
1527 |
step_by_step $_ |
resume_stamp src_prepare |
1528 |
|
step_by_step src_prepare |
1529 |
|
|
1530 |
src_compile | ${SMAGE_LOG_CMD} |
( run_resume src_compile || src_compile ) | ${SMAGE_LOG_CMD} |
1531 |
die_pipestatus 0 "src_compile failed" |
die_pipestatus 0 "src_compile failed" |
1532 |
step_by_step $_ |
resume_stamp src_compile |
1533 |
|
step_by_step src_compile |
1534 |
|
|
1535 |
# only run checks if requested |
# only run checks if requested |
1536 |
if mqueryfeature "!check" |
if mqueryfeature "!check" |
1537 |
then |
then |
1538 |
echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD} |
echo "!check detected; src_check() will not be run!" | ${SMAGE_LOG_CMD} |
|
step_by_step src_check |
|
1539 |
else |
else |
1540 |
src_check | ${SMAGE_LOG_CMD} |
( run_resume src_check || src_check ) | ${SMAGE_LOG_CMD} |
1541 |
die_pipestatus 0 "src_check failed" |
die_pipestatus 0 "src_check failed" |
1542 |
step_by_step $_ |
resume_stamp src_check |
1543 |
fi |
fi |
1544 |
|
step_by_step src_check |
1545 |
|
|
1546 |
# build several subpackages |
# build several subpackages |
1547 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1565 |
echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" |
echo -en " for subpkg: ${COLBLUE}${PNAME}${COLDEFAULT}" |
1566 |
echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." |
echo -e " - basepkg: ${COLBLUE}${SPLIT_PACKAGE_BASE}${COLDEFAULT} ..." |
1567 |
|
|
1568 |
src_install_${subpackage} | ${SMAGE_LOG_CMD} |
( run_resume src_install_${subpackage} || src_install_${subpackage} ) | ${SMAGE_LOG_CMD} |
1569 |
die_pipestatus 0 "src_install_${subpackage} failed" |
die_pipestatus 0 "src_install_${subpackage} failed" |
1570 |
step_by_step $_ |
resume_stamp src_install_${subpackage} |
1571 |
|
step_by_step src_install_${subpackage} |
1572 |
fi |
fi |
1573 |
done |
done |
1574 |
# restore bindir & pname |
# restore bindir & pname |
1576 |
# unset all saved smage variables |
# unset all saved smage variables |
1577 |
split_unset_variables |
split_unset_variables |
1578 |
else |
else |
1579 |
src_install | ${SMAGE_LOG_CMD} |
( run_resume src_install || src_install ) | ${SMAGE_LOG_CMD} |
1580 |
die_pipestatus 0 "src_install failed" |
die_pipestatus 0 "src_install failed" |
1581 |
step_by_step $_ |
resume_stamp src_install |
1582 |
|
step_by_step src_install |
1583 |
fi |
fi |
1584 |
fi |
fi |
1585 |
|
|
1589 |
if mqueryfeature "!compressdoc" |
if mqueryfeature "!compressdoc" |
1590 |
then |
then |
1591 |
echo -e "!compressdoc detected; documentation will not be compressed ..." |
echo -e "!compressdoc detected; documentation will not be compressed ..." |
1592 |
|
elif mqueryfeature "!pkgbuild" |
1593 |
|
then |
1594 |
|
echo "!pkgbuild detected; skipping documentation compression..." |
1595 |
else |
else |
1596 |
# compressing doc, info & man files |
# compressing doc, info & man files |
1597 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1598 |
then |
then |
1599 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1600 |
do |
do |
1601 |
mcompressdocs ${BINDIR}_${subpackage} |
run_resume mcompressdoc_${subpackage} || mcompressdocs ${BINDIR}_${subpackage} |
1602 |
|
resume_stamp mcompressdoc_${subpackage} |
1603 |
done |
done |
1604 |
else |
else |
1605 |
mcompressdocs ${BINDIR} |
run_resume mcompressdoc || mcompressdocs ${BINDIR} |
1606 |
|
resume_stamp mcompressdoc |
1607 |
fi |
fi |
1608 |
fi |
fi |
1609 |
|
|
1610 |
if mqueryfeature "!libtool" |
if mqueryfeature "!libtool" |
1611 |
then |
then |
1612 |
|
if mqueryfeature "!pkgbuild" |
1613 |
|
then |
1614 |
|
echo "!pkgbuild detected; skipping libtool archive stripping ..." |
1615 |
|
else |
1616 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1617 |
then |
then |
1618 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1619 |
do |
do |
1620 |
echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives for '${subpackage}' ...${COLDEFAULT}" |
1621 |
mstriplibtoolarchive ${BINDIR}_${subpackage} |
run_resume mstriplibtoolarchive_${subpackage} || mstriplibtoolarchive ${BINDIR}_${subpackage} |
1622 |
|
resume_stamp mstriplibtoolarchive_${subpackage} |
1623 |
done |
done |
1624 |
else |
else |
1625 |
echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping libtool archives ...${COLDEFAULT}" |
1626 |
mstriplibtoolarchive ${BINDIR} |
run_resume mstriplibtoolarchive || mstriplibtoolarchive ${BINDIR} |
1627 |
|
resume_stamp mstriplibtoolarchive |
1628 |
fi |
fi |
1629 |
|
fi |
1630 |
fi |
fi |
1631 |
|
|
1632 |
if mqueryfeature "purge" |
if mqueryfeature "purge" |
1633 |
then |
then |
1634 |
|
if mqueryfeature "!pkgbuild" |
1635 |
|
then |
1636 |
|
echo "!pkgbuild detected; skipping file purgation..." |
1637 |
|
else |
1638 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1639 |
then |
then |
1640 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1641 |
do |
do |
1642 |
echo -e "${COLBLUE}===${COLGREEN} purging all purge targets in '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} purging all purge targets in '${subpackage}' ...${COLDEFAULT}" |
1643 |
mpurgetargets ${BINDIR}_${subpackage} |
run_resume mpurgetargets_${subpackage} || mpurgetargets ${BINDIR}_${subpackage} |
1644 |
|
resume_stamp mpurgetargets_${subpackage} |
1645 |
done |
done |
1646 |
else |
else |
1647 |
echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} purging all purge targets ...${COLDEFAULT}" |
1648 |
mpurgetargets ${BINDIR} |
run_resume mpurgetargets || mpurgetargets ${BINDIR} |
1649 |
|
resume_stamp mpurgetargets |
1650 |
fi |
fi |
1651 |
|
fi |
1652 |
fi |
fi |
1653 |
|
|
1654 |
# stripping all bins and libs |
# stripping all bins and libs |
1655 |
if mqueryfeature "!strip" |
if mqueryfeature "!strip" |
1656 |
then |
then |
1657 |
echo -e "!strip detected; Package will not be stripped ..." |
echo -e "!strip detected; Package will not be stripped ..." |
1658 |
|
elif mqueryfeature "!pkgbuild" |
1659 |
|
then |
1660 |
|
echo "!pkgbuild detected; skipping stripping of the package ..." |
1661 |
else |
else |
1662 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1663 |
then |
then |
1664 |
for subpackage in ${SPLIT_PACKAGES} |
for subpackage in ${SPLIT_PACKAGES} |
1665 |
do |
do |
1666 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries for '${subpackage}' ...${COLDEFAULT}" |
1667 |
mstripbins ${BINDIR}_${subpackage} |
run_resume mstripbins_${subpackage} || mstripbins ${BINDIR}_${subpackage} |
1668 |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" |
resume_stamp mstripbins_${subpackage} |
1669 |
mstriplibs ${BINDIR}_${subpackage} |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries for '${subpackage}' ...${COLDEFAULT}" |
1670 |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" |
run_resume mstriplibs_${subpackage} || mstriplibs ${BINDIR}_${subpackage} |
1671 |
mstripstatic ${BINDIR}_${subpackage} |
resume_stamp mstriplibs_${subpackage} |
1672 |
done |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries for '${subpackage}' ...${COLDEFAULT}" |
1673 |
else |
run_resume mstripstatic_${subpackage} || mstripstatic ${BINDIR}_${subpackage} |
1674 |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
resume_stamp mstripstatic_${subpackage} |
1675 |
mstripbins ${BINDIR} |
done |
1676 |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" |
else |
1677 |
mstriplibs ${BINDIR} |
echo -e "${COLBLUE}===${COLGREEN} stripping binaries ...${COLDEFAULT}" |
1678 |
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" |
run_resume mstripbins || mstripbins ${BINDIR} |
1679 |
mstripstatic ${BINDIR} |
resume_stamp mstripbins |
1680 |
fi |
echo -e "${COLBLUE}===${COLGREEN} stripping dynamic libraries ...${COLDEFAULT}" |
1681 |
|
run_resume mstriplibs || mstriplibs ${BINDIR} |
1682 |
|
resume_stamp mstriplibs |
1683 |
|
echo -e "${COLBLUE}===${COLGREEN} stripping static libraries ...${COLDEFAULT}" |
1684 |
|
run_resume mstripstatic || mstripstatic ${BINDIR} |
1685 |
|
resume_stamp mstripstatic |
1686 |
|
fi |
1687 |
fi |
fi |
1688 |
|
|
1689 |
if mqueryfeature "!buildpkg" |
if mqueryfeature "!pkgbuild" |
1690 |
then |
then |
1691 |
echo -e "!buildpkg detected; Package will not be build ..." |
echo -e "!pkgbuild detected; Package will not be build ..." |
1692 |
else |
else |
1693 |
# build several targets |
# build several targets |
1694 |
if [[ -n ${MAGE_TARGETS} ]] |
if [[ -n ${MAGE_TARGETS} ]] |
1699 |
if typeset -f ${target}_pkgbuild > /dev/null |
if typeset -f ${target}_pkgbuild > /dev/null |
1700 |
then |
then |
1701 |
# run it |
# run it |
1702 |
${target}_pkgbuild |
run_resume ${target}_pkgbuild || ${target}_pkgbuild |
1703 |
|
resume_stamp ${target}_pkgbuild |
1704 |
fi |
fi |
1705 |
# now create the target package |
# now create the target package |
1706 |
${MLIBDIR}/pkgbuild_dir.sh \ |
run_resume pkg_builddir_${target} || ${MLIBDIR}/pkgbuild_dir.sh \ |
1707 |
"${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \ |
"${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD}" \ |
1708 |
${BINDIR} || die "target: ${target} package-build failed" |
${BINDIR} || die "target: ${target} package-build failed" |
1709 |
|
resume_stamp pkg_builddir_${target} |
1710 |
|
|
1711 |
# build pkg-md5-sum if requested |
# build pkg-md5-sum if requested |
1712 |
generate_package_md5sum \ |
run_resume md5sum_${target} || generate_package_md5sum \ |
1713 |
--pcat "${PCATEGORIE}" \ |
--pcat "${PCATEGORIE}" \ |
1714 |
--pname "${PNAME}" \ |
--pname "${PNAME}" \ |
1715 |
--pver "${PVER}" \ |
--pver "${PVER}" \ |
1716 |
--pbuild "${PBUILD}" \ |
--pbuild "${PBUILD}" \ |
1717 |
--parch "${ARCH}" \ |
--parch "${ARCH}" \ |
1718 |
--target "${target}" |
--target "${target}" |
1719 |
|
resume_stamp md5sum_${target} |
1720 |
|
|
1721 |
echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
echo -e "${COLGREEN}\nPackage ${PNAME}-${target}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
1722 |
done |
done |
1731 |
export PNAME="${subpackage}" |
export PNAME="${subpackage}" |
1732 |
split_info_${PNAME} |
split_info_${PNAME} |
1733 |
|
|
1734 |
# jump to next one if !buildpkg is set in split_info |
# jump to next one if !pkgbuild is set in split_info |
1735 |
mqueryfeature "!buildpkg" && continue |
mqueryfeature "!pkgbuild" && continue |
1736 |
|
|
1737 |
# check if an special subpackage_pkgbuild exists |
# check if an special subpackage_pkgbuild exists |
1738 |
if typeset -f ${PNAME}_pkgbuild > /dev/null |
if typeset -f ${PNAME}_pkgbuild > /dev/null |
1739 |
then |
then |
1740 |
# run it |
# run it |
1741 |
${PNAME}_pkgbuild |
run_resume ${PNAME}_pkgbuild || ${PNAME}_pkgbuild |
1742 |
|
resume_stamp ${PNAME}_pkgbuild |
1743 |
fi |
fi |
1744 |
# now create the target package |
# now create the target package |
1745 |
${MLIBDIR}/pkgbuild_dir.sh \ |
run_resume pkg_builddir_${PNAME} || ${MLIBDIR}/pkgbuild_dir.sh \ |
1746 |
"${PNAME}-${PVER}-${ARCH}-${PBUILD}" \ |
"${PNAME}-${PVER}-${ARCH}-${PBUILD}" \ |
1747 |
"${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed" |
"${BINDIR}_${PNAME}" || die "split_package: ${PNAME} package-build failed" |
1748 |
|
resume_stamp pkg_builddir_${PNAME} |
1749 |
|
|
1750 |
# build pkg-md5-sum if requested |
# build pkg-md5-sum if requested |
1751 |
generate_package_md5sum \ |
run_resume md5sum_${PNAME} || generate_package_md5sum \ |
1752 |
--pcat "${PCATEGORIE}" \ |
--pcat "${PCATEGORIE}" \ |
1753 |
--pname "${PNAME}" \ |
--pname "${PNAME}" \ |
1754 |
--pver "${PVER}" \ |
--pver "${PVER}" \ |
1755 |
--pbuild "${PBUILD}" \ |
--pbuild "${PBUILD}" \ |
1756 |
--parch "${ARCH}" |
--parch "${ARCH}" |
1757 |
|
resume_stamp md5sum_${PNAME} |
1758 |
|
|
1759 |
echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
echo -e "${COLGREEN}\nPackage ${PNAME}-${PVER}-${ARCH}-${PBUILD} successfully builded.\n${COLDEFAULT}" |
1760 |
|
|
1765 |
split_unset_variables |
split_unset_variables |
1766 |
|
|
1767 |
else |
else |
1768 |
${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed" |
run_resume pkg_builddir || ${MLIBDIR}/pkgbuild_dir.sh ${PKGNAME} ${BINDIR} || die "package-build failed" |
1769 |
|
resume_stamp pkg_builddir |
1770 |
|
|
1771 |
# build pkg-md5-sum if requested |
# build pkg-md5-sum if requested |
1772 |
generate_package_md5sum \ |
run_resume md5sum || generate_package_md5sum \ |
1773 |
--pcat "${PCATEGORIE}" \ |
--pcat "${PCATEGORIE}" \ |
1774 |
--pname "${PNAME}" \ |
--pname "${PNAME}" \ |
1775 |
--pver "${PVER}" \ |
--pver "${PVER}" \ |
1776 |
--pbuild "${PBUILD}" \ |
--pbuild "${PBUILD}" \ |
1777 |
--parch "${ARCH}" |
--parch "${ARCH}" |
1778 |
|
resume_stamp md5sum |
1779 |
|
|
1780 |
echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}" |
echo -e "${COLGREEN}\nPackage ${PKGNAME} successfully builded.\n${COLDEFAULT}" |
1781 |
fi |
fi |
1782 |
|
|
1783 |
# build src-pkg-tarball if requested |
# build src-pkg-tarball if requested |
1784 |
mqueryfeature "srcpkg" && source_pkg_build ${SMAGENAME} |
if mqueryfeature "srcpkg" |
1785 |
|
then |
1786 |
|
run_resume srcpkgbuild || source_pkg_build ${SMAGENAME} |
1787 |
|
resume_stamp srcpkgbuild |
1788 |
|
fi |
1789 |
fi |
fi |
1790 |
|
|
1791 |
if mqueryfeature "buildlog" |
if mqueryfeature "buildlog" |