3 # Generate the OpenAFS man pages from POD source. This script is normally
4 # invoked by regen.sh but may be run at any time to rebuild all of the man
5 # pages (with a newer version of pod2man than was used for the release, for
11 if [ ! -d pod1 ] ; then
12 echo 'generate-man must be run from the doc/man-pages directory' >&2
16 if pod2man pod1/afs.pod > /dev/null ; then
19 echo 'pod2man not found, skipping man page generation' >&2
22 if perl -e 'use Pod::Man 2.04' > /dev/null 2>&1 ; then
25 echo 'Pod::Man is older than the recommended version of 2.04 or later' >&2
26 echo 'Continuing with man page generation anyway' >&2
29 # Create the directories. We generate each section into its own directory
30 # to make installation rules easier.
31 [ -d man1 ] || mkdir man1
32 [ -d man5 ] || mkdir man5
33 [ -d man8 ] || mkdir man8
35 # Generate each set of man pages. For each, allow for the case of the
36 # directory being empty. In that case, for won't expand the wildcard, and
37 # we want to avoid running pod2man with a wildcard as an argument.
39 if [ -n "$pod1" ] ; then
42 pod2man -c 'AFS Command Reference' -r 'OpenAFS' -s 1 "$f" \
43 > ../man1/`echo "$f" | sed 's/\.pod$//'`.1
48 if [ -n "$pod5" ] ; then
51 pod2man -c 'AFS File Reference' -r 'OpenAFS' -s 5 "$f" \
52 > ../man5/`echo "$f" | sed 's/\.pod$//'`.5
57 if [ -n "$pod8" ] ; then
60 pod2man -c 'AFS Command Reference' -r 'OpenAFS' -s 8 "$f" \
61 > ../man8/`echo "$f" | sed 's/\.pod$//'`.8