3 # Do some general file permission fixups.
5 PATH=debian:$PATH:/usr/lib/debhelper
8 for PACKAGE in $DH_DOPACKAGES; do
11 # General permissions fixing.
12 if [ ! "$DH_EXCLUDE_FIND" ]; then
13 # It's much faster to do it this way, but we can only do
14 # this if there is nothing to exclude.
16 doit "chown -R root.root $TMP"
17 doit "chmod -R go=rX $TMP"
18 doit "chmod -R u+rw $TMP"
24 complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \
25 2>/dev/null | xargs -0r chown root.root"
26 complex_doit "find $TMP ! \($DH_EXCLUDE_FIND \) -print0 \
27 2>/dev/null | xargs -0r chmod go=rX"
28 complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \
29 2>/dev/null | xargs -0r chmod u+rw"
31 FIND_OPTIONS="! \( $DH_EXCLUDE_FIND \)"
34 # Fix up premissions in usr/doc, setting everything to not exectable
35 # by default, but leave examples directories alone.
36 complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS -print0 \
37 2>/dev/null | xargs -0r chmod 644"
38 complex_doit "find $TMP/usr/doc -type d $FIND_OPTIONS -print0 \
39 2>/dev/null | xargs -0r chmod 755"
41 # Executable man pages are a bad thing..
42 complex_doit "find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f \
43 $FIND_OPTIONS -print0 2>/dev/null | xargs -0r chmod 644"
45 # ..and so are executable shared libraries (and .la files from libtool)
46 complex_doit "find $TMP -perm -5 -type f \
47 \( -name "*.so*" -or -name "*.la" \) $FIND_OPTIONS -print0 \
48 2>/dev/null | xargs -0r chmod a-X"