shithub: choc

Download patch

ref: e0b8a7e0a9e0ee8c5983b94b849a8a69a5592464
parent: 16ae1b6ced98eb72cf6c827e6ec2fb639b33716e
author: Jonathan Dowland <[email protected]>
date: Mon Nov 27 16:17:55 EST 2017

overhaul manpages, add parameters

This is in order to better support derivative engines.

Rework the manpages to be parameterized with @PROGRAM_PREFIX@ and
@PACKAGE_NAME@. Alter the `docgen` generator to substitute those
parameters. Supply those parameters via the autofoo Makefile.

Adjust the fixed path chocolate-server.6 to be generated from
server.template, similar to doom.template -> chocolate-doom.6.

Further work is required, not least renaming chocolate-setup.6,
but several further parameterizations.

--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -29,7 +29,8 @@
            @[email protected]    \
            @[email protected]       \
            strife.cfg.5             \
-           @[email protected]
+           @[email protected]   \
+           @[email protected]
 
 SETUP_MAN_PAGES =                          \
            @[email protected]    \
@@ -37,8 +38,7 @@
            @[email protected]   \
            @[email protected]
 
-man_MANS = chocolate-server.6             \
-           chocolate-setup.6              \
+man_MANS = chocolate-setup.6              \
            $(GENERATED_MAN_PAGES)         \
            $(SETUP_MAN_PAGES)
 
@@ -51,24 +51,29 @@
              $(doomdocs_DATA) $(hereticdocs_DATA) \
              $(hexendocs_DATA) $(strifedocs_DATA)
 DOCGEN = $(srcdir)/docgen
+DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@"
 
 $(SETUP_MAN_PAGES): chocolate-setup.6
 	cp $(srcdir)/chocolate-setup.6 $@
 
 @[email protected]: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
-	$(DOCGEN) -g doom -m $(srcdir)/doom.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g doom -m $(srcdir)/doom.template \
                   $(top_srcdir)/src $(top_srcdir)/src/doom > $@
 
 default.cfg.5: $(top_srcdir)/src $(srcdir)/default.cfg.template
-	$(DOCGEN) -g doom -m $(srcdir)/default.cfg.template \
-                 -c default $(top_srcdir)/src/m_config.c > $@
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g doom -m $(srcdir)/default.cfg.template \
+                  -c default $(top_srcdir)/src/m_config.c > $@
 
 @[email protected]: $(top_srcdir)/src extra.cfg.template
-	$(DOCGEN) -g doom -m $(srcdir)/extra.cfg.template \
-                 -c extended $(top_srcdir)/src/m_config.c > $@
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g doom -m $(srcdir)/extra.cfg.template \
+                  -c extended $(top_srcdir)/src/m_config.c > $@
 
 CMDLINE.doom : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/doom
-	$(DOCGEN) -p $(srcdir)/CMDLINE.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -p $(srcdir)/CMDLINE.template \
                   $(top_srcdir)/src/ $(top_srcdir)/src/doom/ > $@
 
 INSTALL.doom: INSTALL.template
@@ -76,19 +81,23 @@
 
 
 @[email protected]: $(top_srcdir)/src $(MANPAGE_GEN_FILES) heretic.template
-	$(DOCGEN) -g heretic -m $(srcdir)/heretic.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                 -g heretic -m $(srcdir)/heretic.template \
                   $(top_srcdir)/src $(top_srcdir)/src/heretic > $@
 
 heretic.cfg.5: $(top_srcdir)/src $(srcdir)/default.cfg.template
-	$(DOCGEN) -g heretic -m $(srcdir)/default.cfg.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                 -g heretic -m $(srcdir)/default.cfg.template \
                   -c default $(top_srcdir)/src/m_config.c > $@
 
 @[email protected]: $(top_srcdir)/src extra.cfg.template
