|
11 | 11 | # The html.parser is used as a state machine that both tweaks the html and
|
12 | 12 | # outputs the nroff data based on the html tags.
|
13 | 13 | #
|
| 14 | +# We normally grab the prefix from the generated Makefile, which is then used |
| 15 | +# in the various other grabbed values (see the Makefile for its ${prefix} |
| 16 | +# paths). However, the maintainer can choose to override this prefix by |
| 17 | +# exporting RSYNC_OVERRIDE_PREFIX=/usr. This allows the man pages to refer to |
| 18 | +# /usr paths (and are thus compatible with the release-rsync script) while |
| 19 | +# still having the built rsync get installed into /usr/local for local testing. |
| 20 | +# |
14 | 21 | # Copyright (C) 2020 Wayne Davison
|
15 | 22 | #
|
16 | 23 | # This program is freely redistributable.
|
@@ -58,6 +65,7 @@ HTML_END = """\
|
58 | 65 |
|
59 | 66 | MAN_START = r"""
|
60 | 67 | .TH "%s" "%s" "%s" "%s" "User Commands"
|
| 68 | +.\" prefix=%s |
61 | 69 | """.lstrip()
|
62 | 70 |
|
63 | 71 | MAN_END = """\
|
@@ -91,7 +99,8 @@ def main():
|
91 | 99 |
|
92 | 100 | if args.test:
|
93 | 101 | env_subs['VERSION'] = '1.0.0'
|
94 |
| - env_subs['libdir'] = '/usr' |
| 102 | + env_subs['bindir'] = '/usr/bin' |
| 103 | + env_subs['libdir'] = '/usr/lib/rsync' |
95 | 104 | else:
|
96 | 105 | for fn in (fi.srcdir + 'version.h', 'Makefile'):
|
97 | 106 | try:
|
@@ -124,13 +133,14 @@ def main():
|
124 | 133 | txt = fh.read()
|
125 | 134 |
|
126 | 135 | txt = re.sub(r'@VERSION@', env_subs['VERSION'], txt)
|
| 136 | + txt = re.sub(r'@BINDIR@', env_subs['bindir'], txt) |
127 | 137 | txt = re.sub(r'@LIBDIR@', env_subs['libdir'], txt)
|
128 | 138 |
|
129 | 139 | fi.html_in = md_parser(txt)
|
130 | 140 | txt = None
|
131 | 141 |
|
132 | 142 | fi.date = time.strftime('%d %b %Y', time.localtime(fi.mtime))
|
133 |
| - fi.man_headings = (fi.prog, fi.sect, fi.date, fi.prog + ' ' + env_subs['VERSION']) |
| 143 | + fi.man_headings = (fi.prog, fi.sect, fi.date, fi.prog + ' ' + env_subs['VERSION'], env_subs['prefix']) |
134 | 144 |
|
135 | 145 | HtmlToManPage(fi)
|
136 | 146 |
|
|
0 commit comments