4 ext
="" mandir
=/usr
/local/man srcdir
=. inst
=install mode
=644
8 echo "$0: [-e EXT] [-d DIR] [-i INSTALL] [-m MODE] [un]install FILE ..."
11 -e
) ext
=$2; shift 2 ;;
12 -d
) mandir
=$2; shift 2 ;;
13 -i
) inst
=$2; shift 2 ;;
14 -m
) mode
=$2; shift 2 ;;
15 -s
) srcdir
=$2; shift 2 ;;
17 -*) echo >&2 "$0: unknown option \`$1'"; exit 1 ;;
23 install | uninstall
) ;;
24 *) echo >&2 "$0: unknown operation \`$1'"; exit 1 ;;
27 base
=${i##*/} sec
=${base##*.}
30 echo -n
" Installing manpage $base$ext"
31 $inst -d
"$mandir/man$sec"
32 $inst -m
$mode "$srcdir/$i" "$mandir/man$sec/$base$ext"
35 rm -f
"$mandir/man$sec/$base$ext"
38 for l
in `sed 's:^\.\\\" *@::p; d' "$srcdir/$i"`; do
41 if [ "$l.$sec" != "$base" ]; then
43 echo ".so man$sec/$base$ext" >"$mandir/man$sec/$l.$sec$ext"
44 chmod $mode "$mandir/man$sec/$l.$sec$ext"
48 rm -f
"$mandir/man$sec/$l.$sec$ext"