-	$(DOCGEN) -g heretic -m $(srcdir)/extra.cfg.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                 -g heretic -m $(srcdir)/extra.cfg.template \
                  -c extended $(top_srcdir)/src/m_config.c > $@
 
 CMDLINE.heretic : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/heretic
-	$(DOCGEN) -p $(srcdir)/CMDLINE.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                 -p $(srcdir)/CMDLINE.template \
                   $(top_srcdir)/src/ $(top_srcdir)/src/heretic/ > $@
 
 INSTALL.heretic: INSTALL.template
@@ -96,19 +105,23 @@
 
 
 @[email protected]: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
-	$(DOCGEN) -g hexen -m $(srcdir)/hexen.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                 -g hexen -m $(srcdir)/hexen.template \
                   $(top_srcdir)/src $(top_srcdir)/src/hexen > $@
 
 hexen.cfg.5: $(top_srcdir)/src default.cfg.template
-	$(DOCGEN) -g hexen -m $(srcdir)/default.cfg.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                 -g hexen -m $(srcdir)/default.cfg.template \
                  -c default $(top_srcdir)/src/m_config.c > $@
 
 @[email protected]: $(top_srcdir)/src extra.cfg.template
-	$(DOCGEN) -g hexen -m $(srcdir)/extra.cfg.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                 -g hexen -m $(srcdir)/extra.cfg.template \
                  -c extended $(top_srcdir)/src/m_config.c > $@
 
 CMDLINE.hexen : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/hexen
-	$(DOCGEN) -p $(srcdir)/CMDLINE.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -p $(srcdir)/CMDLINE.template \
                   $(top_srcdir)/src/ $(top_srcdir)/src/hexen/ > $@
 
 INSTALL.hexen: INSTALL.template
@@ -116,19 +129,28 @@
 
 
 @[email protected]: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
-	$(DOCGEN) -g strife -m $(srcdir)/strife.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g strife -m $(srcdir)/strife.template \
                   $(top_srcdir)/src $(top_srcdir)/src/strife > $@
 
+@[email protected]: $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g server -m $(srcdir)/server.template \
+                  $(top_srcdir)/src > $@
+
 strife.cfg.5: $(top_srcdir)/src default.cfg.template
-	$(DOCGEN) -g strife -m $(srcdir)/default.cfg.template \
-                 -c default $(top_srcdir)/src/m_config.c > $@
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g strife -m $(srcdir)/default.cfg.template \
+                  -c default $(top_srcdir)/src/m_config.c > $@
 
 @[email protected]: $(top_srcdir)/src extra.cfg.template
-	$(DOCGEN) -g strife -m $(srcdir)/extra.cfg.template \
-                 -c extended $(top_srcdir)/src/m_config.c > $@
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g strife -m $(srcdir)/extra.cfg.template \
+                  -c extended $(top_srcdir)/src/m_config.c > $@
 
 CMDLINE.strife : CMDLINE.template $(top_srcdir)/src $(top_srcdir)/src/strife
-	$(DOCGEN) -p $(srcdir)/CMDLINE.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -p $(srcdir)/CMDLINE.template \
                   $(top_srcdir)/src/ $(top_srcdir)/src/strife/ > $@
 
 INSTALL.strife: INSTALL.template
--- a/man/bash-completion/Makefile.am
+++ b/man/bash-completion/Makefile.am
@@ -19,21 +19,26 @@
 
 MANDIR = $(top_srcdir)/man
 DOCGEN = $(MANDIR)/docgen
+DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@"
 
 @PROGRAM_PREFIX@doom: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
-	$(DOCGEN) -g doom -b $(MANDIR)/doom.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g doom -b $(MANDIR)/doom.template \
                   $(top_srcdir)/src $(top_srcdir)/src/doom > $@
 
 @PROGRAM_PREFIX@heretic: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
-	$(DOCGEN) -g heretic -b $(MANDIR)/heretic.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g heretic -b $(MANDIR)/heretic.template \
                   $(top_srcdir)/src $(top_srcdir)/src/heretic > $@
 
 @PROGRAM_PREFIX@hexen: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
