5 PATH=debian:$PATH:/usr/lib/debhelper
8 # This reads in a list of files, and excludes any that match what's in
10 filelist_excluded () {
11 if [ "$DH_EXCLUDE_GREP" ]; then
12 # Use grep -F so we don't have to worry about regexp's.
13 grep -v -F "`(cd $TMP; echo "$DH_EXCLUDE_GREP" | tr "|" "\n")`"
15 # Just pass all files through.
20 for PACKAGE in $DH_DOPACKAGES; do
23 # Handle executables and shared libraries.
24 for file in `(cd $TMP; find -type f \( -perm +111 -or -name "*.so*" \) 2>/dev/null) | filelist_excluded` ; do
25 case "`file $TMP/$file`" in
27 doit "strip --strip-unneeded $TMP/$file"
30 doit "strip --remove-section=.comment --remove-section=.note $TMP/$file"
35 # Handle static libraries.
36 for file in `(cd $TMP; find -type f -name "lib*.a" 2>/dev/null) | filelist_excluded` ; do
37 # Don't strip debug libraries.
38 if ! expr "$file" : ".*_g\.a" >/dev/null ; then
39 doit "strip --strip-debug $TMP/$file"