Chris@252: #!/bin/bash Chris@252: Chris@252: dir=$1 Chris@252: Chris@252: [ -d "$dir" ] || exit 1 Chris@252: Chris@252: strip "$dir"/usr/bin/* Chris@252: Chris@252: sz=`du -sx --exclude DEBIAN "$dir" | awk '{ print $1; }'` Chris@252: perl -i -p -e "s/Installed-Size: .*/Installed-Size: $sz/" "$dir"/DEBIAN/control Chris@252: Chris@252: find "$dir" -name \*~ -exec rm \{\} \; Chris@252: Chris@252: sudo chown -R root.root "$dir"/* Chris@252: Chris@252: sudo chmod -R g-w "$dir"/*