shithub: choc

Download patch

ref: a42d9a220756e704497af690509f1ffbae5acaae
parent: 16ae1b6ced98eb72cf6c827e6ec2fb639b33716e
parent: 45880bd205798dc4b056622f965f634b9130d167
author: Jonathan Dowland <[email protected]>
date: Tue Jan 9 12:20:50 EST 2018

Merge pull request #962 from jmtd/manpage-fixes

Manpage fixes

--- a/man/INSTALL.template
+++ b/man/INSTALL.template
@@ -1,18 +1,10 @@
 #ifdef DOOM
-#define LONG_GAME_NAME Chocolate Doom
-#define LONG_EXE_NAME  chocolate-doom
 #define DEFAULT_IWAD   doom2.wad
 #elif HERETIC
-#define LONG_GAME_NAME Chocolate Heretic
-#define LONG_EXE_NAME  chocolate-heretic
 #define DEFAULT_IWAD   heretic.wad
 #elif HEXEN
-#define LONG_GAME_NAME Chocolate Hexen
-#define LONG_EXE_NAME  chocolate-hexen
 #define DEFAULT_IWAD   hexen.wad
 #elif STRIFE
-#define LONG_GAME_NAME Chocolate Strife
-#define LONG_EXE_NAME  chocolate-strife
 #define DEFAULT_IWAD   strife1.wad
 #endif
 
--- 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,9 +38,7 @@
            @[email protected]   \
            @[email protected]
 
-man_MANS = chocolate-server.6             \
-           chocolate-setup.6              \
-           $(GENERATED_MAN_PAGES)         \
+man_MANS = $(GENERATED_MAN_PAGES)         \
            $(SETUP_MAN_PAGES)
 
 doomdocs_DATA    = INSTALL.doom    CMDLINE.doom
@@ -51,88 +50,123 @@
              $(doomdocs_DATA) $(hereticdocs_DATA) \
              $(hexendocs_DATA) $(strifedocs_DATA)
 DOCGEN = $(srcdir)/docgen
+DOCGEN_COMMON_ARGS = -n "@PROGRAM_SPREFIX@" -s "@PACKAGE_NAME@" -z "@PACKAGE_SHORTNAME@"
 
