Commit | Line | Data |
---|---|---|
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 | ||
8 | set -e | |
9 | ||
10 | manpage="$1" | |
11 | dest="$2" | |
12 | ||
13 | INSTALL="@INSTALL@" | |
14 | install="@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. | |
18 | prefix=@prefix@ | |
19 | exec_prefix=@exec_prefix@ | |
20 | datarootdir=@datarootdir@ | |
21 | bindir=@bindir@ | |
22 | includedir=@includedir@ | |
23 | libdir=@libdir@ | |
24 | libexecdir=@libexecdir@ | |
25 | localstatedir=@localstatedir@ | |
26 | mandir=@mandir@ | |
27 | sbindir=@sbindir@ | |
28 | sysconfdir=@sysconfdir@ | |
29 | afsbackupdir=@afsbackupdir@ | |
30 | afsbosconfigdir=@afsbosconfigdir@ | |
31 | afsconfdir=@afsconfdir@ | |
32 | afsdbdir=@afsdbdir@ | |
33 | afslocaldir=@afslocaldir@ | |
34 | afslogsdir=@afslogsdir@ | |
35 | afssrvbindir=@afssrvbindir@ | |
36 | afskerneldir=@afskerneldir@ | |
37 | afssrvlibexecdir=@afssrvlibexecdir@ | |
38 | afssrvsbindir=@afssrvsbindir@ | |
39 | viceetcdir=@viceetcdir@ | |
40 | ||
41 | # Substitute the paths into a local temporary file and then install it with | |
42 | # $install. | |
43 | sed -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" | |
52 | rm "$manpage".tmp |