325 |
src_prepare() |
src_prepare() |
326 |
{ |
{ |
327 |
echo "no src_prepare defined" |
echo "no src_prepare defined" |
|
sleep 2 |
|
328 |
return 0 |
return 0 |
329 |
} |
} |
330 |
|
|
332 |
src_compile() |
src_compile() |
333 |
{ |
{ |
334 |
echo "no src_compile defined" |
echo "no src_compile defined" |
335 |
sleep 2 |
return 0 |
336 |
|
} |
337 |
|
|
338 |
|
# dummy function, used if that does not exist in smage file |
339 |
|
src_check() |
340 |
|
{ |
341 |
|
echo "no src_check defined" |
342 |
return 0 |
return 0 |
343 |
} |
} |
344 |
|
|
346 |
src_install() |
src_install() |
347 |
{ |
{ |
348 |
echo "no src_install defined" |
echo "no src_install defined" |
|
sleep 2 |
|
349 |
return 0 |
return 0 |
350 |
} |
} |
351 |
|
|
555 |
{ |
{ |
556 |
local stripdir="$@" |
local stripdir="$@" |
557 |
|
|
558 |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
559 |
find ${stripdir} | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_LIB} 2> /dev/null |
[[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug" |
560 |
|
find ${stripdir} ! -type d | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null |
561 |
} |
} |
562 |
|
|
563 |
mstripbins() |
mstripbins() |
564 |
{ |
{ |
565 |
local stripdir="$@" |
local stripdir="$@" |
566 |
|
|
567 |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
568 |
find ${stripdir} | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip ${STRIP_DYN_BIN} 2> /dev/null |
[[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug" |
569 |
|
find ${stripdir} ! -type d | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null |
570 |
} |
} |
571 |
|
|
572 |
mstripstatic() |
mstripstatic() |
573 |
{ |
{ |
574 |
local stripdir="$@" |
local stripdir="$@" |
575 |
|
|
576 |
[ -z "${stripdir}" ] && stripdir=${BINDIR} |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
577 |
find ${stripdir} | xargs file | grep "ar archive" | cut -f 1 -d : | xargs strip ${STRIP_STATIC_LIB} 2> /dev/null |
[[ -z ${STRIP_STATIC_LIB} ]] && STRIP_STATIC_LIB="--strip-debug" |
578 |
|
find ${stripdir} ! -type d | xargs file | grep "ar archive" | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_STATIC_LIB} 2> /dev/null |
579 |
} |
} |
580 |
|
|
581 |
mcompressdocs() |
mcompressdocs() |
1454 |
# fixes some issues with these functions |
# fixes some issues with these functions |
1455 |
export -f src_prepare || die "src_prepare export failed" |
export -f src_prepare || die "src_prepare export failed" |
1456 |
export -f src_compile || die "src_compile export failed" |
export -f src_compile || die "src_compile export failed" |
1457 |
|
export -f src_check || die "src_check export failed" |
1458 |
export -f src_install || die "src_install export failed" |
export -f src_install || die "src_install export failed" |
1459 |
|
|
1460 |
# fixes some compile issues |
# fixes some compile issues |
1472 |
# setup ccache |
# setup ccache |
1473 |
[[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment |
[[ ${SMAGE_USE_CCACHE} = true ]] && setup_ccache_environment |
1474 |
|
|
|
# small sleep to show our settings |
|
|
sleep 1 |
|
|
|
|
1475 |
# clean up builddir if a previously one exist |
# clean up builddir if a previously one exist |
1476 |
if [ -d ${BUILDDIR} ] |
if [ -d ${BUILDDIR} ] |
1477 |
then |
then |
1492 |
fi |
fi |
1493 |
install -d ${BINDIR} || die "couldn't create \$BINDIR." |
install -d ${BINDIR} || die "couldn't create \$BINDIR." |
1494 |
|
|
1495 |
# cleans up package temp dir if a previous build exists |
# clean up package temp dir if a previous build exist |
1496 |
if [ -d ${BUILDDIR}/${PKGNAME} ] |
if [ -d ${BUILDDIR}/${PKGNAME} ] |
1497 |
then |
then |
1498 |
rm -rf ${BUILDDIR}/${PKGNAME} |
rm -rf ${BUILDDIR}/${PKGNAME} |
1499 |
fi |
fi |
1500 |
|
|
|
# cleans up timestamp if one exists |
|
|
if [ -f /var/tmp/timestamp ] |
|
|
then |
|
|
mage rmstamp |
|
|
fi |
|
|
|
|
1501 |
# setup build logging |
# setup build logging |
1502 |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
[[ ! -d /var/log/smage ]] && install -d /var/log/smage |
1503 |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
echo -e "### Build started on $(date) ###\n" > /var/log/smage/${PKGNAME}.log |
1510 |
die_pipestatus 0 "src_compile failed" |
die_pipestatus 0 "src_compile failed" |
1511 |
step_by_step $_ |
step_by_step $_ |
1512 |
|
|
1513 |
|
# only run checks if requested |
1514 |
|
if [[ ${MAGE_CHECK} != true ]] |
1515 |
|
then |
1516 |
|
echo "MAGE_CHECK not requested; src_check() will not be run!" | ${SMAGE_LOG_CMD} |
1517 |
|
step_by_step src_check |
1518 |
|
else |
1519 |
|
src_check | ${SMAGE_LOG_CMD} |
1520 |
|
die_pipestatus 0 "src_check failed" |
1521 |
|
step_by_step $_ |
1522 |
|
fi |
1523 |
|
|
1524 |
# build several subpackages |
# build several subpackages |
1525 |
if [[ -n ${SPLIT_PACKAGES} ]] |
if [[ -n ${SPLIT_PACKAGES} ]] |
1526 |
then |
then |