--- /dev/null
+#!/bin/bash
+
+# Based on RedHat's brp-strip*.
+
+BUILDROOT=${1}
+
+for f in `find ${BUILDROOT} -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \) -exec file {} \; | \
+ grep -v "^${BUILDROOT}/\?usr/lib/debug" | \
+ grep -v ' shared object,' | \
+ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
+
+ # Strip ELF binaries
+ strip -g "$f" || :
+
+ note="-R .note"
+ if objdump -h $f | grep '^[ ]*[0-9]*[ ]*.note[ ]' -A 1 | \
+ grep ALLOC >/dev/null; then
+ note=
+ fi
+ strip -R .comment $note "$f" || :
+done
+
+# Strip ELF shared objects
+# Please note we don't restrict our search to executable files because
+# our libraries are not (should not be, at least) +x.
+for f in `find ${BUILDROOT} -type f -a -exec file {} \; | \
+ grep -v "^${BUILDROOT}/\?usr/lib/debug" | \
+ grep ' shared object,' | \
+ sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`; do
+ strip --strip-unneeded "$f"
+done
$(DO_INSTALL_INIT)
$(DO_INSTALL_PAM)
- $(DO_PYTHON_COMPILE)
-
@echo "#####################################################################"
@echo "# $(PKG_NAME) - Install finished"
@echo "#####################################################################"
+ $(DO_STRIP)
+ $(DO_PYTHON_COMPILE)
+
+ $(STAGE_INSTALL_POST)
+
$(DO_QUALITY_AGENT)
$(DO_FILELIST)
endef
+++ /dev/null
-#!/bin/bash
-
-. $(dirname ${0})/qa-include
-
-DESC="Stripping reduces size of binary files."
-
-function check() {
- # Strip debugging symbols
- for f in $(find ${BUILDROOT} -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 \)); do
- if (file $f | grep -q ' shared object,'); then
- strip --strip-debug "$f" || :
- fi
- done
-
- for f in $(find ${BUILDROOT} -type f); do
- if (file $f | grep -q ' shared object,'); then
- strip --strip-unneeded "$f" || :
- fi
- done
-}
-
-run
-