vos-addsite-pod-error-20080220
[openafs.git] / src / packaging / Debian / doc / build-man
1 #!/bin/sh
2 #
3 # Install man pages, 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
7 set -e
8
9 manpage="$1"
10 dest="$2"
11
12 afsbackupdir=/var/lib/openafs/backup
13 afsbosconfigdir=/etc/openafs
14 afsconfdir=/etc/openafs/server
15 afsdbdir=/var/lib/openafs/db
16 afslocaldir=/etc/openafs/server-local
17 afslogsdir=/var/log/openafs
18 afssrvlibexecdir=/usr/lib/openafs
19 viceetcdir=/etc/openafs
20
21 # Build a particular man page.  Takes the section title, the section number,
22 # the filename of the POD page, and the output file.
23 buildpage () {
24     pod2man -c "$1" -r OpenAFS -s "$2" "$3" | \
25         sed -e "s%/usr/afs/local/BosConfig%${afsbosconfigdir}/BosConfig%g" \
26             -e "s%/usr/afs/etc%${afsconfdir}%g" \
27             -e "s%/usr/afs/backup%${afsbackupdir}%g" \
28             -e "s%/usr/afs/bin%${afssrvlibexecdir}%g" \
29             -e "s%/usr/afs/db%${afsdbdir}%g" \
30             -e "s%/usr/afs/local%${afslocaldir}%g" \
31             -e "s%/usr/afs/logs%${afslogsdir}%g" \
32             -e "s%/usr/vice/etc%${viceetcdir}%g" > "$4"
33 }
34
35 # Create the output directories.
36 mkdir -p man1 man5 man8
37
38 # Do the work with lots of calls to buildpage.
39 cd pod1
40 for f in *.pod ; do
41     buildpage 'AFS Command Reference' 1 "$f" \
42         ../man1/`echo "$f" | sed 's/\.pod$//'`.1
43 done
44 cd ..
45 cd pod5
46 for f in *.pod ; do
47     buildpage 'AFS File Reference' 5 "$f" \
48         ../man5/`echo "$f" | sed 's/\.pod$//'`.5
49 done
50 cd ..
51 cd pod8
52 for f in *.pod ; do
53     buildpage 'AFS Command Reference' 8 "$f" \
54         ../man8/`echo "$f" | sed 's/\.pod$//'`.8
55 done
56 cd ..