File: generate-man

package info (click to toggle)
openafs 1.8.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 42,632 kB
  • sloc: ansic: 455,142; xml: 66,853; perl: 11,960; makefile: 9,982; sh: 7,851; objc: 6,430; java: 5,638; cpp: 2,268; asm: 1,214; yacc: 441; tcl: 249; lex: 201; csh: 85
file content (77 lines) | stat: -rwxr-xr-x 2,255 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
#
# Generate the OpenAFS man pages from POD source.  This script is normally
# invoked by regen.sh but may be run at any time to rebuild all of the man
# pages (with a newer version of pod2man than was used for the release, for
# instance).

# Exit on any error.
set -e

if [ ! -d pod1 ] ; then
    echo 'generate-man must be run from the doc/man-pages directory' >&2
    exit 1
fi

if pod2man pod1/afs.pod > /dev/null ; then
    :
else
    echo 'pod2man not found, skipping man page generation' >&2
    exit 1
fi
if perl -e 'use Pod::Man 2.04' > /dev/null 2>&1 ; then
    :
else
    echo 'Pod::Man is older than the recommended version of 2.04 or later' >&2
    echo 'Continuing with man page generation anyway' >&2
fi

# Create the directories.  We generate each section into its own directory
# to make installation rules easier.
[ -d man1 ] || mkdir man1
[ -d man3 ] || mkdir man3
[ -d man5 ] || mkdir man5
[ -d man8 ] || mkdir man8

# Generate each set of man pages.  For each, allow for the case of the
# directory being empty.  In that case, for won't expand the wildcard, and
# we want to avoid running pod2man with a wildcard as an argument.
pod1=`ls pod1`
if [ -n "$pod1" ] ; then
    cd pod1
    for f in *.pod ; do
        pod2man -c 'AFS Command Reference' -r 'OpenAFS' -s 1 "$f" \
            > ../man1/`echo "$f" | sed 's/\.pod$//'`.1
    done
    cd ..
fi
pod3=`ls pod3`
if [ -n "$pod3" ] ; then
    cd pod3
    for f in *.pod ; do
        pod2man -c 'AFS Library Reference' -r 'OpenAFS' -s 3 "$f" \
            > ../man3/`echo "$f" | sed -e 's/\.pod$//' -e 's/^AFS\./AFS::/'`.3
	# Perl module manpages are named AFS.foo instead of AFS::foo, since
	# we cannot have colons in filenames on Windows. So here, we assume
	# anything with "AFS." should be "AFS::" instead.
    done
    cd ..
fi
pod5=`ls pod5`
if [ -n "$pod5" ] ; then
    cd pod5
    for f in *.pod ; do
        pod2man -c 'AFS File Reference' -r 'OpenAFS' -s 5 "$f" \
            > ../man5/`echo "$f" | sed 's/\.pod$//'`.5
    done
    cd ..
fi
pod8=`ls pod8`
if [ -n "$pod8" ] ; then
    cd pod8
    for f in *.pod ; do
        pod2man -c 'AFS Command Reference' -r 'OpenAFS' -s 8 "$f" \
            > ../man8/`echo "$f" | sed 's/\.pod$//'`.8
    done
    cd ..
fi