man-page-installation-20051221
[openafs.git] / doc / man-pages / install-man.in
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
8 set -e
9
10 manpage="$1"
11 dest="$2"
12
13 install=@TOP_OBJDIR@/src/pinstall/pinstall
14
15 # We have to include all of the variables here since several of them refer to
16 # each other and this is the only way we get them all expanded.
17 prefix=@prefix@
18 exec_prefix=@exec_prefix@
19 bindir=@bindir@
20 includedir=@includedir@
21 libdir=@libdir@
22 libexecdir=@libexecdir@
23 localstatedir=@localstatedir@
24 mandir=@mandir@
25 sbindir=@sbindir@
26 sysconfdir=@sysconfdir@
27 afsbackupdir=@afsbackupdir@
28 afsbosconfigdir=@afsbosconfigdir@
29 afsconfdir=@afsconfdir@
30 afsdbdir=@afsdbdir@
31 afslocaldir=@afslocaldir@
32 afslogsdir=@afslogsdir@
33 afssrvbindir=@afssrvbindir@
34 afskerneldir=@afskerneldir@
35 afssrvlibexecdir=@afssrvlibexecdir@
36 afssrvsbindir=@afssrvsbindir@
37 viceetcdir=@viceetcdir@
38
39 # Substitute the paths into a local temporary file and then install it with
40 # $install.
41 sed -e "s%/usr/afs/local/BosConfig%${afsbosconfigdir}/BosConfig%g" \
42     -e "s%/usr/afs/etc%${afsconfdir}%g" \
43     -e "s%/usr/afs/backup%${afsbackupdir}%g" \
44     -e "s%/usr/afs/bin%${afssrvlibexecdir}%g" \
45     -e "s%/usr/afs/db%${afsdbdir}%g" \
46     -e "s%/usr/afs/local%${afslocaldir}%g" \
47     -e "s%/usr/afs/logs%${afslogsdir}%g" \
48     -e "s%/usr/vice/etc%${viceetcdir}%g" "$manpage" > "$manpage".tmp
49 $install -c -f -m 0644 "$manpage".tmp "$dest"
50 rm "$manpage".tmp