Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / doc / man-pages / install-man.in
CommitLineData
805e021f
CE
1#!/bin/sh
2#
3# Install a man page, but fixing up paths as we go. All of the man pages
4# are written to use the Transarc paths, and this script fixes those paths to
5# be correct for the chosen configure options as the man pages are installed.
6# Takes the source man page file and the destination path as arguments.
7
8set -e
9
10manpage="$1"
11dest="$2"
12
13INSTALL="@INSTALL@"
14install="@INSTALL_DATA@"
15
16# We have to include all of the variables here since several of them refer to
17# each other and this is the only way we get them all expanded.
18prefix=@prefix@
19exec_prefix=@exec_prefix@
20datarootdir=@datarootdir@
21bindir=@bindir@
22includedir=@includedir@
23libdir=@libdir@
24libexecdir=@libexecdir@
25localstatedir=@localstatedir@
26mandir=@mandir@
27sbindir=@sbindir@
28sysconfdir=@sysconfdir@
29afsbackupdir=@afsbackupdir@
30afsbosconfigdir=@afsbosconfigdir@
31afsconfdir=@afsconfdir@
32afsdbdir=@afsdbdir@
33afslocaldir=@afslocaldir@
34afslogsdir=@afslogsdir@
35afssrvbindir=@afssrvbindir@
36afskerneldir=@afskerneldir@
37afssrvlibexecdir=@afssrvlibexecdir@
38afssrvsbindir=@afssrvsbindir@
39viceetcdir=@viceetcdir@
40
41# Substitute the paths into a local temporary file and then install it with
42# $install.
43sed -e "s%/usr/afs/local/BosConfig%${afsbosconfigdir}/BosConfig%g" \
44 -e "s%/usr/afs/etc%${afsconfdir}%g" \
45 -e "s%/usr/afs/backup%${afsbackupdir}%g" \
46 -e "s%/usr/afs/bin%${afssrvlibexecdir}%g" \
47 -e "s%/usr/afs/db%${afsdbdir}%g" \
48 -e "s%/usr/afs/local%${afslocaldir}%g" \
49 -e "s%/usr/afs/logs%${afslogsdir}%g" \
50 -e "s%/usr/vice/etc%${viceetcdir}%g" "$manpage" > "$manpage".tmp
51$install "$manpage".tmp "$dest"
52rm "$manpage".tmp