453 |
|
|
454 |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
455 |
[[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug" |
[[ -z ${STRIP_DYN_LIB} ]] && STRIP_DYN_LIB="--strip-debug" |
456 |
find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null |
find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "[shared object|pie executable]" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_LIB} 2> /dev/null |
457 |
} |
} |
458 |
|
|
459 |
mstripbins() |
mstripbins() |
462 |
|
|
463 |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
[[ -z ${stripdir} ]] && stripdir="${BINDIR}" |
464 |
[[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug" |
[[ -z ${STRIP_DYN_BIN} ]] && STRIP_DYN_BIN="--strip-debug" |
465 |
find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null |
find ${stripdir} ! -type d | xargs --no-run-if-empty file | grep -v "pie executable" | grep "executable" | grep ELF | cut -f 1 -d : | xargs --no-run-if-empty strip ${STRIP_DYN_BIN} 2> /dev/null |
466 |
} |
} |
467 |
|
|
468 |
mstripstatic() |
mstripstatic() |
550 |
return "${retval}" |
return "${retval}" |
551 |
} |
} |
552 |
|
|
553 |
marchsrcfile() |
marchvariable() |
554 |
{ |
{ |
555 |
local retval |
local retval |
556 |
local var="$1" |
local var="$1" |
557 |
|
|
558 |
[[ -z ${var} ]] && var="SRCFILE" |
[[ -n ${var} ]] || die "marchvariable(): missing variable" |
559 |
|
|
560 |
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
561 |
then |
then |
568 |
return "${retval}" |
return "${retval}" |
569 |
} |
} |
570 |
|
|
571 |
|
marchsrcfile() |
572 |
|
{ |
573 |
|
local retval |
574 |
|
local var="$1" |
575 |
|
|
576 |
|
[[ -z ${var} ]] && var="SRCFILE" |
577 |
|
|
578 |
|
marchvariable "${var}" || die |
579 |
|
} |
580 |
|
|
581 |
marchsrcdir() |
marchsrcdir() |
582 |
{ |
{ |
583 |
local retval |
local retval |
585 |
|
|
586 |
[[ -z ${var} ]] && var="SRCDIR" |
[[ -z ${var} ]] && var="SRCDIR" |
587 |
|
|
588 |
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
marchvariable "${var}" || die |
|
then |
|
|
eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n' |
|
|
retval=0 |
|
|
else |
|
|
retval=1 |
|
|
fi |
|
|
|
|
|
return "${retval}" |
|
589 |
} |
} |
590 |
|
|
591 |
marchdepend() |
marchdepend() |
597 |
|
|
598 |
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
599 |
then |
then |
600 |
echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')" |
# evaluate with escape strings for the magefile if called by smage |
601 |
|
# but do not escape if the smagefile was called by depwalker directly |
602 |
|
if [[ ${SMAGE_DEPEND} = 1 ]] |
603 |
|
then |
604 |
|
eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n' |
605 |
|
else |
606 |
|
echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')" |
607 |
|
fi |
608 |
retval=0 |
retval=0 |
609 |
else |
else |
610 |
retval=1 |
retval=1 |
622 |
|
|
623 |
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
if [[ ! -z $(eval echo \$${var}_${ARCH/i*86/x86}) ]] |
624 |
then |
then |
625 |
echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')" |
# evaluate with escape strings for the magefile if called by smage |
626 |
|
# but do not escape if the smagefile was called by depwalker directly |
627 |
|
if [[ ${SMAGE_DEPEND} = 1 ]] |
628 |
|
then |
629 |
|
eval echo \$${var}_${ARCH/i*86/x86} | tr ';' '\n' |
630 |
|
else |
631 |
|
echo "\$(eval echo \\\$${var}_\${ARCH/i*86/x86} | tr ';' '\n')" |
632 |
|
fi |
633 |
retval=0 |
retval=0 |
634 |
else |
else |
635 |
retval=1 |
retval=1 |
1149 |
|
|
1150 |
source_pkg_build() |
source_pkg_build() |
1151 |
{ |
{ |
|
if [[ ${PKGTYPE} = virtual ]] |
|
|
then |
|
|
echo "Virtual package detected; src-pkg-tarball not necessary ..." |
|
|
return 0 |
|
|
fi |
|
|
|
|
1152 |
if [[ ! -d ${SOURCEDIR}/${PNAME} ]] |
if [[ ! -d ${SOURCEDIR}/${PNAME} ]] |
1153 |
then |
then |
1154 |
echo "No SRC_URI defined; src-pkg-tarball not necessary ..." |
install -d ${SOURCEDIR}/${PNAME} |
|
return 0 |
|
1155 |
fi |
fi |
1156 |
|
|
1157 |
[ -z "${SRCPKGDIR}" ] && die "\$SRCPKGDIR not found. Please setup your ${MAGERC} correctly." |
[ -z "${SRCPKGDIR}" ] && die "\$SRCPKGDIR not found. Please setup your ${MAGERC} correctly." |