3 # Do some general file permission fixups.
5 use Debian::Debhelper::Dh_Lib;
8 foreach $PACKAGE (@{$dh{DOPACKAGES}}) {
11 if (! defined($dh{EXCLUDE_FIND}) || $dh{EXCLUDE_FIND} eq '') {
15 $find_options="! \\( $dh{EXCLUDE_FIND} \\)";
18 # General permissions fixing.
19 complex_doit("find $TMP $find_options -print0",
20 "2>/dev/null | xargs -0r chown --no-dereference 0.0");
21 complex_doit("find $TMP ! -type l $find_options -print0",
22 "2>/dev/null | xargs -0r chmod go=rX,u+rw,a-s");
25 # Fix up premissions in usr/share/doc, setting everything to not
26 # executable by default, but leave examples directories alone.
27 complex_doit("find $TMP/usr/share/doc $TMP/usr/doc -type f $find_options ! -regex '.*/examples/.*' -print0",
28 "2>/dev/null | xargs -0r chmod 644");
29 complex_doit("find $TMP/usr/share/doc $TMP/usr/doc -type d $find_options -print0",
30 "2>/dev/null | xargs -0r chmod 755");
32 # Executable man pages are a bad thing..
33 complex_doit("find $TMP/usr/share/man $TMP/usr/man/ $TMP/usr/X11*/man/ -type f",
34 "$find_options -print0 2>/dev/null | xargs -0r chmod 644");
36 # ..and so are executable shared and static libraries
37 # (and .la files from libtool)
38 complex_doit("find $TMP -perm -5 -type f",
39 "\\( -name '*.so*' -or -name '*.la' -or -name '*.a' \\) $find_options -print0",
40 "2>/dev/null | xargs -0r chmod a-X");