1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
#!/bin/sh -e
#
# Do some general file permission fixups.
PATH=debian:$PATH:/usr/lib/debhelper
. dh_lib
for PACKAGE in $DH_DOPACKAGES; do
TMP=`tmpdir $PACKAGE`
# General things..
if [ -d $TMP ]; then
doit "chown -R root.root $TMP"
doit "chmod -R go=rX $TMP"
doit "chmod -R u+rw $TMP"
fi
# Fix up premissions in usr/doc, setting everything to not exectable
# by default, but leave examples directories alone.
files=`find $TMP/usr/doc -type f 2>/dev/null | grep -v /examples/ | tr "\n" " "` || true
if [ "$files" ]; then
doit "chmod 644 $files"
fi
files=`find $TMP/usr/doc -type d 2>/dev/null | tr "\n" " "` || true
if [ "$files" ]; then
doit "chmod 755 $files"
fi
# Executable man pages are a bad thing..
files=`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null | tr "\n" " "` || true
if [ "$files" ]; then
doit "chmod 644 $files"
fi
# ..and so are executable shared libraries (and .la files from libtool)
files=`find $TMP -perm -5 -type f \( -name "*.so*" -or -name "*.la" \) | tr "\n" " "` || true
if [ "$files" ]; then
doit "chmod a-X $files"
fi
done
|