Debian Codegraph @

tools/install_man

raw
1 #!/bin/sh
2
3 TOOLDIR=$1
4 PREFIX=$2
5 PAGE=$3
6 SECT=$4
7
8 if [ "x$TOOLDIR" = "x" ] ; then
9 echo "$0: no tool directory specified (for mkinstalldirs)"
10 exit 1
11 fi
12
13 if [ "x$PREFIX" = "x" ] ; then
14 echo "$0: no prefix supplied"
15 exit 1
16 fi
17
18 if [ "x$PAGE" = "x" ] ; then
19 echo "$0: no manpage specified"
20 exit 1
21 fi
22
23 if [ "x$SECT" = "x" ] ; then
24 SECT=1
25 fi
26
27 if [ -d $PREFIX/man ] ; then
28 echo "Installing $PAGE in $PREFIX/man/man$SECT"
29 $TOOLDIR/mkinstalldirs $PREFIX/man/man$SECT
30 install -m 644 $PAGE $PREFIX/man/man$SECT
31 exit 0
32 else
33 echo "Installing $PAGE in $PREFIX/share/man/man$SECT"
34 $TOOLDIR/mkinstalldirs $PREFIX/share/man/man$SECT
35 install -m 644 $PAGE $PREFIX/share/man/man$SECT
36 exit 0
37 fi
38
39