summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2008-11-25 14:07:40 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2008-11-25 14:07:40 +0000
commit6bbb1b6be9ec380d7d165b08003e1ea4d72a13f4 (patch)
tree5f34e0949d3bfce56a0f841bdbb61acd7ee92b3b
parentb9ce3c170a98058e71eef08205e37a2a22933277 (diff)
downloadabuild-6bbb1b6be9ec380d7d165b08003e1ea4d72a13f4.tar.gz
abuild-6bbb1b6be9ec380d7d165b08003e1ea4d72a13f4.tar.bz2
abuild-6bbb1b6be9ec380d7d165b08003e1ea4d72a13f4.tar.xz
abuild-6bbb1b6be9ec380d7d165b08003e1ea4d72a13f4.zip
strip binaries before creating package
-rwxr-xr-xabuild17
1 files changed, 17 insertions, 0 deletions
diff --git a/abuild b/abuild
index fcc8128..ca883af 100755
--- a/abuild
+++ b/abuild
@@ -302,6 +302,7 @@ EOF
}
package() {
+ stripbin
package_apk
}
@@ -443,6 +444,22 @@ checksum() {
echo "md5sums=\"$md5sums\""
}
+stripbin() {
+ local bin dirs=${STRIP_DIRS:-bin lib sbin usr/bin usr/lib usr/sbin}
+ cd "${subpkgdir:-$pkgdir}" || return 1
+ msg "Stripping binaries"
+ find $dirs -type f 2>/dev/null | while read bin; do
+ local opt=
+ case "$(file -biz "$bin")" in
+ */x-sharedlib*|*/x-archive*)
+ strip --strip-debug "$bin";;
+ */x-executable*)
+ strip "$bin";;
+ esac
+ done
+ return 0
+}
+
usage() {
echo "$(basename $0) $abuild_ver"
echo "usage: $0 [options] [cmd] ..."