Chris@700: #!/bin/bash Chris@700: Chris@700: dir=$1 Chris@700: Chris@700: [ -d "$dir" ] || exit 1 Chris@700: Chris@700: set -eu Chris@700: Chris@729: for x in "$dir"/usr/bin/* ; do Chris@729: case "$x" in Chris@729: *.sh) ;; Chris@729: *) strip "$x" ;; Chris@729: esac Chris@729: done Chris@700: Chris@700: sz=`du -sx --exclude DEBIAN "$dir" | awk '{ print $1; }'` Chris@700: perl -i -p -e "s/Installed-Size: .*/Installed-Size: $sz/" "$dir"/DEBIAN/control Chris@700: Chris@700: find "$dir" -name \*~ -exec rm \{\} \; Chris@700: Chris@700: chown -R root.root "$dir"/* Chris@700: Chris@700: chmod -R g-w "$dir"/*