chiark / gitweb /
wip manpage
[inn-innduct.git] / doc / man / putman.sh
1 #! /bin/sh
2 ##  $Revision: 2790 $
3 ##
4 ##  Prepare a manpage for installation, and install it.  Usage:
5 ##      putman <style> "<installitflags>" <source> <dest-dir>
6 case $# in
7 4)
8     ;;
9 *)
10     echo "Can't install manpage:  wrong number of arguments." 1>&2
11 esac
12
13 STYLE="$1"
14 FLAGS="$2"
15 SRC="$3"
16 DEST="$4"
17
18 case "X${STYLE}" in
19 XNONE)
20     exit 0
21     ;;
22 XSOURCE)
23     exec /bin/sh ../../support/install-sh ${FLAGS} ${SRC} ${DEST}
24     ;;
25 XNROFF-PACK)
26     T=${TMPDIR-/tmp}/man$$
27     nroff -man ${SRC} >$T
28     /bin/sh ../../support/install-sh ${FLAGS} $T ${DEST} && pack ${DEST}
29     rm -f $T
30     exit
31     ;;
32 XNROFF-PACK-SCO)
33     T=${TMPDIR-/tmp}/man$$
34     nroff -man ${SRC} >$T
35     DEST2=`echo ${DEST} | sed -e 's/\..$/.INN/'`
36     /bin/sh ../../support/install-sh ${FLAGS} $T ${DEST2} && pack ${DEST2}
37     rm -f $T
38     exit
39     ;;
40 XBSD4.4)
41     T=${TMPDIR-/tmp}/man$$
42     nroff -man ${SRC} >$T
43     DEST2=`echo ${DEST} | sed -e 's/\..$/.0/'`
44     /bin/sh ../../support/install-sh ${FLAGS} $T ${DEST2}
45     rm -f $T
46     exit
47     ;;
48 esac
49
50 echo "Can't install manpage:  unknown method ${STYLE}." 1>&2
51 exit 1