File: instman.sh

package info (click to toggle)
di 6.2.2.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 896 kB
  • sloc: ansic: 9,364; sh: 5,211; perl: 1,749; awk: 463; makefile: 398
file content (51 lines) | stat: -rwxr-xr-x 916 bytes parent folder | download | duplicates (2)
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
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh

prefix=$1
mandir=$2
grc=0

if [ "x${prefix}" = x ]; then
  echo "prefix is not set"
  exit 1
fi

if [ "x${mandir}" = x ]; then
  echo "mandir is not set"
  exit 1
fi

systype=`uname -s`
case ${systype} in
  NetBSD)
    # netbsd uses /usr/pkg/man
    mandir="${prefix}/man"
    ;;
  OpenBSD)
    # openbsd cmake puts the man pages at the top level.
    # match what cmake does.
    # I don't know why there is a mis-match between cmake and where
    # the os puts the system manual pages.
    mandir="${prefix}/man"
    ;;
esac

instmandir="${mandir}"
if [ ! "x${DESTDIR}" = x ]; then
  instmandir="${DESTDIR}/${mandir}"
fi

test -d ${instmandir}/man1 || mkdir -p ${instmandir}/man1
cp -f man/di.1 ${instmandir}/man1/
rc=$?
if [ $rc -ne 0 ]; then
  grc=1
fi

test -d ${instmandir}/man3 || mkdir -p ${instmandir}/man3
cp -f man/libdi.3 ${instmandir}/man3/
rc=$?
if [ $rc -ne 0 ]; then
  grc=1
fi

exit $grc