diff options
author | joey <joey> | 1999-08-17 04:21:02 +0000 |
---|---|---|
committer | joey <joey> | 1999-08-17 04:21:02 +0000 |
commit | 2cfd4c9cda59e11e29df58152fea76c1cfc696f6 (patch) | |
tree | a459b3a8980d00b156dd4b81a868e76caa2b1a81 /dh_strip | |
parent | ecff4e2941eefd33c368be7a0ee372406a6d0e94 (diff) | |
download | debhelper-2cfd4c9cda59e11e29df58152fea76c1cfc696f6.tar.gz |
r6: Initial revision
Diffstat (limited to 'dh_strip')
-rwxr-xr-x | dh_strip | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/dh_strip b/dh_strip new file mode 100755 index 00000000..2ecdcd2c --- /dev/null +++ b/dh_strip @@ -0,0 +1,30 @@ +#!/bin/sh -e +# +# Strip files. + +PATH=debian:$PATH:/usr/lib/debhelper +source dh_lib + +for PACKAGE in $DH_DOPACKAGES; do + TMP=`tmpdir $PACKAGE` + + # Handle executables and shared libraries. + for file in `find debian/$TMP -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null` ; do + case "`file $file`" in + *ELF*shared*) + doit "strip --strip-unneeded $file" + ;; + *ELF*executable*) + doit "strip --remove-section=comment --remove-section=note $file" + ;; + esac + done + + # Handle static libraries. + for file in `find debian/$TMP -type f -name "lib*.a" 2>/dev/null` ; do + # Don't strip debug libraries. + if ! expr "$file" : ".*_g\.a" >/dev/null ; then + doit "strip --strip-debug $file" + fi + done +done |