-	$(DOCGEN) -g hexen -b $(MANDIR)/hexen.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g hexen -b $(MANDIR)/hexen.template \
                   $(top_srcdir)/src $(top_srcdir)/src/hexen > $@
 
 @PROGRAM_PREFIX@strife: $(top_srcdir)/src $(DOCGEN) $(BASH_COMPLETION_TEMPLATES)
-	$(DOCGEN) -g strife -b $(MANDIR)/strife.template \
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g strife -b $(MANDIR)/strife.template \
                   $(top_srcdir)/src $(top_srcdir)/src/strife > $@
 
 EXTRA_DIST = \
--- a/man/chocolate-server.6
+++ /dev/null
@@ -1,52 +1,0 @@
-.TH chocolate\-server 6
-.SH NAME
-chocolate\-server \- dedicated server for chocolate\-doom
-.SH SYNOPSIS
-.B chocolate\-server
-[OPTIONS]
-.SH DESCRIPTION
-.PP
-Chocolate Doom is a modern doom engine designed to behave
-as similar to the original doom game as is possible.
-.PP
-.B chocolate\-server
-is a dedicated server for Chocolate Doom. It is equivalent to 
-running 
-.B chocolate\-doom
-with the "\-dedicated" option.
-.PP
-Game options are not specified to the server, which merely acts to
-retransmit data between players in the game; parameters for the
-game should be specified by the first player to connect to the server,
-who is designated the controlling player.
-.br
-.SH OPTIONS
-.TP
-\fB-ignoreversion\fR
-Ignore version mismatches between the server and the client. Using this
-option may cause game desyncs to occur, or differences in protocol may
-mean the netgame will simply not function at all. 
-.TP
-\fB-port <n>\fR
-Use the specified UDP port for communications, instead of the default (2342). 
-.TP
-\fB-privateserver\fR
-Don't register with the global master server.
-.TP
-\fB-servername <name>\fR
-Specify a name for the server.
-.SH SEE ALSO
-\fBchocolate-doom\fR(6),
-\fBchocolate-setup\fR(6)
-.SH AUTHOR
-Chocolate Doom is written and maintained by Simon Howard.
-.PP
-This manual was written by Jon Dowland.
-.SH COPYRIGHT
-Copyright \(co id Software Inc.
-Copyright \(co 2005-8 Simon Howard.
-.br
-This is free software.  You may redistribute copies of it under the terms of
-the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
-There is NO WARRANTY, to the extent permitted by law.
-
--- a/man/chocolate-setup.6
+++ b/man/chocolate-setup.6
@@ -1,20 +1,20 @@
-.TH chocolate\-setup 6
+.TH @PROGRAM_SPREFIX@\-setup 6
 .SH NAME
-chocolate\-setup \- configuration tool for chocolate\-doom
+@PROGRAM_SPREFIX@\-setup \- configuration tool for @PROGRAM_SPREFIX@\-doom
 .SH SYNOPSIS
-.B chocolate\-setup
+.B @PROGRAM_SPREFIX@\-setup
 [OPTIONS]
 .SH DESCRIPTION
 .PP
-Chocolate Doom is a modern Doom engine designed to behave
+@PACKAGE_NAME@ is a modern Doom engine designed to behave
 as similar to the original Doom game as is possible.
 .PP
-.B chocolate\-setup
-is a tool for configuring Chocolate Doom. It provides a menu\-based
+.B @PROGRAM_SPREFIX@\-setup
+is a tool for configuring @PACKAGE_NAME@. It provides a menu\-based
 interface for the display, joystick, keyboard, mouse, sound and
 compatibility settings.
 .PP
-.B chocolate\-setup
+.B @PROGRAM_SPREFIX@\-setup
 can also be used to start and join network games.
 .PP
 .SH OPTIONS
@@ -23,15 +23,15 @@
 Load configuration from the specified file, instead of default.cfg. 
 .TP
 \fB-extraconfig <file>\fR
-Load extra configuration from the specified file, instead of chocolate-doom.cfg. 
+Load extra configuration from the specified file, instead of @PROGRAM_SPREFIX@\-doom.cfg. 
 .SH SEE ALSO
-\fBchocolate-doom\fR(6),
+\fB@CHOCOLATE_SPREFIX@\-doom\fR(6),
 \fBdefault.cfg\fR(5),
-\fBchocolate-doom.cfg\fR(5)
+\fB@CHOCOLATE_SPREFIX@\-doom.cfg\fR(5)
 .SH AUTHOR
 Chocolate Doom is written and maintained by Simon Howard.
 .PP
-This manual was written by Jon Dowland.
+This manual was written by Jonathan Dowland.
 .SH COPYRIGHT
 Copyright \(co id Software Inc.
 Copyright \(co 2005-8 Simon Howard.
--- a/man/default.cfg.template
+++ b/man/default.cfg.template
@@ -1,21 +1,21 @@
 .TH default.cfg 5
 .SH NAME
-default.cfg \- Chocolate Doom configuration file
+default.cfg \- @PACKAGE_NAME@ configuration file
 .SH DESCRIPTION
 .PP
 \fIdefault.cfg\fR
-is the configuration file for \fBchocolate-doom\fR(6).  The configuration
+is the configuration file for \fB@PROGRAM_SPREFIX@\-doom\fR(6).  The configuration
 options stored in the file are the same as those stored in the
 original DOS Vanilla Doom. 
-Extra Chocolate Doom-specific options are stored in a separate 
-configuration file, \fBchocolate-doom.cfg\fR.
+Extra @PACKAGE_NAME@-specific options are stored in a separate 
+configuration file, \fB@PROGRAM_SPREFIX@\-doom.cfg\fR.
 .PP
 \fIdefault.cfg\fR is normally stored in the user's home directory,
-as \fI~/.local/share/chocolate-doom/default.cfg\fR.  The path can be
+as \fI~/.local/share/@PROGRAM_SPREFIX@\-doom/default.cfg\fR.  The path can be
 overridden using the \fBXDG_DATA_HOME\fR environment variable (see the XDG
 Base Directory Specification).
 .PP
-The \fBchocolate-setup\fR(6) tool provides a simple to use front-end
+The \fB@PROGRAM_SPREFIX@\-setup\fR(6) tool provides a simple to use front-end
 for editing \fIdefault.cfg\fR.
 .br
 .SH FILE FORMAT
@@ -49,7 +49,7 @@
 @content
 
 .SH SEE ALSO
-\fBchocolate-doom\fR(6),
-\fBchocolate-doom.cfg\fR(5),
-\fBchocolate-setup\fR(6)
+\fB@PROGRAM_SPREFIX@\-doom\fR(6),
+\fB@PROGRAM_SPREFIX@\-doom.cfg\fR(5),
+\fB@PROGRAM_SPREFIX@\-setup\fR(6)
 
--- a/man/docgen
+++ b/man/docgen
@@ -430,7 +430,7 @@
 
         process_file(path)
 
-def print_template(template_file, content):
+def print_template(template_file, program_prefix, package_name, content):
     f = io.open(template_file, encoding='UTF-8')
 
     try:
@@ -440,14 +440,16 @@
                 filename = match.group(1)
                 filename = os.path.join(os.path.dirname(template_file),
                                         filename)
-                print_template(filename, content)
+                print_template(filename, program_prefix, package_name, content)
             else:
                 line = line.replace("@content", content)
+                line = line.replace("@PROGRAM_SPREFIX@", program_prefix)
+                line = line.replace("@PACKAGE_SHORTNAME@", package_name)
                 stdout(line.rstrip().encode('UTF-8') + b'\n')
     finally:
         f.close()
 
-def manpage_output(targets, template_file):
+def manpage_output(targets, program_prefix, package_name, template_file):
 
     content = ""
 
@@ -456,7 +458,7 @@
 
     content = content.replace("-", "\\-")
 
-    print_template(template_file, content)
+    print_template(template_file, program_prefix, package_name, content)
 
 def wiki_output(targets, template):
     read_wikipages()
@@ -464,7 +466,7 @@
     for t in targets:
         stdout(t.wiki_output().encode('UTF-8') + b'\n')
 
-def plaintext_output(targets, template_file):
+def plaintext_output(targets, program_prefix, package_name, template_file):
 
     content = ""
 
@@ -471,9 +473,9 @@
     for t in targets:
         content += t.plaintext_output() + "\n"
 
-    print_template(template_file, content)
+    print_template(template_file, program_prefix, package_name, content)
 
-def completion_output(targets, template_file):
+def completion_output(targets, program_prefix, package_name, template_file):
 
     content = ""
 
@@ -480,13 +482,15 @@
     for t in targets:
         content += t.completion_output() + "\n"
 
-    print_template(template_file, content)
+    print_template(template_file, program_prefix, package_name, content)
 
 def usage():
-    print("Usage: %s [-V] [-c tag] [-g game] ( -m | -w | -p ) <dir>..." \
+    print("Usage: %s [-V] [-c tag] [-g game] -n name ( -m | -w | -p ) <dir>..." \
             % sys.argv[0])
     print("   -c :  Provide documentation for the specified configuration file")
     print("         (matches the given tag name in the source file)")
+    print("   -s :  Package name (for substitution)")
+    print("   -n :  Program name (for substitution)")
     print("   -m :  Manpage output")
     print("   -w :  Wikitext output")
     print("   -p :  Plaintext output")
@@ -497,14 +501,20 @@
 
 # Parse command line
 
-opts, args = getopt.getopt(sys.argv[1:], "m:wp:b:c:g:V")
+opts, args = getopt.getopt(sys.argv[1:], "n:s:m:wp:b:c:g:V")
 
 output_function = None
 template = None
 doc_config_file = None
 match_game = None
+program_prefix = None
+package_name = None
 
 for opt in opts:
+    if opt[0] == "-n":
+        program_prefix = opt[1]
+    if opt[0] == "-s":
+        package_name = opt[1]
     if opt[0] == "-m":
         output_function = manpage_output
         template = opt[1]
@@ -546,5 +556,5 @@
 
     # Generate the output
 
-    output_function(documentation_targets, template)
+    output_function(documentation_targets, program_prefix, package_name, template)
 
--- a/man/doom.template
+++ b/man/doom.template
@@ -1,12 +1,12 @@
-.TH chocolate\-doom 6
+.TH @PROGRAM_SPREFIX@\-doom 6
 .SH NAME
-chocolate\-doom \- historically compatible Doom engine
+@PROGRAM_SPREFIX@\-doom \- historically compatible Doom engine
 .SH SYNOPSIS
-.B chocolate\-doom
+.B @PROGRAM_SPREFIX@\-doom
 [\fIOPTIONS\fR]
 .SH DESCRIPTION
 .PP
-Chocolate Doom is a port of Id Software's 1993 game "Doom" that is designed
+@PACKAGE_NAME@ is a port of Id Software's 1993 game "Doom" that is designed
 to behave as similar to the original DOS version of Doom as is possible.
 .br
 @content
@@ -13,23 +13,23 @@
 .SH IWAD SEARCH PATHS
 @include iwad_paths.man
 .SH ENVIRONMENT
-This section describes environment variables that control Chocolate Doom's
+This section describes environment variables that control @PACKAGE_NAME@'s
 behavior.
 @include environ.man
 .SH FILES
 .TP
-\fB$HOME/.local/share/chocolate-doom/default.cfg\fR
-The main configuration file for Chocolate Doom.  See \fBdefault.cfg\fR(5).
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/default.cfg\fR
+The main configuration file for @PACKAGE_NAME@.  See \fBdefault.cfg\fR(5).
 .TP
-\fB$HOME/.local/share/chocolate-doom/chocolate-doom.cfg\fR
-Extra configuration values that are specific to Chocolate Doom and not
-present in Vanilla Doom.  See \fBchocolate-doom.cfg\fR(5).
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-doom.cfg\fR
+Extra configuration values that are specific to @PACKAGE_NAME@ and not
+present in Vanilla Doom.  See \fB@PROGRAM_SPREFIX@\-doom.cfg\fR(5).
 .SH SEE ALSO
-\fBchocolate-server\fR(6),
-\fBchocolate-setup\fR(6),
-\fBchocolate-heretic\fR(6),
-\fBchocolate-hexen\fR(6),
-\fBchocolate-strife\fR(6)
+\fB@PROGRAM_SPREFIX@\-server\fR(6),
+\fB@PROGRAM_SPREFIX@\-setup\fR(6),
+\fB@PROGRAM_SPREFIX@\-heretic\fR(6),
+\fB@PROGRAM_SPREFIX@\-hexen\fR(6),
+\fB@PROGRAM_SPREFIX@\-strife\fR(6)
 .SH AUTHOR
 Chocolate Doom is written and maintained by Simon Howard.  It is based on
 the LinuxDoom source code, released by Id Software.
--- a/man/extra.cfg.template
+++ b/man/extra.cfg.template
@@ -1,23 +1,23 @@
-.TH chocolate-doom.cfg 5
+.TH @PROGRAM_SPREFIX@\-doom.cfg 5
 .SH NAME
-chocolate-doom.cfg \- Chocolate Doom configuration file
+@PROGRAM_SPREFIX@\-doom.cfg \- @PACKAGE_NAME@ configuration file
 .SH DESCRIPTION
 .PP
-\fIchocolate-doom.cfg\fR
-is a configuration file for \fBchocolate-doom\fR(6).  This file acts
+\fI@PROGRAM_SPREFIX@\-doom.cfg\fR
+is a configuration file for \fB@PROGRAM_SPREFIX@\-doom\fR(6).  This file acts
 as an auxiliary configuration file; the main configuration options
 are stored in \fBdefault.cfg\fR, which contains the same configuration
-options as Vanilla Doom (for compatibility).  \fIchocolate-doom.cfg\fR
-contains configuration options that are specific to Chocolate Doom
+options as Vanilla Doom (for compatibility).  \fI@PROGRAM_SPREFIX@\-doom.cfg\fR
+contains configuration options that are specific to @PACKAGE_NAME@
 only.
 .PP
-\fIchocolate-doom.cfg\fR is normally stored in the user's home directory,
-as \fI~/.local/share/chocolate-doom/chocolate-doom.cfg\fR.  The path can be
+\fI@PROGRAM_SPREFIX@\-doom.cfg\fR is normally stored in the user's home directory,
+as \fI~/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-doom.cfg\fR.  The path can be
 overridden using the \fBXDG_DATA_HOME\fR environment variable (see the XDG
 Base Directory Specification).
 .PP
-The \fBchocolate-setup\fR(6) tool provides a simple to use front-end
-for editing \fIchocolate-doom.cfg\fR.
+The \fB@PROGRAM_SPREFIX@\-setup\fR(6) tool provides a simple to use front-end
+for editing \fI@PROGRAM_SPREFIX@\-doom.cfg\fR.
 .SH FILE FORMAT
 .PP
 The file format is the same as that used for \fBdefault.cfg\fR(5).
@@ -26,7 +26,7 @@
 @content
 
 .SH SEE ALSO
-\fBchocolate-doom\fR(6),
+\fB@PROGRAM_SPREFIX@\-doom\fR(6),
 \fBdefault.cfg\fR(5),
-\fBchocolate-setup\fR(6)
+\fB@PROGRAM_SPREFIX@\-setup\fR(6)
 
--- a/man/heretic.template
+++ b/man/heretic.template
@@ -1,8 +1,8 @@
-.TH chocolate\-heretic 6
+.TH @PROGRAM_SPREFIX@\-heretic 6
 .SH NAME
-chocolate\-heretic \- historically compatible Heretic engine
+@PROGRAM_SPREFIX@\-heretic \- historically compatible Heretic engine
 .SH SYNOPSIS
-.B chocolate\-heretic
+.B @PROGRAM_SPREFIX@\-heretic
 [\fIOPTIONS\fR]
 .SH DESCRIPTION
 .PP
@@ -19,17 +19,17 @@
 @include environ.man
 .SH FILES
 .TP
-\fB$HOME/.local/share/chocolate-doom/heretic.cfg\fR
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/heretic.cfg\fR
 The main configuration file for Chocolate Heretic.  See \fBheretic.cfg\fR(5).
 .TP
-\fB$HOME/.local/share/chocolate-doom/chocolate-heretic.cfg\fR
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-heretic.cfg\fR
 Extra configuration values that are specific to Chocolate Heretic and not
-present in Vanilla Heretic. See \fBchocolate-heretic.cfg\fR(5).
+present in Vanilla Heretic. See \fB@PROGRAM_SPREFIX@\-heretic.cfg\fR(5).
 .SH SEE ALSO
-\fBchocolate-doom\fR(6),
-\fBchocolate-hexen\fR(6),
-\fBchocolate-server\fR(6),
-\fBchocolate-setup\fR(6)
+\fB@PROGRAM_SPREFIX@\-doom\fR(6),
+\fB@PROGRAM_SPREFIX@\-hexen\fR(6),
+\fB@PROGRAM_SPREFIX@\-server\fR(6),
+\fB@PROGRAM_SPREFIX@\-setup\fR(6)
 .SH AUTHOR
 Chocolate Heretic is part of the Chocolate Doom project, written and
 maintained by Simon Howard. It is based on the Heretic source code,
--- a/man/hexen.template
+++ b/man/hexen.template
@@ -1,8 +1,8 @@
-.TH chocolate\-hexen 6
+.TH @PROGRAM_SPREFIX@\-hexen 6
 .SH NAME
-chocolate\-hexen \- historically compatible Hexen engine
+@PROGRAM_SPREFIX@\-hexen \- historically compatible Hexen engine
 .SH SYNOPSIS
-.B chocolate\-hexen
+.B @PROGRAM_SPREFIX@\-hexen
 [\fIOPTIONS\fR]
 .SH DESCRIPTION
 .PP
@@ -19,17 +19,17 @@
 @include environ.man
 .SH FILES
 .TP
-\fB$HOME/.local/share/chocolate-doom/hexen.cfg\fR
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/hexen.cfg\fR
 The main configuration file for Chocolate Hexen.  See \fBhexen.cfg\fR(5).
 .TP
-\fB$HOME/.local/share/chocolate-doom/chocolate-hexen.cfg\fR
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-hexen.cfg\fR
 Extra configuration values that are specific to Chocolate Hexen and not
-present in Vanilla Hexen.  See \fBchocolate-hexen.cfg\fR(5).
+present in Vanilla Hexen.  See \fB@PROGRAM_SPREFIX@\-hexen.cfg\fR(5).
 .SH SEE ALSO
-\fBchocolate-doom\fR(6),
-\fBchocolate-heretic\fR(6),
-\fBchocolate-server\fR(6),
-\fBchocolate-setup\fR(6)
+\fB@PROGRAM_SPREFIX@\-doom\fR(6),
+\fB@PROGRAM_SPREFIX@\-heretic\fR(6),
+\fB@PROGRAM_SPREFIX@\-server\fR(6),
+\fB@PROGRAM_SPREFIX@\-setup\fR(6)
 .SH AUTHOR
 Chocolate Hexen is part of the Chocolate Doom project, written and
 maintained by Simon Howard. It is based on the Hexen source code,
--- /dev/null
+++ b/man/server.template
@@ -1,0 +1,52 @@
+.TH @PROGRAM_SPREFIX@\-server 6
+.SH NAME
+@PROGRAM_SPREFIX@\-server \- dedicated server for @PROGRAM_SPREFIX@\-doom
+.SH SYNOPSIS
+.B @PROGRAM_SPREFIX@\-server
+[OPTIONS]
+.SH DESCRIPTION
+.PP
+@PACKAGE_SHORTNAME@ is a modern doom engine designed to behave
+as similar to the original doom game as is possible.
+.PP
+.B @PROGRAM_SPREFIX@\-server
+is a dedicated server for @PACKAGE_SHORTNAME@. It is equivalent to 
+running 
+.B @PROGRAM_SPREFIX@\-doom
+with the "\-dedicated" option.
+.PP
+Game options are not specified to the server, which merely acts to
+retransmit data between players in the game; parameters for the
+game should be specified by the first player to connect to the server,
+who is designated the controlling player.
+.br
+.SH OPTIONS
+.TP
+\fB-ignoreversion\fR
+Ignore version mismatches between the server and the client. Using this
+option may cause game desyncs to occur, or differences in protocol may
+mean the netgame will simply not function at all. 
+.TP
+\fB-port <n>\fR
+Use the specified UDP port for communications, instead of the default (2342). 
+.TP
+\fB-privateserver\fR
+Don't register with the global master server.
+.TP
+\fB-servername <name>\fR
+Specify a name for the server.
+.SH SEE ALSO
+\fB@PROGRAM_SPREFIX@-doom\fR(6),
+\fB@PROGRAM_SPREFIX@-setup\fR(6)
+.SH AUTHOR
+Chocolate Doom is written and maintained by Simon Howard.
+.PP
+This manual was written by Jonathan Dowland.
+.SH COPYRIGHT
+Copyright \(co id Software Inc.
+Copyright \(co 2005-8 Simon Howard.
+.br
+This is free software.  You may redistribute copies of it under the terms of
+the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
+There is NO WARRANTY, to the extent permitted by law.
+
--- a/man/strife.template
+++ b/man/strife.template
@@ -1,8 +1,8 @@
-.TH chocolate\-strife 6
+.TH @PROGRAM_SPREFIX@\-strife 6
 .SH NAME
-chocolate\-strife \- historically compatible strife engine
+@PROGRAM_SPREFIX@\-strife \- historically compatible Strife engine
 .SH SYNOPSIS
-.B chocolate\-strife
+.B @PROGRAM_SPREFIX@\-strife
 [\fIOPTIONS\fR]
 .SH DESCRIPTION
 .PP
@@ -22,16 +22,16 @@
 
 .SH FILES
 .TP
-\fB$HOME/.local/share/chocolate-doom/strife.cfg\fR
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/strife.cfg\fR
 The main configuration file for Chocolate Strife.  See \fBstrife.cfg\fR(5).
 .TP
-\fB$HOME/.local/share/chocolate-doom/chocolate-strife.cfg\fR
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-strife.cfg\fR
 Extra configuration values that are specific to Chocolate Strife and not
-present in Vanilla Strife.  See \fBchocolate-strife.cfg\fR(5).
+present in Vanilla Strife.  See \fB@PROGRAM_SPREFIX@\-strife.cfg\fR(5).
 .SH SEE ALSO
-\fBchocolate-doom\fR(6),
-\fBchocolate-server\fR(6),
-\fBchocolate-setup\fR(6)
+\fB@PROGRAM_SPREFIX@\-doom\fR(6),
+\fB@PROGRAM_SPREFIX@\-server\fR(6),
+\fB@PROGRAM_SPREFIX@\-setup\fR(6)
 
 .SH HISTORY
 The source code for Strife was lost, which means, unlike the code for all the