-$(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
-	$(srcdir)/simplecpp -DDOOM -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
+	$(srcdir)/simplecpp -DDOOM \
+            -D LONG_GAME_NAME="@PACKAGE_SHORTNAME@ Doom" \
+            -D LONG_EXE_NAME="@PROGRAM_PREFIX@doom" \
+            -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
 
-
 @[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
-	$(srcdir)/simplecpp -DHERETIC -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
+	$(srcdir)/simplecpp -DHERETIC \
+            -D LONG_GAME_NAME="@PACKAGE_SHORTNAME@ Heretic" \
+            -D LONG_EXE_NAME="@PROGRAM_PREFIX@heretic" \
+            -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
 
 
 @[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
-	$(srcdir)/simplecpp -DHEXEN -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
+	$(srcdir)/simplecpp -DHEXEN \
+            -D LONG_GAME_NAME="@PACKAGE_SHORTNAME@ Hexen" \
+            -D LONG_EXE_NAME="@PROGRAM_PREFIX@hexen" \
+            -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
 
-
 @[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 > $@
+
+$(SETUP_MAN_PAGES): $(top_srcdir)/src $(MANPAGE_GEN_FILES)
+	$(DOCGEN) $(DOCGEN_COMMON_ARGS) \
+                  -g $(patsubst @PROGRAM_PREFIX@%-setup.6,%,$@) \
+                  -m $(srcdir)/setup.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
-	$(srcdir)/simplecpp -DSTRIFE -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
+	$(srcdir)/simplecpp -DSTRIFE  \
+            -DLONG_EXE_NAME="@PROGRAM_PREFIX@strife" \
+            -DLONG_GAME_NAME="@PACKAGE_SHORTNAME@ Strife" \
+            -DPRECOMPILED < $(srcdir)/INSTALL.template > $@
 
 
 INSTALL: 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
+++ /dev/null
@@ -1,42 +1,0 @@
-.TH chocolate\-setup 6
-.SH NAME
-chocolate\-setup \- configuration tool for chocolate\-doom
-.SH SYNOPSIS
-.B chocolate\-setup
-[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\-setup
-is a tool for configuring Chocolate Doom. It provides a menu\-based
-interface for the display, joystick, keyboard, mouse, sound and
-compatibility settings.
-.PP
-.B chocolate\-setup
-can also be used to start and join network games.
-.PP
-.SH OPTIONS
-.TP
-\fB-config <file>\fR
-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. 
-.SH SEE ALSO
-\fBchocolate-doom\fR(6),
-\fBdefault.cfg\fR(5),
-\fBchocolate-doom.cfg\fR(5)
-.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/default.cfg.template
+++ b/man/default.cfg.template
@@ -1,22 +1,22 @@
-.TH default.cfg 5
+.TH @CFGFILE@ 5
 .SH NAME
-default.cfg \- Chocolate Doom configuration file
+@CFGFILE@ \- @PACKAGE_SHORTNAME@ @GAME_UPPER@ configuration file
 .SH DESCRIPTION
 .PP
-\fIdefault.cfg\fR
-is the configuration file for \fBchocolate-doom\fR(6).  The configuration
+\fI@CFGFILE@\fR
+is the configuration file for \fB@PROGRAM_SPREFIX@\-@GAME@\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.
+original DOS Vanilla @GAME_UPPER@. 
+Extra @PACKAGE_SHORTNAME@ @GAME_UPPER@-specific options are stored in a separate 
+configuration file, \fB@PROGRAM_SPREFIX@\-@[email protected]\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
+\fI@CFGFILE@\fR is normally stored in the user's home directory,
+as \fI~/.local/share/@PROGRAM_SPREFIX@\-@GAME@/@CFGFILE@\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 \fIdefault.cfg\fR.
+The \fB@PROGRAM_SPREFIX@\-@GAME@\-setup\fR(6) tool provides a simple to use front-end
+for editing \fI@CFGFILE@\fR.
 .br
 .SH FILE FORMAT
 The file is a plain-text file, consisting of a list of configuration
@@ -49,7 +49,7 @@
 @content
 
 .SH SEE ALSO
-\fBchocolate-doom\fR(6),
-\fBchocolate-doom.cfg\fR(5),
-\fBchocolate-setup\fR(6)
+\fB@PROGRAM_SPREFIX@\-@GAME@\fR(6),
+\fB@PROGRAM_SPREFIX@\-@[email protected]\fR(5),
+\fB@PROGRAM_SPREFIX@\-@GAME@\-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, substs, 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, substs, content)
             else:
                 line = line.replace("@content", content)
+                for k,v in substs.items():
+                    line = line.replace(k,v)
                 stdout(line.rstrip().encode('UTF-8') + b'\n')
     finally:
         f.close()
 
-def manpage_output(targets, template_file):
+def manpage_output(targets, substs, template_file):
 
     content = ""
 
@@ -456,7 +458,7 @@
 
     content = content.replace("-", "\\-")
 
-    print_template(template_file, content)
+    print_template(template_file, substs, 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, substs, 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, substs, content)
 
-def completion_output(targets, template_file):
+def completion_output(targets, substs, template_file):
 
     content = ""
 
@@ -480,13 +482,16 @@
     for t in targets:
         content += t.completion_output() + "\n"
 
-    print_template(template_file, content)
+    print_template(template_file, substs, content)
 
 def usage():
-    print("Usage: %s [-V] [-c tag] [-g game] ( -m | -w | -p ) <dir>..." \
+    print("Usage: %s [-V] [-c tag] [-g game] -n program_name -s package_name [ -z shortname ] ( -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, e.g. Chocolate Doom (for substitution)")
+    print("   -z :  Package short-name, e.g. Chocolate (for substitution)")
+    print("   -n :  Program name, e.g. chocolate (for substitution)")
     print("   -m :  Manpage output")
     print("   -w :  Wikitext output")
     print("   -p :  Plaintext output")
@@ -497,14 +502,21 @@
 
 # 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:z:m:wp:b:c:g:V")
 
 output_function = None
 template = None
 doc_config_file = None
 match_game = None
+substs = {}
 
 for opt in opts:
+    if opt[0] == "-n":
+        substs["@PROGRAM_SPREFIX@"] = opt[1]
+    if opt[0] == "-s":
+        substs["@PACKAGE_NAME@"] = opt[1]
+    if opt[0] == "-z":
+        substs["@PACKAGE_SHORTNAME@"] = opt[1]
     if opt[0] == "-m":
         output_function = manpage_output
         template = opt[1]
@@ -522,6 +534,12 @@
         doc_config_file = opt[1]
     elif opt[0] == "-g":
         match_game = opt[1]
+        substs["@GAME@"] = opt[1]
+        substs["@GAME_UPPER@"] = opt[1].title()
+        if "doom" == opt[1]:
+            substs["@CFGFILE@"] = "default.cfg"
+        else:
+            substs["@CFGFILE@"] = opt[1] + ".cfg"
 
 if output_function == None or len(args) < 1:
     usage()
@@ -546,5 +564,5 @@
 
     # Generate the output
 
-    output_function(documentation_targets, template)
+    output_function(documentation_targets, substs, 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_SHORTNAME@ Doom 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,12 +1,12 @@
-.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
-Chocolate Heretic is a port of Raven Software's 1994 game "Heretic" that
+@PACKAGE_SHORTNAME@ Heretic is a port of Raven Software's 1994 game "Heretic" that
 aims to behave as similar to the original DOS version of Heretic as
 possible.
 .br
@@ -14,22 +14,22 @@
 .SH IWAD SEARCH PATHS
 @include iwad_paths.man
 .SH ENVIRONMENT
-This section describes environment variables that control Chocolate Heretic's
+This section describes environment variables that control @PACKAGE_SHORTNAME@ Heretic's
 behavior.
 @include environ.man
 .SH FILES
 .TP
-\fB$HOME/.local/share/chocolate-doom/heretic.cfg\fR
-The main configuration file for Chocolate Heretic.  See \fBheretic.cfg\fR(5).
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/heretic.cfg\fR
+The main configuration file for @PACKAGE_SHORTNAME@ Heretic.  See \fBheretic.cfg\fR(5).
 .TP
-\fB$HOME/.local/share/chocolate-doom/chocolate-heretic.cfg\fR
-Extra configuration values that are specific to Chocolate Heretic and not
-present in Vanilla Heretic. See \fBchocolate-heretic.cfg\fR(5).
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-heretic.cfg\fR
+Extra configuration values that are specific to @PACKAGE_SHORTNAME@ Heretic and not
+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,12 +1,12 @@
-.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
-Chocolate Hexen is a port of Raven Software's 1995 game "Hexen" that
+@PACKAGE_SHORTNAME@ Hexen is a port of Raven Software's 1995 game "Hexen" that
 aims to behave as similar to the original DOS version of Hexen as
 possible.
 .br
@@ -14,22 +14,22 @@
 .SH IWAD SEARCH PATHS
 @include iwad_paths.man
 .SH ENVIRONMENT
-This section describes environment variables that control Chocolate Hexen's
+This section describes environment variables that control @PACKAGE_SHORTNAME@ Hexen's
 behavior.
 @include environ.man
 .SH FILES
 .TP
-\fB$HOME/.local/share/chocolate-doom/hexen.cfg\fR
-The main configuration file for Chocolate Hexen.  See \fBhexen.cfg\fR(5).
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/hexen.cfg\fR
+The main configuration file for @PACKAGE_SHORTNAME@ Hexen.  See \fBhexen.cfg\fR(5).
 .TP
-\fB$HOME/.local/share/chocolate-doom/chocolate-hexen.cfg\fR
-Extra configuration values that are specific to Chocolate Hexen and not
-present in Vanilla Hexen.  See \fBchocolate-hexen.cfg\fR(5).
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-hexen.cfg\fR
+Extra configuration values that are specific to @PACKAGE_SHORTNAME@ Hexen and not
+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.
+
--- /dev/null
+++ b/man/setup.template
@@ -1,0 +1,42 @@
+.TH @PROGRAM_SPREFIX@\-@GAME@-setup 6
+.SH NAME
+@PROGRAM_SPREFIX@\-@GAME@-setup \- configuration tool for @PROGRAM_SPREFIX@\-@GAME@
+.SH SYNOPSIS
+.B @PROGRAM_SPREFIX@\-@GAME@-setup
+[OPTIONS]
+.SH DESCRIPTION
+.PP
+@PACKAGE_SHORTNAME@ @GAME_UPPER@ is a modern @GAME_UPPER@ engine designed to behave
+as similar to the original @GAME_UPPER@ game as is possible.
+.PP
+.B @PROGRAM_SPREFIX@\-@GAME@-setup
+is a tool for configuring @PACKAGE_SHORTNAME@ @GAME_UPPER@. It provides a menu\-based
+interface for the display, joystick, keyboard, mouse, sound and
+compatibility settings.
+.PP
+.B @PROGRAM_SPREFIX@\-@GAME@-setup
+can also be used to start and join network games.
+.PP
+.SH OPTIONS
+.TP
+\fB-config <file>\fR
+Load configuration from the specified file, instead of @CFGFILE@.
+.TP
+\fB-extraconfig <file>\fR
+Load extra configuration from the specified file, instead of @PROGRAM_SPREFIX@\-@[email protected]. 
+.SH SEE ALSO
+\fB@PROGRAM_SPREFIX@\-@GAME@\fR(6),
+\fBdefault.cfg\fR(5),
+\fB@PROGRAM_SPREFIX@\-@[email protected]\fR(5)
+.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,12 +1,12 @@
-.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
-Chocolate Strife is an accurate and complete recreation of Rogue
+@PACKAGE_SHORTNAME@ Strife is an accurate and complete recreation of Rogue
 Entertainment's "Strife: Quest for the Sigil". It was created through
 more than two years of reverse engineering effort with the blessings
 of the original programmers of the game (see the section HISTORY below).
@@ -16,22 +16,22 @@
 .SH IWAD SEARCH PATHS
 @include iwad_paths.man
 .SH ENVIRONMENT
-This section describes environment variables that control Chocolate Strife's
+This section describes environment variables that control @PACKAGE_SHORTNAME@ Strife's
 behavior.
 @include environ.man
 
 .SH FILES
 .TP
-\fB$HOME/.local/share/chocolate-doom/strife.cfg\fR
-The main configuration file for Chocolate Strife.  See \fBstrife.cfg\fR(5).
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/strife.cfg\fR
+The main configuration file for @PACKAGE_SHORTNAME@ Strife.  See \fBstrife.cfg\fR(5).
 .TP
-\fB$HOME/.local/share/chocolate-doom/chocolate-strife.cfg\fR
-Extra configuration values that are specific to Chocolate Strife and not
-present in Vanilla Strife.  See \fBchocolate-strife.cfg\fR(5).
+\fB$HOME/.local/share/@PROGRAM_SPREFIX@\-doom/@PROGRAM_SPREFIX@\-strife.cfg\fR
+Extra configuration values that are specific to @PACKAGE_SHORTNAME@ Strife and not
+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
@@ -57,15 +57,15 @@
 legal entities, this is effectively legal permission.
 
 .SH BUGS
-Chocolate Strife is almost, but not entirely perfect, in recreating the
+@PACKAGE_SHORTNAME@ Strife is almost, but not entirely perfect, in recreating the
 behavior of Vanilla Strife.  Help us by reporting any discrepancies you
 might notice between this executable and the vanilla DOS program.
 
 However, do *not* report any glitch that you can replicate in the vanilla EXE
-as a bug. The point of Chocolate Strife, like Chocolate Doom before it, is to
+as a bug. The point of @PACKAGE_SHORTNAME Strife, like Chocolate Doom before it, is to
 be as bug-compatible with the original game as possible. Also be aware that
 some glitches are impossible to compatibly recreate, and wherever this is the
-case, Chocolate Strife has erred on the side of not crashing the program,
+case, @PACKAGE_SHORTNAME@ Strife has erred on the side of not crashing the program,
 for example by initializing pointers to NULL rather than using them without
 setting a value first.