shithub: choc

Download patch

ref: eca0d817b7973d678d31608870bea86a141442ab
parent: d610772a0b58e63f665403386f167b3e19a5dcfd
author: Simon Howard <[email protected]>
date: Thu Mar 10 14:03:23 EST 2011

Replace the INSTALL file with a template version that is customized to
different platforms.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2299

--- a/INSTALL
+++ /dev/null
@@ -1,173 +1,0 @@
-
-Chocolate Doom installation
-===========================
-
-These are instructions for how to install and set up Chocolate Doom
-for play.
-
-Building Chocolate Doom
------------------------
-
-Before you can play Chocolate Doom, you need to compile a binary that
-you can run.  If you are using Windows or Mac OS X, precompiled
-binaries are available on the website for download, and you can skip
-this section.
-
-For compilation, Chocolate Doom requires the following to be installed:
-
- * A C compiler (gcc is recommended)
- * make (GNU make is recommended)
- * LibSDL (see http://www.libsdl.org/)
- * SDL_mixer (see http://www.libsdl.org/projects/SDL_mixer/)
- * SDL_net (see http://www.libsdl.org/projects/SDL_net/)
- * Python (optional)
-
-Follow the standard instructions for installing an autotools-based
-package:
-
- 1. Run './configure' to initialize the package.
- 2. Run 'make' to compile the package.
- 3. Run 'make install' to install the package.
-
-Advanced topics such as cross-compilation are beyond the scope of this
-document.  Please see the GNU autoconf / automake documentation for more
-information.
-
-Obtaining an IWAD file
-----------------------
-
-To play Doom, you need an IWAD file.  This file contains the game data
-that is used in gameplay (graphics, sounds, etc).  The full versions of
-the Doom games are proprietary and need to be bought.  The IWAD file
-has one of the following names:
-
-   doom1.wad                   (Shareware Doom)
-   doom.wad                    (Registered / Ultimate Doom)
-   doom2.wad                   (Doom 2)
-   tnt.wad                     (Final Doom: TNT: Evilution)
-   plutonia.wad                (Final Doom: Plutonia Experiment)
-   chex.wad                    (Chex Quest)
-
-If you don't have a copy of the commercial version, you can download
-the shareware version (extract the file named doom1.wad):
-
- * http://www.doomworld.com/idgames/index.php?id=7053
-   (idstuff/doom/win95/doom95.zip in your nearest /idgames mirror)
-
-If you have a commercial version, obtaining the IWAD file may slightly
-complicated.  The method depends on how you obtained your copy of the
-game:
-
- * There have been several CD-based versions of Doom.  Generally, the
-   IWAD files can be found on the CD and copied off directly.
-
- * The IWAD files might not be directly available on the CD.  Look for
-   a program named "deice.exe".  In the same directory, there should
-   be a single large file with a numbered extension (eg.
-   "resource.1"); to extract this, follow the same instructions as for
-   the floppy disk version (see below).
-
- * If you have the floppy disk version of Doom, first copy the
-   contents of all the floppy disks into a directory together.  You
-   will have several large files with numbered extensions.
-   Concatenate these into a single file, eg.
-
-     (Unix instructions)
-     cat doom_se.1 doom_se.2 doom_se.3 doom_se.4 doom_se.5 > doom_se.exe
-
-     (Windows/DOS instructions)
-     copy doom_se.1+doom_se.2+doom_se.3+doom_se.4+doom_se+5 doom_se.exe
-
-   The resulting file is self-extracting LHA file.  If you have a DOS
-   emulator (such as DOSbox), you can run it to extract the files;
-   alternatively, you can use the Unix LHA tool to extract the
-   archive.
-
- * The Doom games are also available for download on Steam
-   (http://www.steampowered.com/).  To find the IWAD files, look in
-   your Steam directory, under the "steamapps/common" path.
-
-Running the game
-----------------
-
-When you have an IWAD file, install it through one of the following
-methods:
-
- * Under Mac OS X, you can specify the locations of the IWAD files
-   through the graphical launcher program.  Click the "Configure..."
-   button, and then click "Set..." for each IWAD location to choose
-   its location.
-
- * Under Unix, put the file into the /usr/share/games/doom or
-   /usr/local/share/games/doom directories.
-
- * Place it in a directory and set the environment variable DOOMWADDIR
-   to be the path to that directory.
-
- * Install multiple IWADs into separate directories and set the
-   environment variable DOOMWADPATH to be a colon-separated list of
-   directories to search (similar to the Unix PATH environment
-   variable).
-
- * Run Chocolate Doom with the '-iwad' command line parameter to
-   specify the IWAD file to use, eg.
-
-       chocolate-doom -iwad /root/doom2.wad
-
-Playing with Chex Quest
------------------------
-
-Chex Quest is a game based on Doom with some minor modifications that
-was distributed with boxes of Chex cereal in 1997.  It is possible to
-play Chex Quest using Chocolate Doom.  To do this, the following files
-are needed:
-
- * The IWAD file 'chex.wad', from the Chex Quest CD.
-
- * The dehacked patch 'chex.deh', which can be found in the /idgames
-   repository in utils/exe_edit/patches/chexdeh.zip.
-
-Copy these files into a directory together and use the '-iwad' command
-line parameter to specify the Chex Quest IWAD file:
-
-   chocolate-doom -iwad chex.wad
-
-Installing upgrades
--------------------
-
-Chocolate Doom requires a Doom 1.9 IWAD file.  Generally, if you
-install a recent version of Doom you should automatically have a 1.9
-IWAD.  However, if you are installing from a very old CD version or
-from floppy disks, you might find you have an older version.
-
-The most obvious symptom of an out of date IWAD file is that the game
-will exit at the title screen before the demo starts, with the message
-"Demo is from a different game version!".  If this happens, your IWAD
-file is out of date and you need to upgrade.
-
-Id Software released upgrade patches that will update your game to
-1.9.  The following sites have the patches:
-
-  http://www.doomworld.com/files/patches.shtml
-  http://www.doom2.net/doom2/utils.html
-  ftp://ftp.idsoftware.com/idstuff/doom2
-
-As the patches are binary patches that run as DOS executables, you
-will need a DOS emulator (such as DOSBox) to install them.
-
-Music support
--------------
-
-Support for Doom's MIDI music is available through Timidity:
-
-  http://timidity.sourceforge.net/
-
-A good set of patches for Timidity is the eawpats collection, which can
-be found here:
-
-  http://www.doomworld.com/idgames/index.php?id=13928
-  (Doom idgames archive, /sounds/eawpats.zip)
-
-If compiling from source, be sure to compile and install timidity
-before installing SDL_mixer.
-
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,24 +33,31 @@
         data/setup.png        \
         data/convert-icon
 
+DOC_FILES=                              \
+        CMDLINE                         \
+        README                          \
+        README.OPL                      \
+        BUGS                            \
+        NEWS                            \
+        ChangeLog                       \
+        NOT-BUGS
+
 EXTRA_DIST=                             \
         $(AUX_DIST_GEN)                 \
         $(MSVC_FILES)                   \
         $(CODEBLOCKS_FILES)             \
         $(DATA_FILES)                   \
+        $(DOC_FILES)                    \
         .lvimrc                         \
-        config.h                        \
-        CMDLINE                         \
         HACKING                         \
-        README.OPL                      \
         TODO                            \
-        BUGS                            \
-        NOT-BUGS                        \
         rpm.spec
 
+docdir=$(prefix)/share/doc/@PACKAGE@
+doc_DATA=$(DOC_FILES)
+
 MAINTAINERCLEANFILES =  $(AUX_DIST_GEN)
 
-docdir=$(prefix)/share/doc/@PACKAGE@
 SUBDIRS=wince textscreen opl pcsound src man setup
 DIST_SUBDIRS=pkg $(SUBDIRS)
 
@@ -60,6 +67,9 @@
 
 CMDLINE : src/
 	./man/docgen -p man/CMDLINE.template src/ > $@
+
+INSTALL : man/INSTALL.template man/simplecpp
+	./man/simplecpp < man/INSTALL.template > $@
 
 endif
 
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,12 @@
 1.6.0 (2011-??-??):
 
+     * The instructions in the INSTALL file are now customized for
+       different platforms, and each binary package contains a version
+       with instructions specific to the platform that it is
+       targetting.  This should help to avoid confusion that some
+       users have reported experiencing.
+
+    Compatibility:
      * Added support for the alternate version of the Final Doom
        executable included in some later versions of the Id Anthology.
        This version fixed the demo loop crash that occurred with the
@@ -10,8 +17,6 @@
        with the Final Doom IWADs (the original behavior can be
        selected with -gameversion final).  (thanks Porsche Monty,
        Enjay).
-
-    Compatibility:
      * Very short sound effects are not played, to better emulate the
        behavior of DMX in Vanilla Doom (thanks to Quasar for help in
        investigating this).
--- a/autogen.sh
+++ b/autogen.sh
@@ -4,7 +4,7 @@
 
 aclocal
 autoheader
-automake -a -c
+automake
 autoconf
 automake
 
--- /dev/null
+++ b/man/INSTALL.template
@@ -1,0 +1,250 @@
+
+Chocolate Doom installation
+===========================
+
+These are instructions for how to install and set up Chocolate Doom
+for play.
+
+#ifn PRECOMPILED
+Building Chocolate Doom
+-----------------------
+
+Before you can play Chocolate Doom, you need to compile a binary that
+you can run.  For compilation, Chocolate Doom requires the following
+to be installed:
+
+ * A C compiler (gcc is recommended)
+ * make (GNU make is recommended)
+ * LibSDL (see http://www.libsdl.org/)
+ * SDL_mixer (see http://www.libsdl.org/projects/SDL_mixer/)
+ * SDL_net (see http://www.libsdl.org/projects/SDL_net/)
+ * Python (optional)
+
+Follow the standard instructions for installing an autotools-based
+package:
+
+ 1. Run './configure' to initialize the package.
+ 2. Run 'make' to compile the package.
+ 3. Run 'make install' to install the package.
+
+An automated build script is available that installs the necessary
+dependencies and builds the source code automatically.  See the build
+instructions on the website.
+
+Advanced topics such as cross-compilation are beyond the scope of this
+document.  Please see the GNU autoconf / automake documentation for more
+information.
+
+#endif
+Obtaining an IWAD file
+----------------------
+
+To play Doom, you need an IWAD file.  This file contains the game data
+that is used in gameplay (graphics, sounds, etc).  The full versions of
+the Doom games are proprietary and need to be bought.  The IWAD file
+has one of the following names:
+
+   doom1.wad                   (Shareware Doom)
+   doom.wad                    (Registered / Ultimate Doom)
+   doom2.wad                   (Doom 2)
+   tnt.wad                     (Final Doom: TNT: Evilution)
+   plutonia.wad                (Final Doom: Plutonia Experiment)
+   chex.wad                    (Chex Quest)
+
+If you don't have a copy of the commercial version, you can download
+the shareware version (extract the file named doom1.wad):
+
+ * http://www.doomworld.com/idgames/index.php?id=7053
+   (idstuff/doom/win95/doom95.zip in your nearest /idgames mirror)
+
+If you have a commercial version, obtaining the IWAD file may be slightly
+complicated.  The method depends on how you obtained your copy of the
+game:
+
+#if _WIN32
+ * The Doom games are available to buy for download on Steam
+   (http://www.steampowered.com/).  Chocolate Doom will autodetect
+   IWADs installed by Steam and you do not need to do anything.
+#else
+ * The Doom games are available to buy for download on Steam
+   (http://www.steampowered.com/).  To find the IWAD files on a
+   Windows system, look in the Steam directory (usually within
+   "Program Files"), under the "steamapps/common" path.
+#endif
+
+ * There have been several CD-based versions of Doom.  Generally, the
+   IWAD files can be found on the CD and copied off directly.
+
+#if _WIN32
+ * If the IWAD files are not directly available on the CD, or you have
+   a floppy disk version, you will need to run the install program to
+   install the game to your hard disk.  As the installer is DOS-based,
+   you may not be able to do this on 64-bit versions of Windows.  In
+   this case, the best suggestion is to use a DOS emulator (such as
+   DOSbox) to run the installer.
+#else
+ * If the IWAD files are not directly available on the CD, or you have
+   a floppy disk version, installation is more difficult.  The best
+   suggestion is to use a DOS emulator (such as DOSbox) to run the
+   installer.
+#endif
+
+ * As an alternative to using an emulator, it is possible to extract
+   the files manually.  On the install disk(s), you will find several
+   files with numbered extensions (with CD versions there may be a
+   single large file with the extension .1, eg. "resource.1").
+
+   From the command line it is possible to combine these files into a
+   single large file, using a command similar to the following:
+
+#if _WIN32
+     copy doom_se.1+doom_se.2+doom_se.3+doom_se.4+doom_se.5 doom_se.lha
+#else
+     cat doom_se.1 doom_se.2 doom_se.3 doom_se.4 doom_se.5 > doom_se.lha
+#endif
+
+   The resulting file is an LHA archive file, and it can be extracted
+   using an LHA archive tool (there is one available for almost every
+   operating system).
+
+Running the game
+----------------
+
+#if __MACOSX__
+Once you have an IWAD file, you can specify its location within the
+graphical launcher program.  Click the "Configure..." button, and then
+click "Set..." for each IWAD location to choose its location.  From
+the main launcher dialog you can then choose which game you want to
+play and click the "Launch" button to start the game.
+
+If you are an advanced user and like to run Doom from the command
+line, you can use the "Open Terminal..." menu item to open a command
+line terminal.  The DOOMWADPATH environment variable is preconfigured
+to point to the locations of the IWAD files set within the launcher.
+You can launch the game with a specific IWAD file by typing, for
+example:
+
+    chocolate-doom -iwad tnt.wad
+#else
+Chocolate Doom needs to know where to find your IWAD file. To do this,
+do one of the following:
+
+#if _WIN32
+ * Within Explorer, simply place the IWAD file in the same folder as
+   the Chocolate Doom files, and double-click chocolate-doom.exe.
+
+ * Set the environment variable DOOMWADDIR to the location of a
+   directory containing your IWAD files.
+
+ * If you have multiple IWADs in different directories, set the
+   environment variable DOOMWADPATH to be a semicolon-separated list
+   of directories to search (similar to the PATH environment
+   variable).
+
+ * Run Chocolate Doom from the command prompt with the '-iwad' command
+   line parameter to specify the IWAD file to use, eg.
+
+       chocolate-doom -iwad c:\games\doom2.wad
+#else
+ * Put the file into one of the following directories:
+
+     /usr/share/games/doom
+     /usr/local/share/games/doom
+
+ * Set the environment variable DOOMWADDIR to specify the path to a
+   directory containing your IWAD files.
+
+ * If you have multiple IWADs in different directories, set the
+   environment variable DOOMWADPATH to be a colon-separated list of
+   directories to search (similar to the Unix PATH environment
+   variable).
+
+ * Run Chocolate Doom from the Unix console with the '-iwad' command
+   line parameter to specify the IWAD file to use, eg.
+
+       chocolate-doom -iwad /root/doom2.wad
+#endif
+#endif
+
+Playing with Chex Quest
+-----------------------
+
+Chex Quest is a game based on Doom with some minor modifications that
+was distributed with boxes of Chex cereal in 1997.  It is possible to
+play Chex Quest using Chocolate Doom.  To do this, the following files
+are needed:
+
+ * The IWAD file 'chex.wad', from the Chex Quest CD.
+
+ * The dehacked patch 'chex.deh', which can be found in the /idgames
+   repository in utils/exe_edit/patches/chexdeh.zip.
+
+Copy these files into a directory together and use the '-iwad' command
+line parameter to specify the Chex Quest IWAD file:
+
+   chocolate-doom -iwad chex.wad
+
+Installing upgrades
+-------------------
+
+Chocolate Doom requires a version 1.9 IWAD file.  Generally, if you
+install a recent version of Doom you should have a version 1.9 IWAD.
+However, if you are installing from a very old CD version or from
+floppy disks, you might find you have an older version.
+
+The most obvious symptom of an out of date IWAD file is that the game
+will exit at the title screen before the demo starts, with the message
+"Demo is from a different game version!".  If this happens, your IWAD
+file is out of date and you need to upgrade.
+
+Id Software released upgrade patches that will update your game to
+version 1.9.  The following sites have the patches:
+
+  http://www.doomworld.com/files/patches.shtml
+  http://www.doom2.net/doom2/utils.html
+  ftp://ftp.idsoftware.com/idstuff/doom2
+
+#if _WIN32
+As the patches are binary patches that run as DOS executables, on
+recent 64-bit versions of Windows you will need to use a DOS emulator
+(such as DOSBox) to run them.
+#else
+As the patches are binary patches that run as DOS executables, you
+will need to use a DOS emulator (such as DOSBox) to run them.
+#endif
+
+Music support
+-------------
+
+Chocolate Doom includes OPL emulation code that accurately reproduces
+the way that the in-game music sounded under DOS when using an
+Adlib/Soundblaster card.  This is, however, not to everyone's taste.
+
+#if _WIN32
+Better quality MIDI playback is possible by using Windows' native
+MIDI synthesizer that is part of the operating system.  Select "Native
+MIDI" within the sound dialog in the setup tool.
+
+#endif
+#if __MACOSX__
+High quality MIDI playback is possible by using Mac OS X's native MIDI
+synthesizer that is part of the operating system. Select "Native MIDI"
+within the sound dialog in the setup tool.
+
+#endif
+As an alternative it is possible to use Timidity for high quality MIDI
+playback:
+
+  http://timidity.sourceforge.net/
+
+A good set of patches for Timidity is the eawpats collection, which can
+be found here:
+
+  http://www.doomworld.com/idgames/index.php?id=13928
+  (Doom idgames archive, /sounds/eawpats.zip)
+
+#ifn PRECOMPILED
+When compiling from source, be sure to compile and install timidity
+before installing SDL_mixer.
+#endif
+
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,6 +1,8 @@
 
 MANPAGE_GEN_FILES=manpage.template docgen default.cfg.template extra.cfg.template
 
+docdir=$(prefix)/share/doc/@PACKAGE@
+
 if HAVE_PYTHON
 
 man_MANS=chocolate-doom.6      \
@@ -9,6 +11,8 @@
          default.cfg.5         \
          $(PACKAGE).cfg.5
 
+nodist_doc_DATA=INSTALL
+
 chocolate-doom.6: ../src $(MANPAGE_GEN_FILES)
 	./docgen -m manpage.template ../src > $@
 
@@ -18,9 +22,14 @@
 $(PACKAGE).cfg.5: ../src extra.cfg.template
 	./docgen -m extra.cfg.template -c $(PACKAGE).cfg ../src > $@
 
+INSTALL:
+	./simplecpp -DPRECOMPILED < INSTALL.template > $@
+
 endif
 
 EXTRA_DIST = $(man_MANS) $(MANPAGE_GEN_FILES)        \
              wikipages                               \
-             CMDLINE.template
+             CMDLINE.template                        \
+             INSTALL.template                        \
+             simplecpp
 
--- /dev/null
+++ b/man/simplecpp
@@ -1,0 +1,211 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Contributors to the Freedoom project.  All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#  * Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+#  * Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in the
+#    documentation and/or other materials provided with the distribution.
+#  * Neither the name of the freedoom project nor the names of its
+#    contributors may be used to endorse or promote products derived from
+#    this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+#
+# simple cpp-style preprocessor
+#
+# Understands:
+#
+# #define NAME
+#
+# Set an option
+# You can use -D on the command line too
+#
+# #undef NAME
+#
+# Unset an option if it is set
+#
+# #if .. #endif / #ifdef .. #endif
+#
+# Specify a list of options set, eg #ifdef DOOM2 || ULTDOOM || SHAREWARE
+# The block is only displayed if one of the options is set
+#
+# #ifn .. #endif / #ifndef .. #endif
+#
+# Similarly specify a list of options
+# The block is displayed if none of the options are set
+#
+# #include "filename"
+#
+# include the contents of a file
+
+import sys
+import re
+
+debug = False
+defines = {}
+
+command_re = re.compile("\#(\w+)(\s+(.*))?")
+include_re = re.compile("\s*\"(.*)\"\s*")
+
+def debug_msg(message):
+	if debug:
+		sys.stderr.write(message)
+
+# Parse command line options
+
+def parse_cmdline():
+	for arg in sys.argv[1:]:
+		if arg.startswith("-D"):
+			name = arg[2:]
+			defines[name] = True
+
+def parse_stream(stream):
+	result = read_block(stream, False)
+
+	if result is not None:
+		raise Exception("Mismatched #if in '%s'" % stream.name)
+
+def parse_file(filename):
+	f = open(filename)
+
+	try:
+		parse_stream(f)
+	finally:
+		f.close()
+
+# #include
+
+def cmd_include(arg):
+	# Extract the filename
+
+	match = include_re.match(arg)
+
+	if not match:
+		raise Exception("Invalid 'include' command")
+
+	filename = match.group(1)
+
+	# Open the file and process it
+
+	parse_file(filename)
+
+# #define
+
+def cmd_define(arg):
+	defines[arg] = True
+
+# #undef
+
+def cmd_undef(arg):
+	if arg in defines:
+		del defines[arg]
+
+# #ifdef/#ifndef
+
+def cmd_ifdef(arg, command, stream, ignore):
+
+	# Get the define name
+	name = arg.strip()
+
+	debug_msg("%s %s >\n" % (command, arg))
+
+	# Should we ignore the contents of this block?
+
+	sub_ignore = (name not in defines)
+
+	if "n" in command:
+		sub_ignore = not sub_ignore
+
+	# Parse the block
+
+	result = read_block(stream, ignore or sub_ignore)
+
+	debug_msg("%s %s < (%s)\n" % (command, arg, result))
+
+	# There may be a second "else" block to parse:
+
+	if result == "else":
+		debug_msg("%s %s else >\n" % (command, arg))
+		result = read_block(stream, ignore or (not sub_ignore))
+		debug_msg("%s %s else < (%s)\n" % (command, arg, result))
+
+	# Should end in an endif:
+
+	if result != "endif":
+		raise Exception("'if' block did not end in an 'endif'")
+
+commands = {
+	"include" : cmd_include,
+	"define"  : cmd_define,
+	"undef"   : cmd_undef,
+	"if"      : cmd_ifdef,
+	"ifdef"   : cmd_ifdef,
+	"ifn"     : cmd_ifdef,
+	"ifndef"  : cmd_ifdef,
+}
+
+# Recursive block reading function
+# if 'ignore' argument is 1, contents are ignored
+
+def read_block(stream, ignore):
+
+	for line in stream:
+
+		# Remove newline
+
+		line = line[0:-1]
+
+		# Check if this line has a command
+
+		match = command_re.match(line)
+
+		if match:
+			command = match.group(1)
+			arg = match.group(3)
+
+			if command == "else" or command == "endif":
+				return command
+			elif command not in commands:
+				raise Exception("Unknown command: '%s'" % \
+						command)
+
+			# Get the callback function.
+
+			func = commands[command]
+
+			# Invoke the callback function. #ifdef commands
+			# are a special case and need extra arguments.
+			# Other commands are only executed if we are not
+			# ignoring this block.
+
+			if func == cmd_ifdef:
+				cmd_ifdef(arg, command=command,
+					       stream=stream,
+					       ignore=ignore)
+			elif not ignore:
+				func(arg)
+		else:
+			if not ignore:
+				print(line)
+
+parse_cmdline()
+parse_stream(sys.stdin)
+
--- a/pkg/config.make.in
+++ b/pkg/config.make.in
@@ -21,7 +21,6 @@
 DOC_FILES = README       \
             COPYING      \
             ChangeLog    \
-            INSTALL      \
             NEWS         \
             BUGS         \
             NOT-BUGS     \
--- a/pkg/osx/GNUmakefile
+++ b/pkg/osx/GNUmakefile
@@ -67,6 +67,10 @@
 	./cp-with-libs $(TOPLEVEL)/setup/chocolate-setup "$(APP_BIN_DIR)"
 	$(STRIP) "$(APP_BIN_DIR)/chocolate-setup"
 
+	$(TOPLEVEL)/man/simplecpp -DPRECOMPILED -D__MACOSX__  \
+	             < $(TOPLEVEL)/man/INSTALL.template       \
+	             > $(STAGING_DIR)/INSTALL
+
 	find $(STAGING_DIR) -name .svn -delete -exec rm -rf {} \; || true
 
 clean : launcher_clean
--- a/pkg/win32/GNUmakefile
+++ b/pkg/win32/GNUmakefile
@@ -27,6 +27,10 @@
 		cp $(TOPLEVEL)/$$f staging/$$f.txt;  \
 		unix2dos staging/$$f.txt;            \
 	done
+	$(TOPLEVEL)/man/simplecpp -D_WIN32 -DPRECOMPILED  \
+	         < $(TOPLEVEL)/man/INSTALL.template       \
+	         > staging/INSTALL.txt
+	unix2dos staging/INSTALL.txt
 
 clean:
 	rm -f $(ZIP)
--- a/rpm.spec.in
+++ b/rpm.spec.in
@@ -49,14 +49,6 @@
 %files
 %doc %{_mandir}/man5/*
 %doc %{_mandir}/man6/*
-%doc README
-%doc README.OPL
-%doc INSTALL
-%doc NEWS
-%doc AUTHORS
-%doc COPYING
-%doc CMDLINE
-%doc BUGS
-%doc NOT-BUGS
+/usr/share/doc/@PACKAGE@/*
 /usr/games/*