File: install_man

package info (click to toggle)
gretl 2016d-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 48,620 kB
  • ctags: 22,779
  • sloc: ansic: 345,830; sh: 4,648; makefile: 2,712; xml: 570; perl: 364
file content (39 lines) | stat: -rwxr-xr-x 722 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

TOOLDIR=$1
PREFIX=$2
PAGE=$3
SECT=$4

if [ "x$TOOLDIR" = "x" ] ; then
   echo "$0: no tool directory specified (for mkinstalldirs)"
   exit 1
fi

if [ "x$PREFIX" = "x" ] ; then
   echo "$0: no prefix supplied"
   exit 1
fi

if [ "x$PAGE" = "x" ] ; then
   echo "$0: no manpage specified"
   exit 1
fi

if [ "x$SECT" = "x" ] ; then
   SECT=1
fi

if [ -d $PREFIX/man ] ; then
   echo "Installing $PAGE in $PREFIX/man/man$SECT"
   $TOOLDIR/mkinstalldirs $PREFIX/man/man$SECT
   install -m 644 $PAGE $PREFIX/man/man$SECT
   exit 0
else
   echo "Installing $PAGE in $PREFIX/share/man/man$SECT"
   $TOOLDIR/mkinstalldirs $PREFIX/share/man/man$SECT
   install -m 644 $PAGE $PREFIX/share/man/man$SECT
   exit 0
fi