3 # If no parameters are given, and no debian/suid files exists, scan for
4 # suid/sgid files and suidregister them.
6 # If there are parameters, or there is a debian/suid, register the files
9 PATH=debian:$PATH:/usr/lib/debhelper
12 for PACKAGE in $DH_DOPACKAGES; do
18 if [ -e debian/${EXT}suid ]; then
19 files=`tr "\n" " " < debian/${EXT}suid`
22 if [ "$PACKAGE" = "$MAINPACKAGE" -a "$*" ]; then
26 if [ ! "$files" -a ! -e debian/${EXT}suid ]; then
27 # No files specified (and no empty debian/suid file), so
28 # guess what files to process.
29 files=`find debian/$TMP -type f -perm +6000`
31 # We will strip the debian working directory off of the
33 tostrip="debian/$TMP/"
35 # We will strip leading /'s, so the user can feed this
36 # program either absolute filenames, or relative filenames,
37 # and it will do the right thing either way.
42 for file in $files; do
43 # Strip leading $tostrip from $file. If not there,
44 # leave $file untouched.
45 if [ `expr "$file" : "$tostrip\\(.*\\)"` ]; then
46 file=`expr "$file" : "$tostrip\\(.*\\)"`
49 # Create the sed string that will be used to
50 # fill in the blanks in the autoscript files.
51 # Fill with the owner, group, and perms of the file.
52 sedstr=`find debian/$TMP/$file -printf "s:#FILE#:$file:;s/#PACKAGE#/$PACKAGE/;s/#OWNER#/%u/;s/#GROUP#/%g/;s/#PERMS#/%m/"`
54 autoscript "postinst" "postinst-suid" "$sedstr"
55 autoscript "postrm" "postrm-suid" "$sedstr"