[nethack] 01/01: Imported Debian patch 3.4.3-14

James Cowgill jcowgill-guest at moszumanska.debian.org
Mon Mar 7 17:53:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

jcowgill-guest pushed a commit to annotated tag debian/3.4.3-14
in repository nethack.

commit 29c39ced1a82559d57cf6e8703c6215e60dcc9c2
Author: Vincent Cheng <Vincentc1208 at gmail.com>
Date:   Mon Jun 11 00:47:38 2012 -0700

    Imported Debian patch 3.4.3-14
---
 debian/README.Debian                               |  111 --
 debian/README.source                               |    4 -
 debian/changelog                                   |   35 +
 debian/control                                     |   42 +-
 debian/copyright                                   |  247 ++--
 debian/gnome/nethack-tty.sh                        |   64 -
 debian/gnome/nethack.sh                            |   28 -
 debian/gnome/nethackrc                             |   21 -
 debian/nethack-common.lintian-overrides            |    1 +
 debian/nethack-common.menu                         |    6 -
 debian/nethack-common.postinst                     |    4 +-
 debian/nethack-gnome.dirs                          |    5 -
 debian/nethack-gnome.links                         |    2 -
 debian/nethack-gnome.menu                          |    6 -
 debian/nethack-gnome.postinst                      |   11 -
 debian/nethack-gnome.prerm                         |    8 -
 debian/nethack-x11.desktop                         |    1 -
 debian/overrides/lintian/nethack-common            |    2 -
 debian/overrides/lintian/nethack-console           |    1 -
 debian/overrides/lintian/nethack-gnome             |    1 -
 debian/overrides/lintian/nethack-lisp              |    2 -
 debian/overrides/lintian/nethack-qt                |    1 -
 debian/overrides/lintian/nethack-x11               |    1 -
 ...e-the-user-calling-recover-owns-the-file.patch} |   39 +-
 ...-in-the-default-manpage-to-what-is-used-.patch} |   40 +-
 .../0003-Define-_GNU_SOURCE-for-RTLD_NEXT.patch    |   21 +
 ... => 0004-Add-LISP-based-windowing-system.patch} |  112 +-
 ...3_simple_mail.dpatch => 0005-Simple-mail.patch} |   82 +-
 ...-Common-config.h-for-all-binary-packages.patch} |   45 +-
 ...bit-more-useful-with-recover-s-error-mes.patch} |   47 +-
 ...share-pixmaps-nethack-for-pretty-pictures.patch |   28 +
 debian/patches/0009-Better-way-to-do-it.patch      |   31 +
 ...es-color-HP-monitor-for-textmode-NetHack.patch} |  225 ++--
 ...n-s-patch-to-add-colors-to-inventory-ite.patch} |  304 ++---
 ...-asks-you-to-confirm-yes-instead-of-y-wh.patch} |  115 +-
 ...dpatch-by-Tom-Friedetzky-Jukka-Lahtinen-.patch} |  205 ++-
 ...oot.dpatch-by-Jeroen-Demeyer-and-Jukka-L.patch} |  196 +--
 ...enh_engulf_prayers.dpatch-by-Joshua-Kwan.patch} |   44 +-
 .../0016-fix-non-constant-format-strings.patch     | 1414 ++++++++++++++++++++
 ...and-Linux-specifics-defined-in-unixconf.h.patch |  175 +++
 .../0018-lisp-support-in-src-Makefile.patch        |   54 +
 debian/patches/0019-stay-in-array-bounds.patch     |   25 +
 .../0020-fix-64-bit-issues-in-lisp-code.patch      |   45 +
 debian/patches/0021-fix-kfreebsd-ftbfs.patch       |   49 +
 debian/patches/00list                              |   25 -
 debian/patches/01_fix_qt.dpatch                    |   41 -
 debian/patches/05_makefile_logic.dpatch            |  165 ---
 debian/patches/06_x11_data.dpatch                  |   40 -
 debian/patches/08_linux_specifics.dpatch           |   94 --
 debian/patches/09_use_gnu_source.dpatch            |   30 -
 debian/patches/10_gnome_add_quiver.dpatch          |   35 -
 debian/patches/12_lisp_windowing.copyright         |   20 -
 debian/patches/16_pixmapdir.dpatch                 |  106 --
 debian/patches/17_gnome_remove_drop_many.dpatch    |   35 -
 debian/patches/18_overridewin.dpatch               |   45 -
 debian/patches/19_gnome_ext_events.dpatch          |   79 --
 debian/patches/20_gcc4_fix.dpatch                  |   18 -
 debian/patches/21_gnome_umask.dpatch               |   27 -
 debian/patches/22_qt_savegame.dpatch               |    8 -
 debian/patches/96_binutils-gold.dpatch             |   17 -
 debian/patches/series                              |   21 +
 debian/qt/nethack-tty.sh                           |   64 -
 debian/qt/nethack.sh                               |   28 -
 debian/qt/nethackrc                                |   33 -
 debian/rules                                       |  135 +-
 debian/source/format                               |    1 +
 debian/watch                                       |    3 +
 67 files changed, 2829 insertions(+), 2141 deletions(-)

diff --git a/debian/README.Debian b/debian/README.Debian
deleted file mode 100644
index 5200bd3..0000000
--- a/debian/README.Debian
+++ /dev/null
@@ -1,111 +0,0 @@
-README for Debian GNU/Linux Nethack 3.4.3
------------------------------------------
-
-[ Apologies for Save File Format Change ]
-
-The save-game format has changed again for Nethack 3.4.0.  You
-should have been prompted by the installer to back up your old
-save game files and high score list into /tmp.  Unfortunately,
-your old save-games are no longer useful with Nethack 3.4.0,
-although it may be possible to merge the old high score lists.
-
-Note that the save-game and bones format are the same between
-3.4.0 and 3.4.1.  You do not need to clean out your save games
-for this upgrade.
-
-[ New in Nethack for Debian 3.4.1-1 and Later ]
-
-Back by popular demand is the no-frills nethack-console package.
-This package has NO graphical interface, and does not even depend
-on xbase-clients.
-
-The nethack-console package supports either ~/.nethackrc or
-~/.nethackrc.console files for configuration.
-
-[ New in Nethack for Debian 3.4.0-1 and Later ]
-
-The Debian Nethack packages have been restructured.  Now,
-separate packages are provided for each graphical interface:
-
- * nethack-x11
- * nethack-gnome
- * nethack-qt
-
-Each of these packages also contains the classic text-based
-interface.  You can get the classic interface by running
-/usr/games/nethack, or a graphical interface by running:
-
-(for x11): /usr/games/xnethack
-(for gnome): /usr/games/nethack-gnome
-(for qt): /usr/games/nethack-qt
-
-[ Changing the default graphical interface ]
-
-The /usr/games/nethack symlink is maintained with update-alternatives,
-so if you wish to make one of the graphical interfaces the default,
-simply run (as root):
-
-# update-alternatives --config nethack
-
-The common dungeon files and utilities have been moved out
-into a separate package, nethack-common.
-
-The old nethack package is now a dummy package that just depends
-on nethack-common and nethack-x11 to behave how the old version
-did.
-
-Please note that the Gnome interface is not yet fully stable,
-and is known to have some bugs.  If you value your character, please
-use the x11, qt, or text interfaces.
-
-[ Configuration Files for 3.4.0-1 and Later ]
-
-The previous Debian releases of Nethack did not provide for
-separate configuration files for each windowing system. (If
-you ran xnethack, ~/.nethackrc was ignored.)  Now, each windowing
-system has its own set of system defaults and per-user defaults:
-
-x11: ~/.nethackrc.x11 or /etc/nethack/nethackrc.x11
-gnome: ~/.nethackrc.gnome or /etc/nethack/nethackrc.gnome 
-qt: ~/.nethackrc.qt or /etc/nethack/nethackrc.qt
-
-text: ~/.nethackrc or /etc/nethack/nethackrc.tty
-
-If the HACKOPTIONS environment variable is set to a filename,
-that configuration file is always used.  Otherwise, the per-user
-config file is tried for the appropriate windowing system
-(~/.nethackrc.gnome for gnome, etc).  If that is not found,
-the system-wide default in /etc/nethack is used.
-
-[ Game Dumps ]
-
-Summaries of the immediately previous game that someone has played will
-always be saved upon death, escape, or ascension in /var/games/nethack/dumps.
-These are ideal for posting to newsgroups and bragging to your friends.
-
-The configuration file hardcodes the path for 'dumpfile' (the location where
-this log will be saved) and it cannot be changed, so there is no chance of
-being able to create files in arbitrary places with gid: games.
-
-[ Description of Nethack ]
-
-Nethack is a wonderfully silly yet quite addicting Dungeons and
-Dragons-style adventure game. You play the part of a fierce fighter,
-wizard, or any of many other classes, fighting your way down to
-retrieve the Amulet of Yendor (try saying THAT one backwards!) for
-your god. On the way, you might encounter a quantum mechanic or two,
-or perhaps a microscopic space fleet, or -- if you're REALLY lucky --
-the Ravenous Bugblatter Beast of Traal.
-
-There is a nethack-spoilers package available separately if you are
-really stuck, to be used only as a last resort.
-
-A few utilities -- recover, for retrieving your auto-save files in case
-of a power failure, and dgn_comp and lev_comp, two utilities for making
-your own Nethack levels and dungeons, have been included in
-/usr/lib/games/nethack.  As of Nethack 3.4.0, the dlb utility is
-included for master hackers.
-
-The recover utility will be run upon bootup by /etc/init.d/nethack-common.
-Any auto-save files still on the system from a possible crash will be
-retrieved and converted into proper save files.
diff --git a/debian/README.source b/debian/README.source
deleted file mode 100644
index 39a1b2d..0000000
--- a/debian/README.source
+++ /dev/null
@@ -1,4 +0,0 @@
-To use this source package as intended, please install the dpatch package
-and read: /usr/share/doc/dpatch/README.source.gz
-
-   -- Joshua Kwan <joshk at triplehelix.org>
diff --git a/debian/changelog b/debian/changelog
index 95c4195..d17e4a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,38 @@
+nethack (3.4.3-14) unstable; urgency=low
+
+  * Team upload.
+
+  [ Bernhard R. Link ]
+  * switch to "3.0 (quilt)"
+  * bump Standards-Version
+  * modernize debian/rules:
+  - use dpkg-buildflags
+  - support build-arch/-indep
+  - make parallel safe
+  - don't avoid make errors
+  * add patch so it can compile with -Werror=format-security
+  * drop no longer needed patches (-qt and -gnome are gone)
+  * don't use /dev/null as install template (Closes: 644647)
+  * drop nethack-common menu (both -console and -x11 have one)
+
+  [ Vincent Cheng ]
+  * Adopt package. (Closes: #673584)
+    - Change Maintainer to Debian Games Team.
+    - Add myself to Uploaders.
+  * Modify 0006-Common-config.h-for-all-binary-packages.patch to enable
+    AUTOPICKUP_EXCEPTIONS. (Closes: #329318)
+  * Modify 0011-Pasi-Kallinen-s-patch-to-add-colors-to-inventory-ite.patch
+    and 0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch; add
+    0021-fix-kfreebsd-ftbfs.patch to fix FTBFS on kfreebsd.
+  * Convert debian/copyright to DEP-5 machine-readable format.
+  * Use dh_lintian to install overrides instead of manually installing them
+    in debian/rules.
+  * Add watch file.
+  * Add Homepage field in debian/control.
+  * Add Vcs-* fields in debian/control.
+
+ -- Vincent Cheng <Vincentc1208 at gmail.com>  Mon, 11 Jun 2012 00:47:38 -0700
+
 nethack (3.4.3-13) unstable; urgency=low
 
   * QA upload, orphan package.
diff --git a/debian/control b/debian/control
index 74c5bec..4066336 100644
--- a/debian/control
+++ b/debian/control
@@ -1,16 +1,31 @@
 Source: nethack
 Section: games
 Priority: optional
-Maintainer: Debian QA Group <packages at qa.debian.org>
-Standards-Version: 3.8.3.0
-Build-Depends: flex, bison, groff-base, debhelper (>= 7), libx11-dev, libxt-dev, libxext-dev, libxmu-dev, bsdmainutils, libxaw7-dev | libxaw-dev, libncurses5-dev | libncurses-dev, dpatch, po-debconf, xfonts-utils
+Maintainer: Debian Games Team <pkg-games-devel at lists.alioth.debian.org>
+Uploaders: Vincent Cheng <Vincentc1208 at gmail.com>
+Build-Depends:
+ bison,
+ bsdmainutils,
+ debhelper (>= 7),
+ flex,
+ groff-base,
+ libncurses5-dev | libncurses-dev,
+ libx11-dev,
+ libxaw7-dev | libxaw-dev,
+ libxext-dev,
+ libxmu-dev,
+ libxt-dev,
+ po-debconf,
+ xfonts-utils
+Standards-Version: 3.9.3
+Homepage: http://www.nethack.org
+Vcs-Svn: svn://svn.debian.org/svn/pkg-games/packages/trunk/nethack/
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-games/packages/trunk/nethack/
 
 Package: nethack-common
 Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, debianutils (>= 1.12)
+Depends: ${misc:Depends}, ${shlibs:Depends}
 Recommends: nethack-console | nethack-x11
-Conflicts: suidmanager (<< 0.50), nethack-console (<< ${binary:Version}), nethack-x11 (<< ${binary:Version}), nethack-gnome (<< ${binary:Version}), nethack-qt (<< ${binary:Version}), nethack-lisp (<< ${binary:Version})
-Replaces: nethack (<< 3.4.0)
 Description: dungeon crawl game - common files
  NetHack is a wonderfully silly, yet quite addictive, Dungeons &
  Dragons-style adventure game. You play a character from one of many
@@ -39,7 +54,10 @@ Description: dungeon crawl game - common files
  boots, if there are any auto-save files available.
 
 Package: nethack-console
-Depends: ${shlibs:Depends}, ${misc:Depends}, nethack-common (= ${binary:Version})
+Depends:
+ nethack-common (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
 Architecture: any
 Provides: nethack
 Description: dungeon crawl game - text-based interface
@@ -62,7 +80,10 @@ Description: dungeon crawl game - text-based interface
  This package provides the plain console version of NetHack.
 
 Package: nethack-lisp
-Depends: ${shlibs:Depends}, ${misc:Depends}, nethack-common (= ${binary:Version})
+Depends:
+ nethack-common (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
 Suggests: nethack-el
 Architecture: any
 Provides: nethack
@@ -87,7 +108,10 @@ Description: dungeon crawl game - Lisp interface
  Lisp, for instance under Emacs (which requires nethack-el).
 
 Package: nethack-x11
-Depends: ${shlibs:Depends}, ${misc:Depends}, nethack-common (= ${binary:Version})
+Depends:
+ nethack-common (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
 Architecture: any
 Provides: nethack
 Description: dungeon crawl game - X11 interface
diff --git a/debian/copyright b/debian/copyright
index e673a72..3a2cce2 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,135 +1,160 @@
-This package was created by Ben Gertzfield <che at debian.org> on
-Sun, 12 Dec 1999 14:23:01 -0800. It was originally Debianized by
-Paul Haggart <phaggart at debian.org>.
-
-Nethack's home site is: http://www.nethack.org/
-
-This archive was downloaded from:
-http://us.dl.sourceforge.net/sourceforge/nethack/nethack-343-src.tgz
-
-The LISP windowing patch is available from:
-
-http://savannah.nongnu.org/download/nethack-el/
-
-Copyright:
-
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: nethack
+Source: http://sourceforge.net/projects/nethack/files/
+
+Files: *
+Copyright: 1985-2003 Stichting Mathematisch Centrum and M. Stephenson
+License: Nethack-General-Public-License
+
+Files: include/winlisp.h
+       src/windows.c
+       win/tty/termcap.c
+       win/lisp/ChangeLog
+       win/lisp/winlisp.c
+Copyright: 2003-2005 Shawn Betts <sabetts at vcn.bc.ca>
+           2003-2005 Ryan Yeske <rcyeske at gmail.com>
+License: BSD-3-clause
+
+Files: debian/*
+Copyright: 1996-1997 Paul Haggart <phaggart at debian.org>
+           1997-2003 Ben Gertzfield <che at debian.org>
+           2003-2009 Joshua Kwan <joshk at triplehelix.org>
+           2012 Vincent Cheng <Vincentc1208 at gmail.com>
+License: GPL-2.0+
+
+License: BSD-3-clause
+ 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 <organization> 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 <COPYRIGHT HOLDER> 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.
+
+License: GPL-2.0+
+ This package is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ .
+ This package is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
+
+License: Nethack-General-Public-License
                     NETHACK GENERAL PUBLIC LICENSE
                     (Copyright 1989 M. Stephenson)
-.
+ .
                (Based on the BISON general public license,
                    copyright 1988 Richard M. Stallman)
-
+ .
  Everyone is permitted to copy and distribute verbatim copies of this
  license, but changing it is not allowed.  You can also use this wording to
  make the terms for other programs.
-
-  The license agreements of most software companies keep you at the mercy of
-those companies.  By contrast, our general public license is intended to give
-everyone the right to share NetHack.  To make sure that you get the rights we
-want you to have, we need to make restrictions that forbid anyone to deny you
-these rights or to ask you to surrender the rights.  Hence this license
-agreement.
-
-  Specifically, we want to make sure that you have the right to give away
-copies of NetHack, that you receive source code or else can get it if you
-want it, that you can change NetHack or use pieces of it in new free
-programs, and that you know you can do these things.
-
-  To make sure that everyone has such rights, we have to forbid you to
-deprive anyone else of these rights.  For example, if you distribute copies
-of NetHack, you must give the recipients all the rights that you have.  You
-must make sure that they, too, receive or can get the source code.  And you
-must tell them their rights.
-
-  Also, for our own protection, we must make certain that everyone finds out
-that there is no warranty for NetHack.  If NetHack is modified by someone
-else and passed on, we want its recipients to know that what they have is
-not what we distributed.
-
-  Therefore we (Mike Stephenson and other holders of NetHack copyrights) make
-the following terms which say what you must do to be allowed to distribute or
-change NetHack.
-
-
+ .
+ The license agreements of most software companies keep you at the mercy of
+ those companies.  By contrast, our general public license is intended to give
+ everyone the right to share NetHack.  To make sure that you get the rights we
+ want you to have, we need to make restrictions that forbid anyone to deny you
+ these rights or to ask you to surrender the rights.  Hence this license
+ agreement.
+ .
+ Specifically, we want to make sure that you have the right to give away
+ copies of NetHack, that you receive source code or else can get it if you
+ want it, that you can change NetHack or use pieces of it in new free
+ programs, and that you know you can do these things.
+ .
+ To make sure that everyone has such rights, we have to forbid you to
+ deprive anyone else of these rights.  For example, if you distribute copies
+ of NetHack, you must give the recipients all the rights that you have.  You
+ must make sure that they, too, receive or can get the source code.  And you
+ must tell them their rights.
+ .
+ Also, for our own protection, we must make certain that everyone finds out
+ that there is no warranty for NetHack.  If NetHack is modified by someone
+ else and passed on, we want its recipients to know that what they have is
+ not what we distributed.
+ .
+ Therefore we (Mike Stephenson and other holders of NetHack copyrights) make
+ the following terms which say what you must do to be allowed to distribute or
+ change NetHack.
+ .
+ .
                         COPYING POLICIES
-
-  1. You may copy and distribute verbatim copies of NetHack source code as
-you receive it, in any medium, provided that you keep intact the notices on
-all files that refer to copyrights, to this License Agreement, and to the
-absence of any warranty; and give any other recipients of the NetHack
-program a copy of this License Agreement along with the program.
-
-  2. You may modify your copy or copies of NetHack or any portion of it, and
-copy and distribute such modifications under the terms of Paragraph 1 above
-(including distributing this License Agreement), provided that you also do the
-following:
-
+ .
+ 1. You may copy and distribute verbatim copies of NetHack source code as
+ you receive it, in any medium, provided that you keep intact the notices on
+ all files that refer to copyrights, to this License Agreement, and to the
+ absence of any warranty; and give any other recipients of the NetHack
+ program a copy of this License Agreement along with the program.
+ .
+ 2. You may modify your copy or copies of NetHack or any portion of it, and
+ copy and distribute such modifications under the terms of Paragraph 1 above
+ (including distributing this License Agreement), provided that you also do the
+ following:
+ .
     a) cause the modified files to carry prominent notices stating that you
     changed the files and the date of any change; and
-
+ .
     b) cause the whole of any work that you distribute or publish, that in
     whole or in part contains or is a derivative of NetHack or any part
     thereof, to be licensed at no charge to all third parties on terms
     identical to those contained in this License Agreement (except that you
     may choose to grant more extensive warranty protection to some or all
     third parties, at your option)
-
+ .
     c) You may charge a distribution fee for the physical act of
     transferring a copy, and you may at your option offer warranty protection
     in exchange for a fee.
-
-  3. You may copy and distribute NetHack (or a portion or derivative of it,
-under Paragraph 2) in object code or executable form under the terms of
-Paragraphs 1 and 2 above provided that you also do one of the following:
-
+ .
+ 3. You may copy and distribute NetHack (or a portion or derivative of it,
+ under Paragraph 2) in object code or executable form under the terms of
+ Paragraphs 1 and 2 above provided that you also do one of the following:
+ .
     a) accompany it with the complete machine-readable source code, which
     must be distributed under the terms of Paragraphs 1 and 2 above; or,
-
+ .
     b) accompany it with full information as to how to obtain the complete
     machine-readable source code from an appropriate archive site.  (This
     alternative is allowed only for noncommercial distribution.)
-
-For these purposes, complete source code means either the full source
-distribution as originally released over Usenet or updated copies of the
-files in this distribution used to create the object code or executable.
-
-  4. You may not copy, sublicense, distribute or transfer NetHack except as
-expressly provided under this License Agreement.  Any attempt otherwise to
-copy, sublicense, distribute or transfer NetHack is void and your rights to
-use the program under this License agreement shall be automatically
-terminated.  However, parties who have received computer software programs
-from you with this License Agreement will not have their licenses terminated
-so long as such parties remain in full compliance.
-
-
-Stated plainly:  You are permitted to modify NetHack, or otherwise use parts
-of NetHack, provided that you comply with the conditions specified above;
-in particular, your modified NetHack or program containing parts of NetHack
-must remain freely available as provided in this License Agreement.  In
-other words, go ahead and share NetHack, but don't try to stop anyone else
-from sharing it farther.
-
-The lisp-window patch used to build this package comes
-with the following license:
-
-Copyright (c) Shawn Betts, Ryan Yeske, 2001
-
-Redistribution and use in source and binary forms, with or without modification, are permitted
-provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions
-    and the following disclaimer.
- 2. 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.
- 3. The name of the author may not be used to endorse or promote products derived from this
-    software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ .
+ For these purposes, complete source code means either the full source
+ distribution as originally released over Usenet or updated copies of the
+ files in this distribution used to create the object code or executable.
+ .
+ 4. You may not copy, sublicense, distribute or transfer NetHack except as
+ expressly provided under this License Agreement.  Any attempt otherwise to
+ copy, sublicense, distribute or transfer NetHack is void and your rights to
+ use the program under this License agreement shall be automatically
+ terminated.  However, parties who have received computer software programs
+ from you with this License Agreement will not have their licenses terminated
+ so long as such parties remain in full compliance.
+ .
+ Stated plainly:  You are prohibited by the terms of this License Agreement
+ from using NetHack for gainful purposes.  You are permitted to modify
+ NetHack, or otherwise use parts of NetHack, provided that you comply with
+ the conditions specified above; in particular, your modified NetHack or
+ program containing parts of NetHack must remain freely available as provided
+ in this License Agreement.  In other words, go ahead and share NetHack, but
+ don't try to stop anyone else from sharing it farther.
diff --git a/debian/gnome/nethack-tty.sh b/debian/gnome/nethack-tty.sh
deleted file mode 100644
index a38a877..0000000
--- a/debian/gnome/nethack-tty.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-set -e
-
-HACKSTYLE=gnome
-
-if [ -z "$NETHACKOPTIONS" ]; then
-  if [ -e $HOME/.nethackrc ]; then
-    NETHACKOPTIONS=$HOME/.nethackrc
-    export NETHACKOPTIONS
-  else
-    NETHACKOPTIONS=/etc/nethack/nethackrc.tty
-    export NETHACKOPTIONS
-  fi
-fi
-
-HACKDIR=/usr/lib/games/nethack
-export HACKDIR
-HACK=$HACKDIR/nethack-$HACKSTYLE
-
-# see if we can find the full path name of PAGER, so help files work properly
-# assume that if someone sets up a special variable (HACKPAGER) for NetHack,
-# it will already be in a form acceptable to NetHack
-# ideas from brian at radio.astro.utoronto.ca
-if test \( "xxx$PAGER" != xxx \) -a \( "xxx$HACKPAGER" = xxx \)
-then
-
-        HACKPAGER=$PAGER
-
-#       use only the first word of the pager variable
-#       this prevents problems when looking for file names with trailing
-#       options, but also makes the options unavailable for later use from
-#       NetHack
-        for i in $HACKPAGER
-        do
-                HACKPAGER=$i
-                break
-        done
-
-        if test ! -f $HACKPAGER
-        then
-                IFS=:
-                for i in $PATH
-                do
-                        if test -f $i/$HACKPAGER
-                        then
-                                HACKPAGER=$i/$HACKPAGER
-                                export HACKPAGER
-                                break
-                        fi
-                done
-                IFS='   '
-        fi
-        if test ! -f $HACKPAGER
-        then
-                echo Cannot find $PAGER -- unsetting PAGER.
-                unset HACKPAGER
-                unset PAGER
-        fi
-fi
-
-cd $HACKDIR
-
-exec $HACK "$@" $ARGS
diff --git a/debian/gnome/nethack.sh b/debian/gnome/nethack.sh
deleted file mode 100644
index 5d02e8d..0000000
--- a/debian/gnome/nethack.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-set -e
-
-HACKSTYLE=gnome
-
-if [ -z "$NETHACKOPTIONS" ]; then
-  if [ -e $HOME/.nethackrc.$HACKSTYLE ]; then
-    NETHACKOPTIONS=$HOME/.nethackrc.$HACKSTYLE
-    export NETHACKOPTIONS
-  elif [ -e $HOME/.nethackrc ]; then
-    NETHACKOPTIONS=$HOME/.nethackrc
-    export NETHACKOPTIONS
-  else
-    NETHACKOPTIONS=/etc/nethack/nethackrc.$HACKSTYLE
-    export NETHACKOPTIONS
-  fi
-fi
-
-HACKDIR=/usr/lib/games/nethack
-export HACKDIR
-HACK=$HACKDIR/nethack-$HACKSTYLE
-
-cd $HACKDIR
-
-export OVERRIDEWIN=$HACKSTYLE
-
-exec $HACK "$@" $ARGS
diff --git a/debian/gnome/nethackrc b/debian/gnome/nethackrc
deleted file mode 100644
index 19ba4ca..0000000
--- a/debian/gnome/nethackrc
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# System-wide NetHack configuration file for Gnome-based NetHack.
-#
-
-OPTIONS=windowtype:gnome,toptenwin,hilite_pet,!number_pad
-OPTIONS=fixinv,safe_pet,sortpack,tombstone,color
-OPTIONS=verbose,news,fruit:potato
-OPTIONS=dogname:Slinky
-OPTIONS=catname:Rex
-OPTIONS=pickup_types:$
-OPTIONS=nomail,ignintr
-OPTIONS=menustyle:partial,!time,showexp
-OPTIONS=msghistory:200
-
-# Enable this if you want to see your inventory sorted in alphabetical
-# order by item instead of by index letter:
-# OPTIONS=sortloot:full
-# or if you just want containers sorted:
-# OPTIONS=sortloot:loot
-
-
diff --git a/debian/nethack-common.lintian-overrides b/debian/nethack-common.lintian-overrides
new file mode 100644
index 0000000..1bc5477
--- /dev/null
+++ b/debian/nethack-common.lintian-overrides
@@ -0,0 +1 @@
+nethack-common: non-standard-game-executable-perm usr/lib/games/nethack/recover 0755 != 2755
diff --git a/debian/nethack-common.menu b/debian/nethack-common.menu
deleted file mode 100644
index 154fc33..0000000
--- a/debian/nethack-common.menu
+++ /dev/null
@@ -1,6 +0,0 @@
-?package(nethack-common):command="/usr/games/nethack" \
-	needs="text" \
-	hints="Roguelike,Maze,Dungeon" \
-	section="Games/Adventure" \
-	title="NetHack" \
-	icon="/usr/share/pixmaps/nethack.xpm"
diff --git a/debian/nethack-common.postinst b/debian/nethack-common.postinst
index bf9d614..bed9013 100644
--- a/debian/nethack-common.postinst
+++ b/debian/nethack-common.postinst
@@ -50,7 +50,9 @@ if [ "$1" = "configure" ]; then
     
     for file in perm record logfile; do
       if [ ! -e /var/games/nethack/$file ]; then
-	  	install -m 0664 -o root -g games /dev/null /var/games/nethack/$file
+		touch /var/games/nethack/$file
+		chmod 0664 /var/games/nethack/$file
+		chown root:games /var/games/nethack/$file
 	  fi
     done
 
diff --git a/debian/nethack-gnome.dirs b/debian/nethack-gnome.dirs
deleted file mode 100644
index 8d83606..0000000
--- a/debian/nethack-gnome.dirs
+++ /dev/null
@@ -1,5 +0,0 @@
-etc/nethack
-usr/games
-usr/lib/games/nethack
-usr/share/man/man6
-usr/share/pixmaps/nethack
diff --git a/debian/nethack-gnome.links b/debian/nethack-gnome.links
deleted file mode 100644
index 5a4c125..0000000
--- a/debian/nethack-gnome.links
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/lib/games/nethack/nethack-gnome.sh usr/games/nethack-gnome
-usr/share/man/man6/nethack.6.gz usr/share/man/man6/nethack-gnome.6.gz
diff --git a/debian/nethack-gnome.menu b/debian/nethack-gnome.menu
deleted file mode 100644
index 7ef0251..0000000
--- a/debian/nethack-gnome.menu
+++ /dev/null
@@ -1,6 +0,0 @@
-?package(nethack-gnome):needs="x11" \
-        command="/usr/games/nethack-gnome" \
-	hints="Roguelike,Maze,Dungeon" \
-        section="Games/Adventure" \
-	title="GNOME NetHack" \
-	icon="/usr/share/pixmaps/nethack.xpm"
diff --git a/debian/nethack-gnome.postinst b/debian/nethack-gnome.postinst
deleted file mode 100644
index a75b04b..0000000
--- a/debian/nethack-gnome.postinst
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-
-update-alternatives --install /usr/games/nethack nethack \
-  /usr/lib/games/nethack/nethack-gnome-tty.sh 60
-
-update-alternatives --install /usr/games/nethack nethack \
-  /usr/lib/games/nethack/nethack-gnome.sh 50
-
-#DEBHELPER#
diff --git a/debian/nethack-gnome.prerm b/debian/nethack-gnome.prerm
deleted file mode 100644
index 9258378..0000000
--- a/debian/nethack-gnome.prerm
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-
-update-alternatives --remove nethack /usr/lib/games/nethack/nethack-gnome.sh
-update-alternatives --remove nethack /usr/lib/games/nethack/nethack-gnome-tty.sh
-
-#DEBHELPER#
diff --git a/debian/nethack-x11.desktop b/debian/nethack-x11.desktop
index 54919f0..6745d24 100644
--- a/debian/nethack-x11.desktop
+++ b/debian/nethack-x11.desktop
@@ -1,6 +1,5 @@
 [Desktop Entry]
 Type=Application
-Encoding=UTF-8
 Name=X NetHack
 GenericName=NetHack (X interface)
 Comment=
diff --git a/debian/overrides/lintian/nethack-common b/debian/overrides/lintian/nethack-common
deleted file mode 100644
index a70a908..0000000
--- a/debian/overrides/lintian/nethack-common
+++ /dev/null
@@ -1,2 +0,0 @@
-nethack-common: menu-command-not-in-package /usr/lib/menu/nethack-common:6 /usr/games/nethack
-nethack-common: non-standard-game-executable-perm usr/lib/games/nethack/recover 0755 != 2755
diff --git a/debian/overrides/lintian/nethack-console b/debian/overrides/lintian/nethack-console
deleted file mode 100644
index 19527c3..0000000
--- a/debian/overrides/lintian/nethack-console
+++ /dev/null
@@ -1 +0,0 @@
-nethack-console: menu-icon-missing /usr/share/pixmaps/nethack.xpm
diff --git a/debian/overrides/lintian/nethack-gnome b/debian/overrides/lintian/nethack-gnome
deleted file mode 100644
index 5ca9653..0000000
--- a/debian/overrides/lintian/nethack-gnome
+++ /dev/null
@@ -1 +0,0 @@
-nethack-gnome: menu-icon-missing /usr/share/pixmaps/nethack.xpm
diff --git a/debian/overrides/lintian/nethack-lisp b/debian/overrides/lintian/nethack-lisp
deleted file mode 100644
index d4a3829..0000000
--- a/debian/overrides/lintian/nethack-lisp
+++ /dev/null
@@ -1,2 +0,0 @@
-nethack-lisp: non-standard-executable-perm usr/lib/games/nethack/nethack-lisp.sh 0755 != 2755
-nethack-gnome: non-standard-executable-perm usr/lib/games/nethack/nethack-gnome.sh 0755 != 2755
diff --git a/debian/overrides/lintian/nethack-qt b/debian/overrides/lintian/nethack-qt
deleted file mode 100644
index 6f98812..0000000
--- a/debian/overrides/lintian/nethack-qt
+++ /dev/null
@@ -1 +0,0 @@
-nethack-qt: menu-icon-missing /usr/share/pixmaps/nethack.xpm
diff --git a/debian/overrides/lintian/nethack-x11 b/debian/overrides/lintian/nethack-x11
deleted file mode 100644
index 213510f..0000000
--- a/debian/overrides/lintian/nethack-x11
+++ /dev/null
@@ -1 +0,0 @@
-nethack-x11: menu-icon-missing /usr/share/pixmaps/nethack.xpm
diff --git a/debian/patches/02_SECURITY_recover_secure.dpatch b/debian/patches/0001-Make-sure-the-user-calling-recover-owns-the-file.patch
similarity index 69%
rename from debian/patches/02_SECURITY_recover_secure.dpatch
rename to debian/patches/0001-Make-sure-the-user-calling-recover-owns-the-file.patch
index b5aae95..3feb5dc 100644
--- a/debian/patches/02_SECURITY_recover_secure.dpatch
+++ b/debian/patches/0001-Make-sure-the-user-calling-recover-owns-the-file.patch
@@ -1,25 +1,16 @@
-#! /bin/sh -e
-## 02_SECURITY_recover_secure.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Make sure the user calling recover owns the file.
+From 859d2d7416614a16a0d23835a512792ccbdad0bb Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Mon, 13 Nov 2006 17:42:00 -0800
+Subject: Make sure the user calling recover owns the file.
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ util/recover.c |   48 ++++++++++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 46 insertions(+), 2 deletions(-)
 
-exit 0
-
---- nethack-3.4.1.orig/util/recover.c
-+++ nethack-3.4.1/util/recover.c
+diff --git a/util/recover.c b/util/recover.c
+index cc1b819..5bb9f2f 100644
+--- a/util/recover.c
++++ b/util/recover.c
 @@ -16,6 +16,12 @@
  #include "win32api.h"
  #endif
@@ -33,7 +24,7 @@ exit 0
  #ifdef VMS
  extern int FDECL(vms_creat, (const char *,unsigned));
  extern int FDECL(vms_open, (const char *,int,unsigned));
-@@ -107,15 +113,23 @@
+@@ -107,15 +113,23 @@ char *argv[];
  	}
  #if defined(SECURE) && !defined(VMS)
  	if (dir
@@ -59,7 +50,7 @@ exit 0
  #ifdef HACKDIR
  	if (!dir) dir = HACKDIR;
  #endif
-@@ -158,11 +172,19 @@
+@@ -158,11 +172,19 @@ int lev;
  #endif
  }
  
@@ -79,7 +70,7 @@ exit 0
  
  	set_levelfile_name(lev);
  #if defined(MICRO) || defined(WIN32) || defined(MSDOS)
-@@ -170,6 +192,21 @@
+@@ -170,6 +192,21 @@ int lev;
  #else
  	fd = open(lock, O_RDONLY, 0);
  #endif
@@ -101,7 +92,7 @@ exit 0
  	return fd;
  }
  
-@@ -183,6 +220,13 @@
+@@ -183,6 +220,13 @@ create_savefile()
  #else
  	fd = creat(savename, FCMASK);
  #endif
diff --git a/debian/patches/04_manpage_paths.dpatch b/debian/patches/0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch
similarity index 69%
rename from debian/patches/04_manpage_paths.dpatch
rename to debian/patches/0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch
index 8874f00..055426b 100644
--- a/debian/patches/04_manpage_paths.dpatch
+++ b/debian/patches/0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch
@@ -1,25 +1,18 @@
-#! /bin/sh -e
-## 04_manpage_paths.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Change paths in the default manpage to what is used in Debian + other stuff.
+From 2fb7fc3c993424e594cf7753777e94d615f72901 Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Change paths in the default manpage to what is used in Debian +
+ other stuff.
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ doc/nethack.6 |   13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
 
-exit 0
---- nethack-3.4.1.orig/doc/nethack.6
-+++ nethack-3.4.1/doc/nethack.6
-@@ -108,9 +108,10 @@
+diff --git a/doc/nethack.6 b/doc/nethack.6
+index 7bc2f94..63ebf40 100644
+--- a/doc/nethack.6
++++ b/doc/nethack.6
+@@ -108,9 +108,10 @@ Because the option list can be very long (particularly when specifying
  graphics characters), options may also be included in a configuration
  file.
  The default is located in your home directory and
@@ -33,7 +26,7 @@ exit 0
  The configuration file's location may be specified by setting NETHACKOPTIONS
  to a string consisting of an @ character followed by the filename.
  .PP
-@@ -197,7 +198,7 @@
+@@ -197,7 +198,7 @@ option, which must be the first argument if it appears,
  supplies a directory which is to serve as the playground.
  It overrides the value from NETHACKDIR, HACKDIR,
  or the directory specified by the game administrator during compilation
@@ -42,7 +35,7 @@ exit 0
  This option is usually only useful to the game administrator.
  The playground must contain several auxiliary files such as help files,
  the list of top scorers, and a subdirectory
-@@ -222,7 +223,7 @@
+@@ -222,7 +223,7 @@ development by the Usenet.  Andries Brouwer has made this request for the
  distinction, as he may eventually release a new version of his own.
  .SH FILES
  .PP
@@ -51,7 +44,7 @@ exit 0
  If DLB was defined during the compile, the data files and special levels
  will be inside a larger file, normally nhdat, instead of being separate
  files.
-@@ -283,7 +284,7 @@
+@@ -283,7 +284,7 @@ MAIL	Mailbox file.
  .br
  MAILREADER	Replacement for default reader
  .br
@@ -59,3 +52,4 @@ exit 0
 +	(probably /usr/bin/mail).
  .br
  NETHACKDIR	Playground.
+ .br
diff --git a/debian/patches/0003-Define-_GNU_SOURCE-for-RTLD_NEXT.patch b/debian/patches/0003-Define-_GNU_SOURCE-for-RTLD_NEXT.patch
new file mode 100644
index 0000000..448eaf0
--- /dev/null
+++ b/debian/patches/0003-Define-_GNU_SOURCE-for-RTLD_NEXT.patch
@@ -0,0 +1,21 @@
+From 66de1ffa3817ecc98617671b829f031c83bf740b Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Define _GNU_SOURCE for RTLD_NEXT.
+
+---
+ sys/unix/unixres.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sys/unix/unixres.c b/sys/unix/unixres.c
+index 3e7f989..a6ac959 100644
+--- a/sys/unix/unixres.c
++++ b/sys/unix/unixres.c
+@@ -21,6 +21,7 @@
+ # if defined(LINUX)
+ 
+ /* requires dynamic linking with libc */
++#define _GNU_SOURCE
+ #include <dlfcn.h>
+ 
+ static int
diff --git a/debian/patches/12_lisp_windowing.dpatch b/debian/patches/0004-Add-LISP-based-windowing-system.patch
similarity index 96%
rename from debian/patches/12_lisp_windowing.dpatch
rename to debian/patches/0004-Add-LISP-based-windowing-system.patch
index 3f01ca2..8a78d9f 100644
--- a/debian/patches/12_lisp_windowing.dpatch
+++ b/debian/patches/0004-Add-LISP-based-windowing-system.patch
@@ -1,44 +1,24 @@
-#! /bin/sh -e
-## 12_lisp_windowing.dpatch by Ben Gertzfield <che at debian.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Add LISP-based windowing system
+From 83199fe0ca33c2442d3ea6cb26f62561ce812a41 Mon Sep 17 00:00:00 2001
+From: Ben Gertzfield <che at debian.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Add LISP-based windowing system
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ include/winlisp.h  |   70 ++
+ src/windows.c      |    7 +
+ win/lisp/ChangeLog |  326 +++++++++
+ win/lisp/winlisp.c | 1937 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ win/tty/termcap.c  |    5 +
+ 5 files changed, 2345 insertions(+)
+ create mode 100644 include/winlisp.h
+ create mode 100644 win/lisp/ChangeLog
+ create mode 100644 win/lisp/winlisp.c
 
-exit 0
-
-Redistribution and use in source and binary forms, with or without modification, are permitted
-provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions
-    and the following disclaimer.
- 2. 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.
- 3. The name of the author may not be used to endorse or promote products derived from this
-    software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
---- /dev/null	2005-02-27 18:01:13.000000000 -0500
-+++ nethack/include/winlisp.h	2002-01-10 22:54:20.000000000 -0500
+diff --git a/include/winlisp.h b/include/winlisp.h
+new file mode 100644
+index 0000000..f1815b7
+--- /dev/null
++++ b/include/winlisp.h
 @@ -0,0 +1,70 @@
 +#ifndef WINLISP_H
 +#define WINLISP_H
@@ -110,9 +90,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 +E void FDECL(lisp_outrip, (winid,int));
 +
 +#endif /* WINLISP_H */
---- nethack-3.4.3/src/windows.c	2003-12-07 18:39:13.000000000 -0500
-+++ nethack/src/windows.c	2002-04-23 20:44:58.000000000 -0400
-@@ -40,6 +40,10 @@
+diff --git a/src/windows.c b/src/windows.c
+index 3c59080..d65710c 100644
+--- a/src/windows.c
++++ b/src/windows.c
+@@ -40,6 +40,10 @@ extern struct window_procs Gnome_procs;
  #ifdef MSWIN_GRAPHICS
  extern struct window_procs mswin_procs;
  #endif
@@ -123,7 +105,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  
  STATIC_DCL void FDECL(def_raw_print, (const char *s));
  
-@@ -81,6 +85,9 @@
+@@ -81,6 +85,9 @@ struct win_choices {
  #ifdef MSWIN_GRAPHICS
      { &mswin_procs, 0 },
  #endif
@@ -133,22 +115,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
      { 0, 0 }		/* must be last */
  };
  
---- nethack-3.4.3/win/tty/termcap.c	2003-12-07 18:39:14.000000000 -0500
-+++ nethack/win/tty/termcap.c	2005-02-27 21:00:20.000000000 -0500
-@@ -1164,6 +1164,11 @@
- 	if (windowprocs.name != NULL &&
- 	    !strcmpi(windowprocs.name, "Gem")) return TRUE;
- #endif
-+#ifdef LISP_GRAPHICS
-+	/* XXX has_color() should be added to windowprocs */
-+	if (windowprocs.name != NULL &&
-+	    !strcmpi(windowprocs.name, "lisp")) return TRUE;
-+#endif
- #ifdef QT_GRAPHICS
- 	/* XXX has_color() should be added to windowprocs */
- 	if (windowprocs.name != NULL &&
---- /dev/null	2005-02-27 18:01:13.000000000 -0500
-+++ nethack/win/lisp/ChangeLog	2005-02-27 21:04:31.000000000 -0500
+diff --git a/win/lisp/ChangeLog b/win/lisp/ChangeLog
+new file mode 100644
+index 0000000..8686f14
+--- /dev/null
++++ b/win/lisp/ChangeLog
 @@ -0,0 +1,326 @@
 +2005-02-27    <katia_dilkina at verizon.net>
 +
@@ -476,8 +447,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 +	s/nethack-api-updated-inventory/nethack-api-update-inventory/
 +	(WINLISP_VOID_RETVAL): added macro, called for every void
 +	function.
---- /dev/null	2005-02-27 18:01:13.000000000 -0500
-+++ nethack/win/lisp/winlisp.c	2005-02-27 21:04:38.000000000 -0500
+diff --git a/win/lisp/winlisp.c b/win/lisp/winlisp.c
+new file mode 100644
+index 0000000..290a457
+--- /dev/null
++++ b/win/lisp/winlisp.c
 @@ -0,0 +1,1937 @@
 +/* Copyright (c) Shawn Betts, Ryan Yeske, 2001                    */
 +/* NetHack may be freely redistributed.  See license for details. */
@@ -2416,3 +2390,19 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 +	    lisp_int (u.ugold);
 +	    lisp_string ("Died while trying to finish nethack-el."));
 +}
+diff --git a/win/tty/termcap.c b/win/tty/termcap.c
+index 706e203..00014d0 100644
+--- a/win/tty/termcap.c
++++ b/win/tty/termcap.c
+@@ -1164,6 +1164,11 @@ int color;
+ 	if (windowprocs.name != NULL &&
+ 	    !strcmpi(windowprocs.name, "Gem")) return TRUE;
+ #endif
++#ifdef LISP_GRAPHICS
++	/* XXX has_color() should be added to windowprocs */
++	if (windowprocs.name != NULL &&
++	    !strcmpi(windowprocs.name, "lisp")) return TRUE;
++#endif
+ #ifdef QT_GRAPHICS
+ 	/* XXX has_color() should be added to windowprocs */
+ 	if (windowprocs.name != NULL &&
diff --git a/debian/patches/13_simple_mail.dpatch b/debian/patches/0005-Simple-mail.patch
similarity index 68%
rename from debian/patches/13_simple_mail.dpatch
rename to debian/patches/0005-Simple-mail.patch
index 389d03f..79db7e3 100644
--- a/debian/patches/13_simple_mail.dpatch
+++ b/debian/patches/0005-Simple-mail.patch
@@ -1,27 +1,21 @@
-#! /bin/sh -e
-## 13_simple_mail.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Simple mail
+From c3567da0cb29043180b24543f883454312c8f17f Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Simple mail
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --dry-run -p1 < $0 && patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --dry-run -R -p1 < $0 && patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ include/decl.h      |    4 +++
+ include/flag.h      |    3 ++
+ include/unixconf.h  |    1 -
+ src/mail.c          |   96 ++++++++++++++++++++++++++++++++++++++++++++-------
+ sys/unix/unixmain.c |   10 +++++-
+ 5 files changed, 99 insertions(+), 15 deletions(-)
 
-exit 0
-
-diff -urN orig/nethack-3.4.3/include/decl.h nethack-3.4.3/include/decl.h
---- orig/nethack-3.4.3/include/decl.h	2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/include/decl.h	2004-01-03 15:57:34.000000000 -0800
-@@ -385,6 +385,10 @@
+diff --git a/include/decl.h b/include/decl.h
+index 76f9533..ab650d3 100644
+--- a/include/decl.h
++++ b/include/decl.h
+@@ -385,6 +385,10 @@ struct autopickup_exception {
  };
  #endif /* AUTOPICKUP_EXCEPTIONS */
  
@@ -32,10 +26,11 @@ diff -urN orig/nethack-3.4.3/include/decl.h nethack-3.4.3/include/decl.h
  #undef E
  
  #endif /* DECL_H */
-diff -urN orig/nethack-3.4.3/include/flag.h nethack-3.4.3/include/flag.h
---- orig/nethack-3.4.3/include/flag.h	2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/include/flag.h	2004-01-03 15:57:34.000000000 -0800
-@@ -175,6 +175,9 @@
+diff --git a/include/flag.h b/include/flag.h
+index 1807a0b..de149ff 100644
+--- a/include/flag.h
++++ b/include/flag.h
+@@ -175,6 +175,9 @@ struct instance_flags {
  	uchar	bouldersym;	/* symbol for boulder display */
  	boolean travel1;	/* first travel step */
  	coord	travelcc;	/* coordinates for travel_cache */
@@ -45,9 +40,10 @@ diff -urN orig/nethack-3.4.3/include/flag.h nethack-3.4.3/include/flag.h
  #ifdef WIZARD
  	boolean  sanity_check;	/* run sanity checks */
  	boolean  mon_polycontrol;	/* debug: control monster polymorphs */
-diff -urN orig/nethack-3.4.3/include/unixconf.h nethack-3.4.3/include/unixconf.h
---- orig/nethack-3.4.3/include/unixconf.h	2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/include/unixconf.h	2004-01-03 15:57:34.000000000 -0800
+diff --git a/include/unixconf.h b/include/unixconf.h
+index fe1b006..414938a 100644
+--- a/include/unixconf.h
++++ b/include/unixconf.h
 @@ -193,7 +193,6 @@
  # endif
  #endif
@@ -56,9 +52,10 @@ diff -urN orig/nethack-3.4.3/include/unixconf.h nethack-3.4.3/include/unixconf.h
  #endif	/* MAIL */
  
  
-diff -urN orig/nethack-3.4.3/src/mail.c nethack-3.4.3/src/mail.c
---- orig/nethack-3.4.3/src/mail.c	2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/src/mail.c	2004-01-03 16:07:21.000000000 -0800
+diff --git a/src/mail.c b/src/mail.c
+index 99d7637..9b1e4f6 100644
+--- a/src/mail.c
++++ b/src/mail.c
 @@ -5,6 +5,8 @@
  #include "hack.h"
  
@@ -68,7 +65,7 @@ diff -urN orig/nethack-3.4.3/src/mail.c nethack-3.4.3/src/mail.c
  #include "mail.h"
  
  /*
-@@ -36,6 +38,8 @@
+@@ -36,6 +38,8 @@ STATIC_DCL boolean FDECL(md_stop,(coord *, coord *));
  STATIC_DCL boolean FDECL(md_rush,(struct monst *,int,int));
  STATIC_DCL void FDECL(newmail, (struct mail_info *));
  
@@ -77,7 +74,7 @@ diff -urN orig/nethack-3.4.3/src/mail.c nethack-3.4.3/src/mail.c
  extern char *viz_rmin, *viz_rmax;	/* line-of-sight limits (vision.c) */
  
  #ifdef OVL0
-@@ -464,11 +468,15 @@
+@@ -464,11 +468,15 @@ struct obj *otmp;
  void
  ckmailstatus()
  {
@@ -97,7 +94,7 @@ diff -urN orig/nethack-3.4.3/src/mail.c nethack-3.4.3/src/mail.c
  		return;
  
  	laststattime = moves;
-@@ -501,9 +509,68 @@
+@@ -501,9 +509,68 @@ void
  readmail(otmp)
  struct obj *otmp;
  {
@@ -167,7 +164,7 @@ diff -urN orig/nethack-3.4.3/src/mail.c nethack-3.4.3/src/mail.c
  	display_nhwindow(WIN_MESSAGE, FALSE);
  	if(!(mr = nh_getenv("MAILREADER")))
  		mr = DEF_MAILREADER;
-@@ -512,15 +578,21 @@
+@@ -512,15 +579,21 @@ struct obj *otmp;
  		(void) execl(mr, mr, (char *)0);
  		terminate(EXIT_FAILURE);
  	}
@@ -193,7 +190,7 @@ diff -urN orig/nethack-3.4.3/src/mail.c nethack-3.4.3/src/mail.c
  }
  
  # endif /* UNIX */
-@@ -587,10 +659,7 @@
+@@ -587,10 +660,7 @@ ckmailstatus()
  	static int laststattime = 0;
  	
  	if(u.uswallow || !flags.biff
@@ -205,10 +202,11 @@ diff -urN orig/nethack-3.4.3/src/mail.c nethack-3.4.3/src/mail.c
  		return;
  
  	laststattime = moves;
-diff -urN orig/nethack-3.4.3/sys/unix/unixmain.c nethack-3.4.3/sys/unix/unixmain.c
---- orig/nethack-3.4.3/sys/unix/unixmain.c	2003-12-07 15:39:13.000000000 -0800
-+++ nethack-3.4.3/sys/unix/unixmain.c	2004-01-03 15:57:34.000000000 -0800
-@@ -54,7 +54,9 @@
+diff --git a/sys/unix/unixmain.c b/sys/unix/unixmain.c
+index a13514f..f88c2e1 100644
+--- a/sys/unix/unixmain.c
++++ b/sys/unix/unixmain.c
+@@ -54,7 +54,9 @@ char *argv[];
  	register char *dir;
  #endif
  	boolean exact_username;
@@ -219,7 +217,7 @@ diff -urN orig/nethack-3.4.3/sys/unix/unixmain.c nethack-3.4.3/sys/unix/unixmain
  #if defined(__APPLE__)
  	/* special hack to change working directory to a resource fork when
  	   running from finder --sam */
-@@ -84,6 +86,12 @@
+@@ -84,6 +86,12 @@ char *argv[];
  	}
  #endif
  
diff --git a/debian/patches/14_common_config.dpatch b/debian/patches/0006-Common-config.h-for-all-binary-packages.patch
similarity index 81%
rename from debian/patches/14_common_config.dpatch
rename to debian/patches/0006-Common-config.h-for-all-binary-packages.patch
index f019a1b..a43a8f5 100644
--- a/debian/patches/14_common_config.dpatch
+++ b/debian/patches/0006-Common-config.h-for-all-binary-packages.patch
@@ -1,30 +1,14 @@
-#! /bin/sh -e
-## 14_common_config.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Common config.h for all binary packages.
+From 3bdca15dac9e56d0ebad744734619a96806b9691 Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Common config.h for all binary packages.
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p0 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ include/config.h |   34 ++++++++++++++++++----------------
+ 1 file changed, 18 insertions(+), 16 deletions(-)
 
-exit 0
-
-Index: include/config.h
-===================================================================
-RCS file: /cvsroot/pkg-nethack/nethack/include/config.h,v
-retrieving revision 1.2
-diff -u -r1.2 config.h
---- include/config.h	9 Dec 2003 16:14:43 -0000	1.2
-+++ include/config.h	9 Dec 2003 16:33:15 -0000
+--- a/include/config.h
++++ b/include/config.h
 @@ -42,12 +42,19 @@
   * Define all of those you want supported in your binary.
   * Some combinations make no sense.  See the installation document.
@@ -128,7 +112,7 @@ diff -u -r1.2 config.h
  
  /*
   * If it is desirable to limit the number of people that can play Hack
-@@ -338,6 +338,7 @@
+@@ -338,6 +339,7 @@
  #endif
  
  #define EXP_ON_BOTL	/* Show experience on bottom line */
@@ -136,3 +120,12 @@ diff -u -r1.2 config.h
  /* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson at ucivax) */
  
  /*
+@@ -349,7 +351,7 @@
+  */
+ 
+ /*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
+-/*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
++#define AUTOPICKUP_EXCEPTIONS  /* exceptions to autopickup */
+ 
+ /* End of Section 5 */
+ 
diff --git a/debian/patches/15_recover_errormsg.dpatch b/debian/patches/0007-Be-a-little-bit-more-useful-with-recover-s-error-mes.patch
similarity index 71%
rename from debian/patches/15_recover_errormsg.dpatch
rename to debian/patches/0007-Be-a-little-bit-more-useful-with-recover-s-error-mes.patch
index 67aca13..e748284 100644
--- a/debian/patches/15_recover_errormsg.dpatch
+++ b/debian/patches/0007-Be-a-little-bit-more-useful-with-recover-s-error-mes.patch
@@ -1,26 +1,17 @@
-#! /bin/sh -e
-## 15_recover_errormsg.dpatch by Ian Jackson <sysadmin at chiark.greenend.org.uk>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Be a little bit more useful with recover's error messages
+From 79479bd8fb3fb6818f0c0ea08c192012b6f29a0a Mon Sep 17 00:00:00 2001
+From: Ian Jackson <sysadmin at chiark.greenend.org.uk>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Be a little bit more useful with recover's error messages
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ util/recover.c |   23 +++++++++++++++--------
+ 1 file changed, 15 insertions(+), 8 deletions(-)
 
-exit 0
-
---- nethack/util/recover.c~	2003-10-18 16:08:36.000000000 -0700
-+++ nethack/util/recover.c	2003-10-18 16:18:46.000000000 -0700
-@@ -39,7 +39,7 @@
+diff --git a/util/recover.c b/util/recover.c
+index 5bb9f2f..183474e 100644
+--- a/util/recover.c
++++ b/util/recover.c
+@@ -39,7 +39,7 @@ void FDECL(copy_bytes, (int,int));
  #define Fprintf	(void)nhce_message
  static void nhce_message(FILE*, const char*, ...);
  #endif
@@ -29,7 +20,7 @@ exit 0
  #define Close	(void)close
  
  #ifdef UNIX
-@@ -65,6 +65,7 @@
+@@ -65,6 +65,7 @@ extern unsigned _stklen = STKSIZ;
  #endif
  char savename[SAVESIZE]; /* holds relative path of save file from playground */
  
@@ -37,7 +28,7 @@ exit 0
  
  int
  main(argc, argv)
-@@ -72,7 +73,6 @@
+@@ -72,7 +73,6 @@ int argc;
  char *argv[];
  {
  	int argno;
@@ -45,7 +36,7 @@ exit 0
  #ifdef AMIGA
  	char *startdir = (char *)0;
  #endif
-@@ -138,7 +138,8 @@
+@@ -138,7 +138,8 @@ char *argv[];
  	startdir = getcwd(0,255);
  #endif
  	if (dir && chdir((char *) dir) < 0) {
@@ -55,7 +46,7 @@ exit 0
  		exit(EXIT_FAILURE);
  	}
  
-@@ -275,7 +276,9 @@
+@@ -275,7 +276,9 @@ char *basename;
  	  	Fprintf(stderr,
  			"\nTrouble accessing level 0 (errno = %d).\n", errno);
  #endif
@@ -66,7 +57,7 @@ exit 0
  	    return(-1);
  	}
  	if (read(gfd, (genericptr_t) &hpid, sizeof hpid) != sizeof hpid) {
-@@ -297,7 +300,8 @@
+@@ -297,7 +300,8 @@ char *basename;
  		!= sizeof savename) ||
  	    (read(gfd, (genericptr_t) &version_data, sizeof version_data)
  		!= sizeof version_data)) {
@@ -76,7 +67,7 @@ exit 0
  	    Close(gfd);
  	    return(-1);
  	}
-@@ -310,14 +314,16 @@
+@@ -310,14 +314,16 @@ char *basename;
  	 */
  	sfd = create_savefile();
  	if (sfd < 0) {
@@ -95,7 +86,7 @@ exit 0
  	    Close(gfd);
  	    Close(sfd);
  	    return(-1);
-@@ -325,7 +331,8 @@
+@@ -325,7 +331,8 @@ char *basename;
  
  	if (write(sfd, (genericptr_t) &version_data, sizeof version_data)
  		!= sizeof version_data) {
diff --git a/debian/patches/0008-Use-usr-share-pixmaps-nethack-for-pretty-pictures.patch b/debian/patches/0008-Use-usr-share-pixmaps-nethack-for-pretty-pictures.patch
new file mode 100644
index 0000000..f10842b
--- /dev/null
+++ b/debian/patches/0008-Use-usr-share-pixmaps-nethack-for-pretty-pictures.patch
@@ -0,0 +1,28 @@
+From 77d8972a0dfdd46bd7ad3661e0d0a2f39b8a253f Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Use /usr/share/pixmaps/nethack/ for pretty pictures.
+
+---
+ win/X11/winX.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/win/X11/winX.c b/win/X11/winX.c
+index 14f0e90..1c5d49b 100644
+--- a/win/X11/winX.c
++++ b/win/X11/winX.c
+@@ -919,12 +919,12 @@ static XtResource resources[] = {
+     { "message_lines", "Message_lines", XtRInt, sizeof(int),
+       XtOffset(AppResources *,message_lines), XtRString, "12" },
+     { "pet_mark_bitmap", "Pet_mark_bitmap", XtRString, sizeof(String),
+-      XtOffset(AppResources *,pet_mark_bitmap), XtRString, "pet_mark.xbm" },
++      XtOffset(AppResources *,pet_mark_bitmap), XtRString, PIXMAPDIR "pet_mark.xbm" },
+     { "pet_mark_color", "Pet_mark_color", XtRPixel, sizeof(XtRPixel),
+       XtOffset(AppResources *,pet_mark_color), XtRString, "Red" },
+ #ifdef GRAPHIC_TOMBSTONE
+     { "tombstone", "Tombstone", XtRString, sizeof(String),
+-      XtOffset(AppResources *,tombstone), XtRString, "rip.xpm" },
++      XtOffset(AppResources *,tombstone), XtRString, PIXMAPDIR "rip.xpm" },
+     { "tombtext_x", "Tombtext_x", XtRInt, sizeof(int),
+       XtOffset(AppResources *,tombtext_x), XtRString, "155" },
+     { "tombtext_y", "Tombtext_y", XtRInt, sizeof(int),
diff --git a/debian/patches/0009-Better-way-to-do-it.patch b/debian/patches/0009-Better-way-to-do-it.patch
new file mode 100644
index 0000000..48c5c5f
--- /dev/null
+++ b/debian/patches/0009-Better-way-to-do-it.patch
@@ -0,0 +1,31 @@
+From 49e68ac683cbe6ab2d2fa4db925938860a9b2a27 Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Better way to do it.
+
+---
+ src/windows.c |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/windows.c b/src/windows.c
+index d65710c..8953269 100644
+--- a/src/windows.c
++++ b/src/windows.c
+@@ -103,10 +103,16 @@ void
+ choose_windows(s)
+ const char *s;
+ {
++    char *ow; const char *wt;
+     register int i;
++    
++    if (!strcmp(s, DEFAULT_WINDOW_SYS) && (ow = getenv("OVERRIDEWIN")))
++      wt = ow;
++    else
++      wt = s;
+ 
+     for(i=0; winchoices[i].procs; i++)
+-	if (!strcmpi(s, winchoices[i].procs->name)) {
++	if (!strcmpi(wt, winchoices[i].procs->name)) {
+ 	    windowprocs = *winchoices[i].procs;
+ 	    if (winchoices[i].ini_routine) (*winchoices[i].ini_routine)();
+ 	    return;
diff --git a/debian/patches/90_enh_hpmon.dpatch b/debian/patches/0010-Enables-color-HP-monitor-for-textmode-NetHack.patch
similarity index 64%
rename from debian/patches/90_enh_hpmon.dpatch
rename to debian/patches/0010-Enables-color-HP-monitor-for-textmode-NetHack.patch
index a576df8..a133c85 100644
--- a/debian/patches/90_enh_hpmon.dpatch
+++ b/debian/patches/0010-Enables-color-HP-monitor-for-textmode-NetHack.patch
@@ -1,26 +1,114 @@
-#! /bin/sh -e
-## 90_enh_hpmon.dpatch by Ralph Churchill <mrchucho at yahoo.com>
-## from: http://www.netsonic.fi/~walker/nh/hpmon.diff
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Enables color HP monitor for textmode NetHack.
+From 9a705b20cd95adfe8b570bb8a4f105a2201a9ebf Mon Sep 17 00:00:00 2001
+From: Ralph Churchill <mrchucho at yahoo.com>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Enables color HP monitor for textmode NetHack.
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ dat/opthelp       |    3 +++
+ doc/Guidebook.mn  |    4 ++++
+ doc/Guidebook.tex |    5 +++++
+ doc/Guidebook.txt |    5 +++++
+ include/config.h  |    3 +++
+ include/flag.h    |    5 +++++
+ src/botl.c        |   46 ++++++++++++++++++++++++++++++++++++++++++++++
+ src/options.c     |    3 +++
+ 8 files changed, 74 insertions(+)
 
-exit 0
-
---- nh342orig/src/botl.c	2003-08-30 03:07:27.000000000 +0300
-+++ nh342hpmon/src/botl.c	2003-09-05 18:17:09.000000000 +0300
+diff --git a/dat/opthelp b/dat/opthelp
+index 4dade58..2fa5f70 100644
+--- a/dat/opthelp
++++ b/dat/opthelp
+@@ -71,6 +71,9 @@ Boolean options if TEXTCOLOR was set at compile time:
+ color      use different colors for objects on screen   [TRUE for micros]
+ hilite_pet display pets in a highlighted manner                   [FALSE]
+ 
++Boolean option if HPMON was set at compile time:
++hpmon      color HP readout depending on how low it is            [FALSE]
++
+ Boolean option if TIMED_DELAY was set at compile time (tty interface only):
+ timed_delay    on unix and VMS, use a timer instead of sending
+                extra screen output when attempting to pause for
+diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn
+index f67f02f..8ac033d 100644
+--- a/doc/Guidebook.mn
++++ b/doc/Guidebook.mn
+@@ -1863,6 +1863,10 @@ interesting and/or important information.
+ .lp horsename
+ Name your starting horse (ex. ``horsename:Trigger'').
+ Cannot be set with the `O' command.
++.lp hpmon
++Colors your HP reading green when you attain <= 2/3 of your total HP,
++yellow when you reach <= 1/3 of total, and red when you are at or below
++1/10 of your total HP.
+ .lp IBMgraphics
+ Use a predefined selection of IBM extended ASCII characters to display the
+ dungeon/effects/traps instead of having to define a full graphics set
+diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex
+index f76398f..9dd0be5 100644
+--- a/doc/Guidebook.tex
++++ b/doc/Guidebook.tex
+@@ -2307,6 +2307,11 @@ might miss some interesting and/or important information.
+ Name your starting horse (ex.\ ``{\tt horsename:Trigger}'').
+ Cannot be set with the `{\tt O}' command.
+ %.lp
++\item[\ib{hpmon}]
++Colors your HP reading green when you attain <= 2/3 of your total HP,
++yellow when you reach <= 1/3 of total, and red when you are at or below
++1/10 of your total HP.
++%.lp
+ \item[\ib{IBMgraphics}]
+ Use a predefined selection of IBM extended ASCII characters to display the
+ dungeon/effects/traps instead of having to define a full graphics set
+diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt
+index f0f9f7d..cfc0ed4 100644
+--- a/doc/Guidebook.txt
++++ b/doc/Guidebook.txt
+@@ -2398,6 +2398,11 @@
+             Name  your  starting horse (ex. ``horsename:Trigger'').  Cannot
+             be set with the `O' command.
+ 
++          hpmon
++               Colors your hitpoint reading green when you attain <= 2/3  of
++               your total HP, yellow when you reach <= 1/3 of total, and red
++               when you are at or below 1/10 of your total HP.
++               
+           IBMgraphics
+             Use a predefined selection of IBM extended ASCII characters  to
+             display the dungeon/effects/traps instead of having to define a
+diff --git a/include/config.h b/include/config.h
+index e2c1921..5a57195 100644
+--- a/include/config.h
++++ b/include/config.h
+@@ -340,6 +340,9 @@ typedef unsigned char	uchar;
+ 
+ #define EXP_ON_BOTL	/* Show experience on bottom line */
+ #define PARANOID
++
++#define HPMON           /* Color HP monitor */
++
+ /* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson at ucivax) */
+ 
+ /*
+diff --git a/include/flag.h b/include/flag.h
+index de149ff..ee8031b 100644
+--- a/include/flag.h
++++ b/include/flag.h
+@@ -219,6 +219,11 @@ struct instance_flags {
+ 	boolean lan_mail;	/* mail is initialized */
+ 	boolean lan_mail_fetched; /* mail is awaiting display */
+ #endif
++
++#if defined(HPMON) && defined(TEXTCOLOR)
++        boolean use_hpmon;
++#endif
++
+ /*
+  * Window capability support.
+  */
+diff --git a/src/botl.c b/src/botl.c
+index 6534ad7..70a2d37 100644
+--- a/src/botl.c
++++ b/src/botl.c
 @@ -3,6 +3,7 @@
  /* NetHack may be freely redistributed.  See license for details. */
  
@@ -28,8 +116,8 @@ exit 0
 +#include "wintty.h"
  
  #ifdef OVL0
- extern const char *hu_stat[];  /* defined in eat.c */
-@@ -248,6 +248,9 @@
+ extern const char *hu_stat[];	/* defined in eat.c */
+@@ -248,6 +249,9 @@ bot2()
  	char  newbot2[MAXCO];
  	register char *nb;
  	int hp, hpmax;
@@ -39,7 +127,7 @@ exit 0
  	int cap = near_capacity();
  
  	hp = Upolyd ? u.mh : u.uhp;
-@@ -256,6 +259,15 @@
+@@ -256,6 +260,15 @@ bot2()
  	if(hp < 0) hp = 0;
  	(void) describe_level(newbot2);
  	Sprintf(nb = eos(newbot2),
@@ -55,7 +143,7 @@ exit 0
  		"%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS],
  #ifndef GOLDOBJ
  		u.ugold,
-@@ -263,6 +275,39 @@
+@@ -263,6 +276,39 @@ bot2()
  		money_cnt(invent),
  #endif
  		hp, hpmax, u.uen, u.uenmax, u.uac);
@@ -95,21 +183,11 @@ exit 0
  
  	if (Upolyd)
  		Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel);
---- nethack/include/config.h~	2003-10-12 15:47:13.000000000 -0700
-+++ nethack/include/config.h	2003-10-12 15:49:18.000000000 -0700
-@@ -345,6 +345,9 @@
- 
- #define EXP_ON_BOTL	/* Show experience on bottom line */
- #define PARANOID
-+
-+#define HPMON           /* Color HP monitor */
-+
- /* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson at ucivax) */
- 
- /*
---- nethack/src/options.c~	2003-10-12 16:05:42.000000000 -0700
-+++ nethack/src/options.c	2003-10-12 16:06:44.000000000 -0700
-@@ -86,6 +86,9 @@
+diff --git a/src/options.c b/src/options.c
+index dfb8006..3aff6b3 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -86,6 +86,9 @@ static struct Bool_Opt
  #else
  	{"extmenu", (boolean *)0, FALSE, SET_IN_FILE},
  #endif
@@ -119,70 +197,3 @@ exit 0
  #ifdef OPT_DISPMAP
  	{"fast_map", &flags.fast_map, TRUE, SET_IN_GAME},
  #else
---- nethack/include/flag.h~	2003-10-12 16:04:12.000000000 -0700
-+++ nethack/include/flag.h	2003-10-12 16:05:17.000000000 -0700
-@@ -217,6 +217,11 @@
- 	boolean lan_mail;	/* mail is initialized */
- 	boolean lan_mail_fetched; /* mail is awaiting display */
- #endif
-+
-+#if defined(HPMON) && defined(TEXTCOLOR)
-+        boolean use_hpmon;
-+#endif
-+
- /*
-  * Window capability support.
-  */
---- nethack/dat/opthelp~	2003-10-12 16:16:39.000000000 -0700
-+++ nethack/dat/opthelp	2003-10-12 16:16:09.000000000 -0700
-@@ -71,6 +71,9 @@
- color      use different colors for objects on screen   [TRUE for micros]
- hilite_pet display pets in a highlighted manner                   [FALSE]
- 
-+Boolean option if HPMON was set at compile time:
-+hpmon      color HP readout depending on how low it is            [FALSE]
-+
- Boolean option if TIMED_DELAY was set at compile time (tty interface only):
- timed_delay    on unix and VMS, use a timer instead of sending
-                extra screen output when attempting to pause for
---- nethack/doc/Guidebook.txt~	2003-10-12 16:10:21.000000000 -0700
-+++ nethack/doc/Guidebook.txt	2003-10-12 16:14:39.000000000 -0700
-@@ -2338,6 +2338,11 @@
-                Name  your starting horse (ex. ``horsename:Trigger'').  Can-
-                not be set with the `O' command.
- 
-+          hpmon
-+               Colors your hitpoint reading green when you attain <= 2/3  of
-+               your total HP, yellow when you reach <= 1/3 of total, and red
-+               when you are at or below 1/10 of your total HP.
-+               
-           IBMgraphics
-                Use a predefined selection of IBM extended ASCII  characters
-                to  display  the  dungeon/effects/traps instead of having to
---- nethack/doc/Guidebook.mn~	2003-10-12 16:10:32.000000000 -0700
-+++ nethack/doc/Guidebook.mn	2003-10-12 16:15:11.000000000 -0700
-@@ -1800,6 +1800,10 @@
- .lp horsename
- Name your starting horse (ex. ``horsename:Trigger'').
- Cannot be set with the `O' command.
-+.lp hpmon
-+Colors your HP reading green when you attain <= 2/3 of your total HP,
-+yellow when you reach <= 1/3 of total, and red when you are at or below
-+1/10 of your total HP.
- .lp IBMgraphics
- Use a predefined selection of IBM extended ASCII characters to display the
- dungeon/effects/traps instead of having to define a full graphics set
---- nethack/doc/Guidebook.tex~	2003-10-12 16:10:38.000000000 -0700
-+++ nethack/doc/Guidebook.tex	2003-10-12 16:15:28.000000000 -0700
-@@ -2229,6 +2229,11 @@
- Name your starting horse (ex.\ ``{\tt horsename:Trigger}'').
- Cannot be set with the `{\tt O}' command.
- %.lp
-+\item[\ib{hpmon}]
-+Colors your HP reading green when you attain <= 2/3 of your total HP,
-+yellow when you reach <= 1/3 of total, and red when you are at or below
-+1/10 of your total HP.
-+%.lp
- \item[\ib{IBMgraphics}]
- Use a predefined selection of IBM extended ASCII characters to display the
- dungeon/effects/traps instead of having to define a full graphics set
diff --git a/debian/patches/91_enh_menucolors.dpatch b/debian/patches/0011-Pasi-Kallinen-s-patch-to-add-colors-to-inventory-ite.patch
similarity index 76%
rename from debian/patches/91_enh_menucolors.dpatch
rename to debian/patches/0011-Pasi-Kallinen-s-patch-to-add-colors-to-inventory-ite.patch
index 9670308..c99609f 100644
--- a/debian/patches/91_enh_menucolors.dpatch
+++ b/debian/patches/0011-Pasi-Kallinen-s-patch-to-add-colors-to-inventory-ite.patch
@@ -1,140 +1,26 @@
-#! /bin/sh -e
-## 91_enh_menucolors.dpatch by Pasi Kallinen <pkalli at cs.joensuu.fi>
-## from: http://www.cs.joensuu.fi/~pkalli/code/nh343-menucolor.diff
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Pasi Kallinen's patch to add colors to inventory items.
+From e322d347a77bca305979201e4cfb552f0ea01a0e Mon Sep 17 00:00:00 2001
+From: Pasi Kallinen <pkalli at cs.joensuu.fi>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Pasi Kallinen's patch to add colors to inventory items.
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ README.menucolor |   96 ++++++++++++++++++++++++++++++++++++++
+ dat/opthelp      |   18 ++++++++
+ include/color.h  |   18 ++++++++
+ include/config.h |    9 ++++
+ include/extern.h |    3 ++
+ include/flag.h   |    3 ++
+ src/decl.c       |    4 ++
+ src/files.c      |    4 ++
+ src/options.c    |  136 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/save.c       |   26 +++++++++++
+ util/makedefs.c  |    7 +++
+ win/tty/wintty.c |   43 +++++++++++++++++
+ 12 files changed, 367 insertions(+)
+ create mode 100644 README.menucolor
 
-exit 0
-
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/dat/opthelp nethack-3.4.3-menucolor/dat/opthelp
---- nethack-3.4.3-orig/dat/opthelp	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/dat/opthelp	2003-12-10 05:06:38.000000000 +0200
-@@ -71,6 +71,9 @@
- color      use different colors for objects on screen   [TRUE for micros]
- hilite_pet display pets in a highlighted manner                   [FALSE]
- 
-+Boolean option if TEXTCOLOR and MENU_COLOR were set at compile time:
-+menucolors use different colors for menus               [TRUE for micros]
-+
- Boolean option if TIMED_DELAY was set at compile time (tty interface only):
- timed_delay    on unix and VMS, use a timer instead of sending
-                extra screen output when attempting to pause for
-@@ -169,6 +172,21 @@
-            still denote your gender using the "male" and "female"
-            options, the "gender" option will take precedence.  [RANDOM]
- horsename  the name of your first horse  [NONE]
-+menucolor  Set colors for menus. (menucolor:"regex_string"=color)
-+           If boolean option ``menucolors'' is true, menus will be shown
-+	   with different colors.
-+	   For example, setting ``menucolor:" blessed "=green'' shows
-+	   all lines in a menu with the text " blessed " in green.
-+	   The string is matched using regular expressions.
-+	   Valid values for the color are black, red, green, brown, blue,
-+	   magenta, cyan, gray, orange, lightgreen, yellow, lightblue,
-+	   lightmagenta, lightcyan and white.
-+	   You can define menucolor as many times as you wish; those
-+	   defined later will take precedence.
-+	   Instead of using this with OPTIONS, consider using
-+	   MENUCOLOR="regex_string"=color in the configuration file.
-+	   Setting menucolor has effect only if TEXTCOLOR and MENU_COLOR
-+	   were set at compile time.  [NONE]
- menu_*     create single character accelerators for menu commands.  Below
-            is a list of all commands.  Each is followed by a list of window-
-            ports that implement them:  'x' is X11, 't' is tty, 'g' is Gem,
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/color.h nethack-3.4.3-menucolor/include/color.h
---- nethack-3.4.3-orig/include/color.h	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/include/color.h	2003-12-10 05:08:55.000000000 +0200
-@@ -5,6 +5,12 @@
- #ifndef COLOR_H
- #define COLOR_H
- 
-+#ifdef MENU_COLOR
-+# ifdef MENU_COLOR_REGEX
-+#  include <regex.h>
-+# endif
-+#endif
-+
- /*
-  * The color scheme used is tailored for an IBM PC.  It consists of the
-  * standard 8 colors, folowed by their bright counterparts.  There are
-@@ -49,4 +55,16 @@
- #define DRAGON_SILVER	CLR_BRIGHT_CYAN
- #define HI_ZAP		CLR_BRIGHT_BLUE
- 
-+#ifdef MENU_COLOR
-+struct menucoloring {
-+# ifdef MENU_COLOR_REGEX
-+    struct re_pattern_buffer match;
-+# else
-+    char *match;
-+# endif
-+    int color, attr;
-+    struct menucoloring *next;
-+};
-+#endif /* MENU_COLOR */
-+
- #endif /* COLOR_H */
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/config.h nethack-3.4.3-menucolor/include/config.h
---- nethack-3.4.3-orig/include/config.h	2003-12-09 17:26:08.000000000 +0200
-+++ nethack-3.4.3-menucolor/include/config.h	2003-12-10 05:09:50.000000000 +0200
-@@ -348,6 +348,15 @@
-  * bugs left here.
-  */
- 
-+#ifdef TTY_GRAPHICS
-+# define MENU_COLOR
-+# define MENU_COLOR_REGEX
-+/* if MENU_COLOR_REGEX is defined, use regular expressions (GNU regex.h)
-+ * otherwise use pmatch() to match menu color lines.
-+ * pmatch() provides basic globbing: '*' and '?' wildcards.
-+ */
-+#endif
-+
- /*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
- /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
- 
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/extern.h nethack-3.4.3-menucolor/include/extern.h
---- nethack-3.4.3-orig/include/extern.h	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/include/extern.h	2003-12-10 05:10:29.000000000 +0200
-@@ -1405,6 +1405,9 @@
- E int FDECL(add_autopickup_exception, (const char *));
- E void NDECL(free_autopickup_exceptions);
- #endif /* AUTOPICKUP_EXCEPTIONS */
-+#ifdef MENU_COLOR
-+E boolean FDECL(add_menu_coloring, (char *));
-+#endif /* MENU_COLOR */
- 
- /* ### pager.c ### */
- 
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/include/flag.h nethack-3.4.3-menucolor/include/flag.h
---- nethack-3.4.3-orig/include/flag.h	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/include/flag.h	2003-12-10 05:12:35.000000000 +0200
-@@ -183,6 +183,9 @@
- 	char prevmsg_window;	/* type of old message window to use */
- 	boolean  extmenu;	/* extended commands use menu interface */
- #endif
-+#ifdef MENU_COLOR
-+	boolean use_menu_color;	/* use color in menus; only if wc_color */
-+#endif
- #ifdef MFLOPPY
- 	boolean  checkspace;	/* check disk space before writing files */
- 				/* (in iflags to allow restore after moving
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/README.menucolor nethack-3.4.3-menucolor/README.menucolor
---- nethack-3.4.3-orig/README.menucolor	1970-01-01 02:00:00.000000000 +0200
-+++ nethack-3.4.3-menucolor/README.menucolor	2003-12-10 06:14:20.000000000 +0200
+--- /dev/null
++++ b/README.menucolor
 @@ -0,0 +1,96 @@
 +
 +   This is version 1.3 of the menucolors patch.
@@ -232,9 +118,118 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/README.menuco
 +--
 + Pasi Kallinen
 + pkalli at cs.joensuu.fi
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/decl.c nethack-3.4.3-menucolor/src/decl.c
---- nethack-3.4.3-orig/src/decl.c	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/src/decl.c	2003-12-10 05:14:53.000000000 +0200
+--- a/dat/opthelp
++++ b/dat/opthelp
+@@ -74,6 +74,9 @@
+ Boolean option if HPMON was set at compile time:
+ hpmon      color HP readout depending on how low it is            [FALSE]
+ 
++Boolean option if TEXTCOLOR and MENU_COLOR were set at compile time:
++menucolors use different colors for menus               [TRUE for micros]
++
+ Boolean option if TIMED_DELAY was set at compile time (tty interface only):
+ timed_delay    on unix and VMS, use a timer instead of sending
+                extra screen output when attempting to pause for
+@@ -172,6 +175,21 @@
+            still denote your gender using the "male" and "female"
+            options, the "gender" option will take precedence.  [RANDOM]
+ horsename  the name of your first horse  [NONE]
++menucolor  Set colors for menus. (menucolor:"regex_string"=color)
++           If boolean option ``menucolors'' is true, menus will be shown
++	   with different colors.
++	   For example, setting ``menucolor:" blessed "=green'' shows
++	   all lines in a menu with the text " blessed " in green.
++	   The string is matched using regular expressions.
++	   Valid values for the color are black, red, green, brown, blue,
++	   magenta, cyan, gray, orange, lightgreen, yellow, lightblue,
++	   lightmagenta, lightcyan and white.
++	   You can define menucolor as many times as you wish; those
++	   defined later will take precedence.
++	   Instead of using this with OPTIONS, consider using
++	   MENUCOLOR="regex_string"=color in the configuration file.
++	   Setting menucolor has effect only if TEXTCOLOR and MENU_COLOR
++	   were set at compile time.  [NONE]
+ menu_*     create single character accelerators for menu commands.  Below
+            is a list of all commands.  Each is followed by a list of window-
+            ports that implement them:  'x' is X11, 't' is tty, 'g' is Gem,
+--- a/include/color.h
++++ b/include/color.h
+@@ -5,6 +5,12 @@
+ #ifndef COLOR_H
+ #define COLOR_H
+ 
++#ifdef MENU_COLOR
++# ifdef MENU_COLOR_REGEX
++#  include <regex.h>
++# endif
++#endif
++
+ /*
+  * The color scheme used is tailored for an IBM PC.  It consists of the
+  * standard 8 colors, folowed by their bright counterparts.  There are
+@@ -49,4 +55,16 @@
+ #define DRAGON_SILVER	CLR_BRIGHT_CYAN
+ #define HI_ZAP		CLR_BRIGHT_BLUE
+ 
++#ifdef MENU_COLOR
++struct menucoloring {
++# ifdef MENU_COLOR_REGEX
++    struct re_pattern_buffer match;
++# else
++    char *match;
++# endif
++    int color, attr;
++    struct menucoloring *next;
++};
++#endif /* MENU_COLOR */
++
+ #endif /* COLOR_H */
+--- a/include/config.h
++++ b/include/config.h
+@@ -353,6 +353,17 @@
+  * bugs left here.
+  */
+ 
++#ifdef TTY_GRAPHICS
++# define MENU_COLOR
++#ifdef __linux__
++# define MENU_COLOR_REGEX
++/* if MENU_COLOR_REGEX is defined, use regular expressions (GNU regex.h)
++ * otherwise use pmatch() to match menu color lines.
++ * pmatch() provides basic globbing: '*' and '?' wildcards.
++ */
++#endif
++#endif
++
+ /*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
+ #define AUTOPICKUP_EXCEPTIONS  /* exceptions to autopickup */
+ 
+--- a/include/extern.h
++++ b/include/extern.h
+@@ -1405,6 +1405,9 @@
+ E int FDECL(add_autopickup_exception, (const char *));
+ E void NDECL(free_autopickup_exceptions);
+ #endif /* AUTOPICKUP_EXCEPTIONS */
++#ifdef MENU_COLOR
++E boolean FDECL(add_menu_coloring, (char *));
++#endif /* MENU_COLOR */
+ 
+ /* ### pager.c ### */
+ 
+--- a/include/flag.h
++++ b/include/flag.h
+@@ -186,6 +186,9 @@
+ 	char prevmsg_window;	/* type of old message window to use */
+ 	boolean  extmenu;	/* extended commands use menu interface */
+ #endif
++#ifdef MENU_COLOR
++	boolean use_menu_color;	/* use color in menus; only if wc_color */
++#endif
+ #ifdef MFLOPPY
+ 	boolean  checkspace;	/* check disk space before writing files */
+ 				/* (in iflags to allow restore after moving
+--- a/src/decl.c
++++ b/src/decl.c
 @@ -235,6 +235,10 @@
  	"white",		/* CLR_WHITE */
  };
@@ -246,9 +241,8 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/decl.c ne
  struct c_common_strings c_common_strings = {
  	"Nothing happens.",		"That's enough tries!",
  	"That is a silly thing to %s.",	"shudder for a moment.",
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/files.c nethack-3.4.3-menucolor/src/files.c
---- nethack-3.4.3-orig/src/files.c	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/src/files.c	2003-12-10 05:42:43.000000000 +0200
+--- a/src/files.c
++++ b/src/files.c
 @@ -1794,6 +1794,10 @@
  	} else if (match_varname(buf, "BOULDER", 3)) {
  	    (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE,
@@ -260,10 +254,9 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/files.c n
  	} else if (match_varname(buf, "GRAPHICS", 4)) {
  	    len = get_uchars(fp, buf, bufp, translate, FALSE,
  			     MAXPCHARS, "GRAPHICS");
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/options.c nethack-3.4.3-menucolor/src/options.c
---- nethack-3.4.3-orig/src/options.c	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/src/options.c	2003-12-10 05:19:58.000000000 +0200
-@@ -125,6 +125,15 @@
+--- a/src/options.c
++++ b/src/options.c
+@@ -128,6 +128,15 @@
  #else
  	{"mail", (boolean *)0, TRUE, SET_IN_FILE},
  #endif
@@ -279,7 +272,7 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/options.c
  #ifdef WIZARD
  	/* for menu debugging only*/
  	{"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME},
-@@ -246,6 +255,7 @@
+@@ -249,6 +258,7 @@
  	{ "horsename", "the name of your (first) horse (e.g., horsename:Silver)",
  						PL_PSIZ, DISP_IN_GAME },
  	{ "map_mode", "map display mode under Windows", 20, DISP_IN_GAME },	/*WC*/
@@ -287,7 +280,7 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/options.c
  	{ "menustyle", "user interface for object selection",
  						MENUTYPELEN, SET_IN_GAME },
  	{ "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE },
-@@ -964,6 +974,120 @@
+@@ -967,6 +977,120 @@
  	}
  }
  
@@ -408,7 +401,7 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/options.c
  void
  parseoptions(opts, tinitial, tfrom_file)
  register char *opts;
-@@ -1133,6 +1257,18 @@
+@@ -1136,6 +1260,18 @@
  		return;
  	}
  
@@ -427,9 +420,8 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/options.c
  	fullname = "msghistory";
  	if (match_optname(opts, fullname, 3, TRUE)) {
  		op = string_for_env_opt(fullname, opts, negated);
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/save.c nethack-3.4.3-menucolor/src/save.c
---- nethack-3.4.3-orig/src/save.c	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/src/save.c	2003-12-10 05:22:32.000000000 +0200
+--- a/src/save.c
++++ b/src/save.c
 @@ -48,6 +48,10 @@
  #define HUP
  #endif
@@ -476,9 +468,8 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/src/save.c ne
  	tmp_at(DISP_FREEMEM, 0);	/* temporary display effects */
  #ifdef FREE_ALL_MEMORY
  # define freeobjchn(X)	(saveobjchn(0, X, FREE_SAVE),  X = 0)
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/util/makedefs.c nethack-3.4.3-menucolor/util/makedefs.c
---- nethack-3.4.3-orig/util/makedefs.c	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/util/makedefs.c	2003-12-10 06:03:57.000000000 +0200
+--- a/util/makedefs.c
++++ b/util/makedefs.c
 @@ -679,6 +679,13 @@
  #ifdef MAIL
  		"mail daemon",
@@ -493,9 +484,8 @@ diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/util/makedefs
  #ifdef GNUDOS
  		"MSDOS protected mode",
  #endif
-diff -Nurd --exclude-from=diff_ignore_files.txt nethack-3.4.3-orig/win/tty/wintty.c nethack-3.4.3-menucolor/win/tty/wintty.c
---- nethack-3.4.3-orig/win/tty/wintty.c	2003-12-09 17:23:52.000000000 +0200
-+++ nethack-3.4.3-menucolor/win/tty/wintty.c	2003-12-10 05:25:46.000000000 +0200
+--- a/win/tty/wintty.c
++++ b/win/tty/wintty.c
 @@ -125,6 +125,10 @@
  static char winpanicstr[] = "Bad window id %d";
  char defmorestr[] = "--More--";
diff --git a/debian/patches/92_enh_paranoid_hit.dpatch b/debian/patches/0012-Paranoid-hit-asks-you-to-confirm-yes-instead-of-y-wh.patch
similarity index 52%
rename from debian/patches/92_enh_paranoid_hit.dpatch
rename to debian/patches/0012-Paranoid-hit-asks-you-to-confirm-yes-instead-of-y-wh.patch
index 8f16a82..c7b761e 100644
--- a/debian/patches/92_enh_paranoid_hit.dpatch
+++ b/debian/patches/0012-Paranoid-hit-asks-you-to-confirm-yes-instead-of-y-wh.patch
@@ -1,30 +1,24 @@
-#! /bin/sh -e
-## 92_enh_paranoid_hit.dpatch by Joshua Kwan <joshk at triplehelix.org>
-## heavily edited from http://www.netsonic.fi/~walker/nh/paranoid-343.diff
-## originally by  David Damerell, Jonathan Nieder, Jukka Lahtinen, Stanislav
-## Traykov
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Paranoid hit asks you to confirm 'yes' instead of 'y' when hitting peacefuls
+From 483e822617cd94a508038fab69853b26014cf67e Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Paranoid hit asks you to confirm 'yes' instead of 'y' when hitting
+ peacefuls
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ dat/opthelp       |    3 +++
+ doc/Guidebook.mn  |    3 +++
+ doc/Guidebook.tex |    4 ++++
+ doc/Guidebook.txt |    4 ++++
+ include/flag.h    |    3 +++
+ src/options.c     |    3 +++
+ src/uhitm.c       |   18 ++++++++++++++++++
+ 7 files changed, 38 insertions(+)
 
-exit 0
-
-diff -urd nethack-3.4.2/dat/opthelp nh342par/dat/opthelp
---- nethack-3.4.2/dat/opthelp	2003-08-30 03:07:07.000000000 +0300
-+++ nh342par/dat/opthelp	2003-09-05 16:36:28.000000000 +0300
-@@ -61,6 +61,9 @@
+diff --git a/dat/opthelp b/dat/opthelp
+index a2d624a..eefd333 100644
+--- a/dat/opthelp
++++ b/dat/opthelp
+@@ -61,6 +61,9 @@ news       print any news from game administrator on startup      [TRUE]
  Boolean option if MFLOPPY was set at compile time:
  checkspace check free disk space before writing files to disk     [TRUE]
  
@@ -34,10 +28,11 @@ diff -urd nethack-3.4.2/dat/opthelp nh342par/dat/opthelp
  Boolean option if EXP_ON_BOTL was set at compile time:
  showexp    display your accumulated experience points             [FALSE]
  
-diff -urd nethack-3.4.2/doc/Guidebook.mn nh342par/doc/Guidebook.mn
---- nethack-3.4.2/doc/Guidebook.mn	2003-08-30 03:07:13.000000000 +0300
-+++ nh342par/doc/Guidebook.mn	2003-09-05 16:35:33.000000000 +0300
-@@ -1964,6 +1964,9 @@
+diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn
+index 8ac033d..a0edc2e 100644
+--- a/doc/Guidebook.mn
++++ b/doc/Guidebook.mn
+@@ -2031,6 +2031,9 @@ Specify the order to list object types in (default ``")[%?+!=/(*`0_'').
  The value of this option should be a string containing the
  symbols for the various object types.  Any omitted types are filled in
  at the end from the previous order.
@@ -47,10 +42,11 @@ diff -urd nethack-3.4.2/doc/Guidebook.mn nh342par/doc/Guidebook.mn
  .lp perm_invent
  If true, always display your current inventory in a window.  This only
  makes sense for windowing system interfaces that implement this feature.
-diff -urd nethack-3.4.2/doc/Guidebook.tex nh342par/doc/Guidebook.tex
---- nethack-3.4.2/doc/Guidebook.tex	2003-08-30 03:07:13.000000000 +0300
-+++ nh342par/doc/Guidebook.tex	2003-09-05 16:35:33.000000000 +0300
-@@ -2409,6 +2409,10 @@
+diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex
+index 9dd0be5..55a85ec 100644
+--- a/doc/Guidebook.tex
++++ b/doc/Guidebook.tex
+@@ -2491,6 +2491,10 @@ Specify the order to list object types in (default
  containing the symbols for the various object types.  Any omitted types
  are filled in at the end from the previous order.
  %.lp
@@ -61,42 +57,40 @@ diff -urd nethack-3.4.2/doc/Guidebook.tex nh342par/doc/Guidebook.tex
  \item[\ib{perm\_invent}]
  If true, always display your current inventory in a window.  This only
  makes sense for windowing system interfaces that implement this feature.
-diff -urd nethack-3.4.2/doc/Guidebook.txt nh342par/doc/Guidebook.txt
---- nethack-3.4.2/doc/Guidebook.txt	2003-08-30 03:07:13.000000000 +0300
-+++ nh342par/doc/Guidebook.txt	2003-09-05 16:35:33.000000000 +0300
-@@ -2554,6 +2554,10 @@
-                Any omitted types are filled in at the end from the previous
-                order.
+diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt
+index cfc0ed4..82a8eeb 100644
+--- a/doc/Guidebook.txt
++++ b/doc/Guidebook.txt
+@@ -2612,6 +2612,10 @@
+             Any  omitted  types  are filled in at the end from the previous
+             order.
  
 +          paranoid_hit
 +               If true, asks you to type the word ``yes'' when hitting any
 +               peaceful monster, not just the letter ``y''.
 +
            perm_invent
-                If true, always display your current inventory in a  window.
-                This  only  makes sense for windowing system interfaces that
-diff -urd nethack-3.4.2/include/flag.h nh342par/include/flag.h
---- nethack-3.4.2/include/flag.h	2003-08-30 03:07:17.000000000 +0300
-+++ nh342par/include/flag.h	2003-09-05 16:35:33.000000000 +0300
-@@ -217,6 +217,9 @@
+             If true, always display your current  inventory  in  a  window.
+             This  only makes sense for windowing system interfaces that im-
+diff --git a/include/flag.h b/include/flag.h
+index cf2958c..efe778e 100644
+--- a/include/flag.h
++++ b/include/flag.h
+@@ -222,6 +222,9 @@ struct instance_flags {
  	boolean lan_mail;	/* mail is initialized */
  	boolean lan_mail_fetched; /* mail is awaiting display */
  #endif
 +#ifdef PARANOID
 +	boolean  paranoid_hit;  /* Ask for 'yes' when hitting peacefuls */
 +#endif
-
+ 
  #if defined(HPMON) && defined(TEXTCOLOR)
          boolean use_hpmon;
- #endif
-
- /*
-  * Window capability support.
-  */
-diff -urd nethack-3.4.2/src/options.c nh342par/src/options.c
---- nethack-3.4.2/src/options.c	2003-08-30 03:07:36.000000000 +0300
-+++ nh342par/src/options.c	2003-09-05 16:35:33.000000000 +0300
-@@ -155,6 +155,9 @@
+diff --git a/src/options.c b/src/options.c
+index 0e253b4..e767a83 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -155,6 +155,9 @@ static struct Bool_Opt
  #else
  	{"page_wait", (boolean *)0, FALSE, SET_IN_FILE},
  #endif
@@ -106,10 +100,11 @@ diff -urd nethack-3.4.2/src/options.c nh342par/src/options.c
  	{"perm_invent", &flags.perm_invent, FALSE, SET_IN_GAME},
  	{"popup_dialog",  &iflags.wc_popup_dialog, FALSE, SET_IN_GAME},	/*WC*/
  	{"prayconfirm", &flags.prayconfirm, TRUE, SET_IN_GAME},
-diff -urd nethack-3.4.2/src/uhitm.c nh342par/src/uhitm.c
---- nethack-3.4.2/src/uhitm.c	2003-08-30 03:07:42.000000000 +0300
-+++ nh342par/src/uhitm.c	2003-09-05 16:35:33.000000000 +0300
-@@ -99,6 +99,9 @@
+diff --git a/src/uhitm.c b/src/uhitm.c
+index 3dd028a..4a980d6 100644
+--- a/src/uhitm.c
++++ b/src/uhitm.c
+@@ -99,6 +99,9 @@ register struct monst *mtmp;
  struct obj *wep;	/* uwep for attack(), null for kick_monster() */
  {
  	char qbuf[QBUFSZ];
@@ -119,7 +114,7 @@ diff -urd nethack-3.4.2/src/uhitm.c nh342par/src/uhitm.c
  
  	/* if you're close enough to attack, alert any waiting monster */
  	mtmp->mstrategy &= ~STRAT_WAITMASK;
-@@ -199,11 +202,26 @@
+@@ -199,11 +202,26 @@ struct obj *wep;	/* uwep for attack(), null for kick_monster() */
  			return(FALSE);
  		}
  		if (canspotmon(mtmp)) {
diff --git a/debian/patches/93_enh_dump.dpatch b/debian/patches/0013-93_enh_dump.dpatch-by-Tom-Friedetzky-Jukka-Lahtinen-.patch
similarity index 90%
rename from debian/patches/93_enh_dump.dpatch
rename to debian/patches/0013-93_enh_dump.dpatch-by-Tom-Friedetzky-Jukka-Lahtinen-.patch
index 037060c..6ddafc9 100644
--- a/debian/patches/93_enh_dump.dpatch
+++ b/debian/patches/0013-93_enh_dump.dpatch-by-Tom-Friedetzky-Jukka-Lahtinen-.patch
@@ -1,41 +1,34 @@
-#! /bin/sh -e
-## 93_enh_dump.dpatch by Tom Friedetzky, Jukka Lahtinen, Darshan Shaligram
-## from: http://www.netsonic.fi/~walker/nh/dump-343.diff
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Dump patch by Jukka Lahtinen.
+From b64e2bc3f3e5b1dae2d7b091fee4182c7f719bed Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: =?UTF-8?q?93=5Fenh=5Fdump.dpatch=20by=20Tom=20Friedetzky,=20Jukka=20?=
+ =?UTF-8?q?Lahtinen,=20Darshan=20Shaligram=0ADump=20patch=20by=20Jukka=20Lah?=
+ =?UTF-8?q?tinen.?=
 
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch)
-      if patch -f --dry-run -p1 < $0 >/dev/null 2>&1; then
-        patch -f --no-backup-if-mismatch -p1 < $0
-      else
-        exit 1
-      fi
-    ;;
-    -unpatch)
-      if patch -f --dry-run -R -p1 < $0 >/dev/null 2>&1; then
-        patch -f --no-backup-if-mismatch -R -p1 < $0
-      else
-        exit 1
-      fi
-    ;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
+---
+ dat/opthelp       |    3 +
+ doc/Guidebook.mn  |    6 +
+ doc/Guidebook.tex |    7 +
+ doc/Guidebook.txt |    7 +
+ include/config.h  |    2 +
+ include/decl.h    |    3 +
+ include/extern.h  |   21 +++
+ src/botl.c        |   30 +++++
+ src/cmd.c         |  387 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/decl.c        |    9 ++
+ src/display.c     |  100 ++++++++++++++
+ src/end.c         |  230 +++++++++++++++++++++++++++++--
+ src/invent.c      |   73 +++++++++-
+ src/options.c     |   25 ++++
+ src/spell.c       |   29 ++++
+ src/topten.c      |   47 ++++++-
+ src/weapon.c      |   68 ++++++++++
+ win/tty/wintty.c  |    4 +-
+ 18 files changed, 1031 insertions(+), 20 deletions(-)
 
-exit 0
-
-Nethack 3.4.3 dump patch, version 1.1
-diff -Nurd --exclude-from=diff_ign.txt nh343off/dat/opthelp nh343dump/dat/opthelp
---- nh343off/dat/opthelp	Mon Dec  8 01:39:14 2003
-+++ nh343dump/dat/opthelp	Thu Dec 11 19:49:06 2003
-@@ -92,6 +92,9 @@
+--- a/dat/opthelp
++++ b/dat/opthelp
+@@ -101,6 +101,9 @@
  boulder       override the default boulder symbol with another default: [`]
  disclose      the types of information you want offered at the end of the
                game  [ni na nv ng nc]
@@ -45,9 +38,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/dat/opthelp nh343dump/dat/opthel
  fruit         the name of a fruit you enjoy eating  [slime mold]
                (basically a whimsy which NetHack uses from time to time).
  menustyle     user interface for selection of multiple objects:
-diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.mn nh343dump/doc/Guidebook.mn
---- nh343off/doc/Guidebook.mn	Mon Dec  8 01:39:14 2003
-+++ nh343dump/doc/Guidebook.mn	Thu Dec 11 19:48:48 2003
+--- a/doc/Guidebook.mn
++++ b/doc/Guidebook.mn
 @@ -1770,6 +1770,12 @@
  .lp dogname
  Name your starting dog (ex. ``dogname:Fang'').
@@ -61,9 +53,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.mn nh343dump/doc/G
  .lp dungeon
  Set the graphics symbols for displaying the dungeon
  (default \&``\ |--------||.-|++##.##<><>_|\e\e#{}.}..##\ #}'').
-diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.tex nh343dump/doc/Guidebook.tex
---- nh343off/doc/Guidebook.tex	Mon Dec  8 01:39:14 2003
-+++ nh343dump/doc/Guidebook.tex	Thu Dec 11 19:48:46 2003
+--- a/doc/Guidebook.tex
++++ b/doc/Guidebook.tex
 @@ -2209,6 +2209,13 @@
  Name your starting dog (ex.\ ``{\tt dogname:Fang}'').
  Cannot be set with the `{\tt O}' command.
@@ -78,9 +69,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.tex nh343dump/doc/
  \item[\ib{dungeon}]
  Set the graphics symbols for displaying the dungeon (default
  ``\verb& |--------||.-|++##& \verb&.##<><>_|\\#{}.}..## #}&'').
-diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.txt nh343dump/doc/Guidebook.txt
---- nh343off/doc/Guidebook.txt	Mon Dec  8 01:39:14 2003
-+++ nh343dump/doc/Guidebook.txt	Thu Dec 11 19:48:44 2003
+--- a/doc/Guidebook.txt
++++ b/doc/Guidebook.txt
 @@ -2274,6 +2274,13 @@
              Name  your  starting dog (ex. ``dogname:Fang'').  Cannot be set
              with the `O' command.
@@ -95,9 +85,19 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/doc/Guidebook.txt nh343dump/doc/
            dungeon
              Set the graphics symbols for displaying  the  dungeon  (default
              `` |--------||.-|++##.##<><>_|\\#{}.}..## #}'').   The  dungeon
-diff -Nurd --exclude-from=diff_ign.txt nh343off/include/decl.h nh343dump/include/decl.h
---- nh343off/include/decl.h	Mon Dec  8 01:39:14 2003
-+++ nh343dump/include/decl.h	Wed Dec 10 14:56:54 2003
+--- a/include/config.h
++++ b/include/config.h
+@@ -366,6 +366,8 @@
+ 
+ /*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
+ #define AUTOPICKUP_EXCEPTIONS  /* exceptions to autopickup */
++#define DUMP_LOG
++#define DUMP_FN "/var/games/nethack/dumps/%n.lastgame.txt"
+ 
+ /* End of Section 5 */
+ 
+--- a/include/decl.h
++++ b/include/decl.h
 @@ -184,6 +184,9 @@
  E long done_money;
  #endif
@@ -108,9 +108,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/include/decl.h nh343dump/include
  E const char *configfile;
  E NEARDATA char plname[PL_NSIZ];
  E NEARDATA char dogname[];
-diff -Nurd --exclude-from=diff_ign.txt nh343off/include/extern.h nh343dump/include/extern.h
---- nh343off/include/extern.h	Mon Dec  8 01:39:14 2003
-+++ nh343dump/include/extern.h	Wed Dec 10 22:53:14 2003
+--- a/include/extern.h
++++ b/include/extern.h
 @@ -131,6 +131,10 @@
  E int FDECL(describe_level, (char *));
  E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P));
@@ -164,7 +163,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/include/extern.h nh343dump/inclu
  E int FDECL(display_binventory, (int,int,BOOLEAN_P));
  E struct obj *FDECL(display_cinventory,(struct obj *));
  E struct obj *FDECL(display_minventory,(struct monst *,int,char *));
-@@ -2237,6 +2255,9 @@
+@@ -2240,6 +2258,9 @@
  E int NDECL(abon);
  E int NDECL(dbon);
  E int NDECL(enhance_weapon_skill);
@@ -174,10 +173,9 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/include/extern.h nh343dump/inclu
  E void FDECL(unrestrict_weapon_skill, (int));
  E void FDECL(use_skill, (int,int));
  E void FDECL(add_weapon_skill, (int));
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/botl.c nh343dump/src/botl.c
---- nh343off/src/botl.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/botl.c	Wed Dec 10 15:09:44 2003
-@@ -165,10 +165,16 @@
+--- a/src/botl.c
++++ b/src/botl.c
+@@ -166,10 +166,16 @@
  }
  #endif
  
@@ -194,7 +192,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/botl.c nh343dump/src/botl.c
  	register char *nb;
  	register int i,j;
  
-@@ -215,6 +221,15 @@
+@@ -216,6 +222,15 @@
  	if (flags.showscore)
  	    Sprintf(nb = eos(nb), " S:%ld", botl_score());
  #endif
@@ -210,7 +208,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/botl.c nh343dump/src/botl.c
  	curs(WIN_STATUS, 1, 0);
  	putstr(WIN_STATUS, 0, newbot1);
  }
-@@ -242,10 +257,17 @@
+@@ -243,10 +258,17 @@
  	return ret;
  }
  
@@ -227,8 +225,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/botl.c nh343dump/src/botl.c
 +#endif
  	register char *nb;
  	int hp, hpmax;
- 	int cap = near_capacity();
-@@ -292,6 +314,14 @@
+ #if defined(HPMON) && !defined(LISP_GRAPHICS)
+@@ -338,6 +360,14 @@
  	if(Slimed)         Sprintf(nb = eos(nb), " Slime");
  	if(cap > UNENCUMBERED)
  		Sprintf(nb = eos(nb), " %s", enc_stat[cap]);
@@ -243,9 +241,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/botl.c nh343dump/src/botl.c
  	curs(WIN_STATUS, 1, 1);
  	putstr(WIN_STATUS, 0, newbot2);
  }
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/cmd.c nh343dump/src/cmd.c
---- nh343off/src/cmd.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/cmd.c	Thu Dec 11 19:42:20 2003
+--- a/src/cmd.c
++++ b/src/cmd.c
 @@ -1126,6 +1126,300 @@
  	return;
  }
@@ -547,11 +544,10 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/cmd.c nh343dump/src/cmd.c
  /*
   * Courtesy function for non-debug, non-explorer mode players
   * to help refresh them about who/what they are.
-@@ -1340,6 +1642,99 @@
- 	display_nhwindow(en_win, TRUE);
+@@ -1341,6 +1635,99 @@
  	destroy_nhwindow(en_win);
  }
-+
+ 
 +#ifdef DUMP_LOG
 +void
 +dump_conduct(final)
@@ -644,12 +640,12 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/cmd.c nh343dump/src/cmd.c
 +	dump("", "");
 +}
 +#endif /* DUMP_LOG */
- 
++
  #endif /* OVLB */
  #ifdef OVL1
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/decl.c nh343dump/src/decl.c
---- nh343off/src/decl.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/decl.c	Wed Dec 10 16:56:06 2003
+ 
+--- a/src/decl.c
++++ b/src/decl.c
 @@ -209,6 +209,15 @@
  
  NEARDATA struct mvitals mvitals[NUMMONS];
@@ -666,9 +662,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/decl.c nh343dump/src/decl.c
  NEARDATA struct c_color_names c_color_names = {
  	"black", "amber", "golden",
  	"light blue", "red", "green",
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/display.c nh343dump/src/display.c
---- nh343off/src/display.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/display.c	Thu Dec 11 19:27:20 2003
+--- a/src/display.c
++++ b/src/display.c
 @@ -117,6 +117,7 @@
   */
  #include "hack.h"
@@ -677,7 +672,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/display.c nh343dump/src/disp
  
  STATIC_DCL void FDECL(display_monster,(XCHAR_P,XCHAR_P,struct monst *,int,XCHAR_P));
  STATIC_DCL int FDECL(swallow_to_glyph, (int, int));
-@@ -1370,6 +1370,105 @@
+@@ -1370,6 +1371,105 @@
  
  /* ========================================================================= */
  
@@ -783,9 +778,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/display.c nh343dump/src/disp
  /*
   * back_to_glyph()
   *
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/end.c nh343dump/src/end.c
---- nh343off/src/end.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/end.c	Sat Dec 13 17:27:12 2003
+--- a/src/end.c
++++ b/src/end.c
 @@ -40,7 +40,13 @@
  STATIC_DCL void FDECL(artifact_score, (struct obj *,BOOLEAN_P,winid));
  STATIC_DCL void FDECL(savelife, (int));
@@ -1232,9 +1226,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/end.c nh343dump/src/end.c
  
  	    display_nhwindow(klwin, TRUE);
  	    destroy_nhwindow(klwin);
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/invent.c nh343dump/src/invent.c
---- nh343off/src/invent.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/invent.c	Thu Dec 11 19:25:08 2003
+--- a/src/invent.c
++++ b/src/invent.c
 @@ -19,7 +19,12 @@
  STATIC_DCL boolean FDECL(putting_on, (const char *));
  STATIC_PTR int FDECL(ckunpaid,(struct obj *));
@@ -1384,10 +1377,9 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/invent.c nh343dump/src/inven
  
  /*
   * Returns the number of unpaid items within the given list.  This includes
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/options.c nh343dump/src/options.c
---- nh343off/src/options.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/options.c	Thu Dec 11 00:01:48 2003
-@@ -224,6 +224,14 @@
+--- a/src/options.c
++++ b/src/options.c
+@@ -239,6 +239,14 @@
  						SET_IN_GAME },
  	{ "dogname",  "the name of your (first) dog (e.g., dogname:Fang)",
  						PL_PSIZ, DISP_IN_GAME },
@@ -1402,7 +1394,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/options.c nh343dump/src/opti
  	{ "dungeon",  "the symbols to use in drawing the dungeon map",
  						MAXDCHARS+1, SET_IN_FILE },
  	{ "effects",  "the symbols to use in drawing special effects",
-@@ -1077,6 +1085,19 @@
+@@ -1207,6 +1215,19 @@
  		return;
  	}
  
@@ -1422,7 +1414,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/options.c nh343dump/src/opti
  	fullname = "horsename";
  	if (match_optname(opts, fullname, 5, TRUE)) {
  		if (negated) bad_negation(fullname, FALSE);
-@@ -2933,6 +2954,10 @@
+@@ -3075,6 +3096,10 @@
  	}
  	else if (!strcmp(optname, "dogname")) 
  		Sprintf(buf, "%s", dogname[0] ? dogname : none );
@@ -1433,9 +1425,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/options.c nh343dump/src/opti
  	else if (!strcmp(optname, "dungeon"))
  		Sprintf(buf, "%s", to_be_done);
  	else if (!strcmp(optname, "effects"))
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/spell.c nh343dump/src/spell.c
---- nh343off/src/spell.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/spell.c	Thu Dec 11 00:16:02 2003
+--- a/src/spell.c
++++ b/src/spell.c
 @@ -1114,6 +1114,35 @@
  	return FALSE;
  }
@@ -1472,9 +1463,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/spell.c nh343dump/src/spell.
  /* Integer square root function without using floating point. */
  STATIC_OVL int
  isqrt(val)
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/topten.c nh343dump/src/topten.c
---- nh343off/src/topten.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/topten.c	Thu Dec 11 00:42:28 2003
+--- a/src/topten.c
++++ b/src/topten.c
 @@ -358,6 +358,12 @@
  	      "Since you were in %s mode, the score list will not be checked.",
  		    wizard ? "wizard" : "discover");
@@ -1588,9 +1578,8 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/topten.c nh343dump/src/topte
  }
  
  STATIC_OVL int
-diff -Nurd --exclude-from=diff_ign.txt nh343off/src/weapon.c nh343dump/src/weapon.c
---- nh343off/src/weapon.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/src/weapon.c	Thu Dec 11 01:23:34 2003
+--- a/src/weapon.c
++++ b/src/weapon.c
 @@ -9,6 +9,10 @@
   */
  #include "hack.h"
@@ -1693,7 +1682,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/weapon.c nh343dump/src/weapo
  
  		if (P_RESTRICTED(i)) continue;
  		/*
-@@ -962,6 +1016,9 @@
+@@ -962,6 +1018,9 @@
  		any.a_int = can_advance(i, speedy) ? i+1 : 0;
  		add_menu(win, NO_GLYPH, &any, 0, 0, ATR_NONE,
  			 buf, MENU_UNSELECTED);
@@ -1703,7 +1692,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/weapon.c nh343dump/src/weapo
  	    }
  
  	    Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" :
-@@ -971,6 +1028,12 @@
+@@ -971,6 +1030,12 @@
  		Sprintf(eos(buf), "  (%d slot%s available)",
  			u.weapon_slots, plur(u.weapon_slots));
  #endif
@@ -1716,7 +1705,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/weapon.c nh343dump/src/weapo
  	    end_menu(win, buf);
  	    n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected);
  	    destroy_nhwindow(win);
-@@ -987,6 +1050,9 @@
+@@ -987,6 +1052,9 @@
  		    }
  		}
  	    }
@@ -1726,10 +1715,9 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/src/weapon.c nh343dump/src/weapo
  	} while (speedy && n > 0);
  	return 0;
  }
-diff -Nurd --exclude-from=diff_ign.txt nh343off/win/tty/wintty.c nh343dump/win/tty/wintty.c
---- nh343off/win/tty/wintty.c	Mon Dec  8 01:39:14 2003
-+++ nh343dump/win/tty/wintty.c	Thu Dec 11 01:16:56 2003
-@@ -162,7 +162,7 @@
+--- a/win/tty/wintty.c
++++ b/win/tty/wintty.c
+@@ -166,7 +166,7 @@
  STATIC_DCL void FDECL(process_menu_window, (winid,struct WinDesc *));
  STATIC_DCL void FDECL(process_text_window, (winid,struct WinDesc *));
  STATIC_DCL tty_menu_item *FDECL(reverse, (tty_menu_item *));
@@ -1738,7 +1726,7 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/win/tty/wintty.c nh343dump/win/t
  STATIC_DCL void FDECL(tty_putsym, (winid, int, int, CHAR_P));
  static char *FDECL(copy_of, (const char *));
  STATIC_DCL void FDECL(bail, (const char *));	/* __attribute__((noreturn)) */
-@@ -1722,7 +1722,7 @@
+@@ -1765,7 +1765,7 @@
  }
  
  
@@ -1747,14 +1735,3 @@ diff -Nurd --exclude-from=diff_ign.txt nh343off/win/tty/wintty.c nh343dump/win/t
  compress_str(str)
  const char *str;
  {
---- nethack-3.4.3/include/config.h~	2004-03-12 18:13:05.000000000 -0800
-+++ nethack-3.4.3/include/config.h	2004-03-12 18:13:26.000000000 -0800
-@@ -364,6 +364,8 @@
- 
- /*#define GOLDOBJ */	/* Gold is kept on obj chains - Helge Hafting */
- /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */
-+#define DUMP_LOG
-+#define DUMP_FN "/var/games/nethack/dumps/%n.lastgame.txt"
- 
- /* End of Section 5 */
- 
diff --git a/debian/patches/94_enh_sortloot.dpatch b/debian/patches/0014-94_enh_sortloot.dpatch-by-Jeroen-Demeyer-and-Jukka-L.patch
similarity index 77%
rename from debian/patches/94_enh_sortloot.dpatch
rename to debian/patches/0014-94_enh_sortloot.dpatch-by-Jeroen-Demeyer-and-Jukka-L.patch
index 6d0300a..ac8b680 100644
--- a/debian/patches/94_enh_sortloot.dpatch
+++ b/debian/patches/0014-94_enh_sortloot.dpatch-by-Jeroen-Demeyer-and-Jukka-L.patch
@@ -1,32 +1,29 @@
-#! /bin/sh -e
-## 94_enh_sortloot.dpatch by Jeroen Demeyer and Jukka Lahtinen
-## from: http://www.netsonic.fi/~walker/nh/sortloot-343.diff
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Sort item lists alphabetically
+From f268f1f6066c0ec1a78c49be99babbe2ad927f8e Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: =?UTF-8?q?94=5Fenh=5Fsortloot.dpatch=20by=20Jeroen=20Demeyer=20and=20?=
+ =?UTF-8?q?Jukka=20Lahtinen=0ASort=20item=20lists=20alphabetically?=
 
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
+---
+ dat/opthelp       |    5 +++++
+ doc/Guidebook.mn  |   12 ++++++++++
+ doc/Guidebook.tex |   15 +++++++++++++
+ doc/Guidebook.txt |   12 ++++++++++
+ include/config.h  |    1 +
+ include/extern.h  |    3 +++
+ include/flag.h    |    3 +++
+ src/end.c         |   44 ++++++++++++++++++++++++++++++++++++
+ src/invent.c      |   64 +++++++++++++++++++++++++++++++++++++++++++++++++++++
+ src/objnam.c      |   25 +++++++++++++++++++++
+ src/options.c     |   64 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
+ src/pickup.c      |   41 ++++++++++++++++++++++++++++++++++
+ 12 files changed, 288 insertions(+), 1 deletion(-)
 
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
-
-diff -urd nethack-3.4.3/dat/opthelp nh343sortl/dat/opthelp
---- nethack-3.4.3/dat/opthelp	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/dat/opthelp	2004-01-09 17:41:16.000000000 +0200
-@@ -132,6 +132,11 @@
+diff --git a/dat/opthelp b/dat/opthelp
+index 4fa8f49..3c9138f 100644
+--- a/dat/opthelp
++++ b/dat/opthelp
+@@ -132,6 +132,11 @@ runmode       controls how often the map window is updated when performing
  scores        the parts of the score list you wish to see when the game ends
                You choose a combination of top scores, scores around the top
                scores, and all of your own scores.  [!own/3 top/2 around]
@@ -38,10 +35,11 @@ diff -urd nethack-3.4.3/dat/opthelp nh343sortl/dat/opthelp
  suppress_alert disable various version-specific warnings about changes
                in game play or the user interface, such as notification given
                for the 'Q' command that quitting is now done via #quit
-diff -urd nethack-3.4.3/doc/Guidebook.mn nh343sortl/doc/Guidebook.mn
---- nethack-3.4.3/doc/Guidebook.mn	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/doc/Guidebook.mn	2004-01-09 17:41:16.000000000 +0200
-@@ -2111,6 +2111,18 @@
+diff --git a/doc/Guidebook.mn b/doc/Guidebook.mn
+index 55a9cee..c0bcfb1 100644
+--- a/doc/Guidebook.mn
++++ b/doc/Guidebook.mn
+@@ -2111,6 +2111,18 @@ the appearance of the display, not the way the game treats you.
  Show your approximate accumulated score on bottom line (default off).
  .lp "silent  "
  Suppress terminal beeps (default on).
@@ -60,10 +58,11 @@ diff -urd nethack-3.4.3/doc/Guidebook.mn nh343sortl/doc/Guidebook.mn
  .lp sortpack
  Sort the pack contents by type when displaying inventory (default on).
  .lp sound
-diff -urd nethack-3.4.3/doc/Guidebook.tex nh343sortl/doc/Guidebook.tex
---- nethack-3.4.3/doc/Guidebook.tex	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/doc/Guidebook.tex	2004-01-09 17:41:16.000000000 +0200
-@@ -2589,6 +2589,21 @@
+diff --git a/doc/Guidebook.tex b/doc/Guidebook.tex
+index 69a8594..ddc08db 100644
+--- a/doc/Guidebook.tex
++++ b/doc/Guidebook.tex
+@@ -2589,6 +2589,21 @@ Show your approximate accumulated score on bottom line (default off).
  \item[\ib{silent}]
  Suppress terminal beeps (default on).
  %.lp
@@ -85,9 +84,10 @@ diff -urd nethack-3.4.3/doc/Guidebook.tex nh343sortl/doc/Guidebook.tex
  \item[\ib{sortpack}]
  Sort the pack contents by type when displaying inventory (default on).
  %.lp
-diff -urd nethack-3.4.3/doc/Guidebook.txt nh343sortl/doc/Guidebook.txt
---- nethack-3.4.3/doc/Guidebook.txt	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/doc/Guidebook.txt	2004-01-09 17:41:16.000000000 +0200
+diff --git a/doc/Guidebook.txt b/doc/Guidebook.txt
+index 17513e6..ba57778 100644
+--- a/doc/Guidebook.txt
++++ b/doc/Guidebook.txt
 @@ -2739,6 +2739,18 @@
            silent
              Suppress terminal beeps (default on).
@@ -107,10 +107,23 @@ diff -urd nethack-3.4.3/doc/Guidebook.txt nh343sortl/doc/Guidebook.txt
            sortpack
              Sort the pack contents by type when displaying  inventory  (de-
              fault on).
-diff -urd nethack-3.4.3/include/extern.h nh343sortl/include/extern.h
---- nethack-3.4.3/include/extern.h	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/include/extern.h	2004-01-09 17:46:28.000000000 +0200
-@@ -1378,6 +1378,9 @@
+diff --git a/include/config.h b/include/config.h
+index 26b68b5..c7a55ee 100644
+--- a/include/config.h
++++ b/include/config.h
+@@ -342,6 +342,7 @@ typedef unsigned char	uchar;
+ #define PARANOID
+ 
+ #define HPMON           /* Color HP monitor */
++#define SORTLOOT        /* Sort yer loot by alphabetical order, not index */
+ 
+ /* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson at ucivax) */
+ 
+diff --git a/include/extern.h b/include/extern.h
+index 2138f41..4c0225a 100644
+--- a/include/extern.h
++++ b/include/extern.h
+@@ -1378,6 +1378,9 @@ E char *FDECL(doname, (struct obj *));
  E boolean FDECL(not_fully_identified, (struct obj *));
  E char *FDECL(corpse_xname, (struct obj *,BOOLEAN_P));
  E char *FDECL(cxname, (struct obj *));
@@ -120,10 +133,11 @@ diff -urd nethack-3.4.3/include/extern.h nh343sortl/include/extern.h
  E char *FDECL(killer_xname, (struct obj *));
  E const char *FDECL(singular, (struct obj *,char *(*)(OBJ_P)));
  E char *FDECL(an, (const char *));
-diff -urd nethack-3.4.3/include/flag.h nh343sortl/include/flag.h
---- nethack-3.4.3/include/flag.h	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/include/flag.h	2004-01-09 17:41:16.000000000 +0200
-@@ -222,6 +222,9 @@
+diff --git a/include/flag.h b/include/flag.h
+index efe778e..78a0c33 100644
+--- a/include/flag.h
++++ b/include/flag.h
+@@ -222,6 +222,9 @@ struct instance_flags {
  	boolean lan_mail;	/* mail is initialized */
  	boolean lan_mail_fetched; /* mail is awaiting display */
  #endif
@@ -133,11 +147,12 @@ diff -urd nethack-3.4.3/include/flag.h nh343sortl/include/flag.h
  #ifdef PARANOID
  	boolean  paranoid_hit;  /* Ask for 'yes' when hitting peacefuls */
  #endif
-diff -urd nethack-3.4.3/src/end.c nh343sortl/src/end.c
---- nethack-3.4.3/src/end.c	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/src/end.c	2004-01-09 17:46:28.000000000 +0200
-@@ -1065,6 +1065,11 @@
- boolean identified, all_containers;
+diff --git a/src/end.c b/src/end.c
+index e33bd7f..7a79635 100644
+--- a/src/end.c
++++ b/src/end.c
+@@ -1065,6 +1065,11 @@ boolean identified, all_containers, want_dump;
+ /* The original container_contents function */
  {
  	register struct obj *box, *obj;
 +#ifdef SORTLOOT
@@ -148,7 +163,7 @@ diff -urd nethack-3.4.3/src/end.c nh343sortl/src/end.c
  	char buf[BUFSZ];
  
  	for (box = list; box; box = box->nobj) {
-@@ -1073,13 +1073,52 @@
+@@ -1073,13 +1078,52 @@ boolean identified, all_containers, want_dump;
  		    continue;	/* wrong type of container */
  		} else if (box->cobj) {
  		    winid tmpwin = create_nhwindow(NHW_MENU);
@@ -201,11 +216,11 @@ diff -urd nethack-3.4.3/src/end.c nh343sortl/src/end.c
  			if (identified) {
  			    makeknown(obj->otyp);
  			    obj->known = obj->bknown =
-diff -urd nethack-3.4.3/src/invent.c nh343sortl/src/invent.c
---- nethack-3.4.3/src/invent.c	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/src/invent.c	2004-01-09 17:46:28.000000000 +0200
-@@ -1713,7 +1713,11 @@
- long* out_cnt;
+diff --git a/src/invent.c b/src/invent.c
+index 93bbc9b..a35da0a 100644
+--- a/src/invent.c
++++ b/src/invent.c
+@@ -1714,6 +1714,10 @@ long* out_cnt;
  #endif
  {
  	struct obj *otmp;
@@ -216,7 +231,7 @@ diff -urd nethack-3.4.3/src/invent.c nh343sortl/src/invent.c
  	char ilet, ret;
  	char *invlet = flags.inv_order;
  	int n, classcount;
-@@ -1793,10 +1797,66 @@
+@@ -1793,10 +1797,66 @@ long* out_cnt;
  	    return ret;
  	}
  
@@ -283,7 +298,7 @@ diff -urd nethack-3.4.3/src/invent.c nh343sortl/src/invent.c
  	for(otmp = invent; otmp; otmp = otmp->nobj) {
  		ilet = otmp->invlet;
  		if(!lets || !*lets || index(lets, ilet)) {
-@@ -1825,6 +1885,7 @@
+@@ -1825,6 +1885,7 @@ nextclass:
  			}
  		}
  	}
@@ -291,7 +306,7 @@ diff -urd nethack-3.4.3/src/invent.c nh343sortl/src/invent.c
  	if (flags.sortpack) {
  		if (*++invlet) goto nextclass;
  #ifdef WIZARD
-@@ -1834,6 +1895,9 @@
+@@ -1834,6 +1895,9 @@ nextclass:
  		}
  #endif
  	}
@@ -301,10 +316,11 @@ diff -urd nethack-3.4.3/src/invent.c nh343sortl/src/invent.c
  	end_menu(win, (char *) 0);
  
  	n = select_menu(win, want_reply ? PICK_ONE : PICK_NONE, &selected);
-diff -urd nethack-3.4.3/src/objnam.c nh343sortl/src/objnam.c
---- nethack-3.4.3/src/objnam.c	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/src/objnam.c	2004-01-14 18:23:51.000000000 +0200
-@@ -15,6 +15,9 @@
+diff --git a/src/objnam.c b/src/objnam.c
+index 2130432..94b5040 100644
+--- a/src/objnam.c
++++ b/src/objnam.c
+@@ -15,6 +15,9 @@ static boolean FDECL(wishymatch, (const char *,const char *,BOOLEAN_P));
  #endif
  static char *NDECL(nextobuf);
  static void FDECL(add_erosion_words, (struct obj *, char *));
@@ -314,7 +330,7 @@ diff -urd nethack-3.4.3/src/objnam.c nh343sortl/src/objnam.c
  
  struct Jitem {
  	int item;
-@@ -233,6 +236,15 @@
+@@ -233,6 +236,15 @@ boolean juice;	/* whether or not to append " juice" to the name */
  char *
  xname(obj)
  register struct obj *obj;
@@ -330,7 +346,7 @@ diff -urd nethack-3.4.3/src/objnam.c nh343sortl/src/objnam.c
  {
  	register char *buf;
  	register int typ = obj->otyp;
-@@ -469,6 +481,9 @@
+@@ -469,6 +481,9 @@ register struct obj *obj;
  	default:
  		Sprintf(buf,"glorkum %d %d %d", obj->oclass, typ, obj->spe);
  	}
@@ -340,7 +356,7 @@ diff -urd nethack-3.4.3/src/objnam.c nh343sortl/src/objnam.c
  	if (obj->quan != 1L) Strcpy(buf, makeplural(buf));
  
  	if (obj->onamelth && obj->dknown) {
-@@ -853,6 +868,16 @@
+@@ -853,6 +868,16 @@ struct obj *obj;
  	    return corpse_xname(obj, FALSE);
  	return xname(obj);
  }
@@ -357,10 +373,11 @@ diff -urd nethack-3.4.3/src/objnam.c nh343sortl/src/objnam.c
  
  /* treat an object as fully ID'd when it might be used as reason for death */
  char *
-diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c
---- nethack-3.4.3/src/options.c	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/src/options.c	2004-01-09 17:41:16.000000000 +0200
-@@ -330,6 +330,9 @@
+diff --git a/src/options.c b/src/options.c
+index b4ca5ca..e06d01f 100644
+--- a/src/options.c
++++ b/src/options.c
+@@ -330,6 +330,9 @@ static struct Comp_Opt
  	{ "scroll_amount", "amount to scroll map when scroll_margin is reached",
  						20, DISP_IN_GAME }, /*WC*/
  	{ "scroll_margin", "scroll map when this far from the edge", 20, DISP_IN_GAME }, /*WC*/
@@ -370,7 +387,7 @@ diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c
  #ifdef MSDOS
  	{ "soundcard", "type of sound card to use", 20, SET_IN_FILE },
  #endif
-@@ -562,6 +565,10 @@
+@@ -562,6 +565,10 @@ initoptions()
  	flags.pickup_types[0] = '\0';
  	flags.pickup_burden = MOD_ENCUMBER;
  
@@ -381,7 +398,7 @@ diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c
  	for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++)
  		flags.end_disclose[i] = DISCLOSE_PROMPT_DEFAULT_NO;
  	switch_graphics(ASCII_GRAPHICS);	/* set default characters */
-@@ -2002,6 +2009,24 @@
+@@ -2002,6 +2009,24 @@ goodfruit:
  	    return;
  	}
  
@@ -406,7 +423,7 @@ diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c
  	fullname = "suppress_alert";
  	if (match_optname(opts, fullname, 4, TRUE)) {
  		op = string_for_opt(opts, negated);
-@@ -2426,6 +2451,12 @@
+@@ -2426,6 +2451,12 @@ static NEARDATA const char *runmodes[] = {
  	"teleport", "run", "walk", "crawl"
  };
  
@@ -419,7 +436,7 @@ diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c
  /*
   * Convert the given string of object classes to a string of default object
   * symbols.
-@@ -2703,7 +2734,7 @@
+@@ -2703,7 +2734,7 @@ boolean setinitial,setfromfile;
      boolean retval = FALSE;
      
      /* Special handling of menustyle, pickup_burden, pickup_types,
@@ -428,7 +445,7 @@ diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c
  #ifdef AUTOPICKUP_EXCEPTIONS
       * Also takes care of interactive autopickup_exception_handling changes.
  #endif
-@@ -2858,6 +2889,26 @@
+@@ -2858,6 +2889,26 @@ boolean setinitial,setfromfile;
  	}
  	destroy_nhwindow(tmpwin);
          retval = TRUE;
@@ -455,7 +472,7 @@ diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c
      }
  #endif
       else if (!strcmp("align_message", optname) ||
-@@ -3239,6 +3290,17 @@
+@@ -3239,6 +3290,17 @@ char *buf;
  		if (iflags.wc_scroll_margin) Sprintf(buf, "%d",iflags.wc_scroll_margin);
  		else Strcpy(buf, defopt);
  	}
@@ -473,10 +490,11 @@ diff -urd nethack-3.4.3/src/options.c nh343sortl/src/options.c
  	else if (!strcmp(optname, "player_selection"))
  		Sprintf(buf, "%s", iflags.wc_player_selection ? "prompts" : "dialog");
  #ifdef MSDOS
-diff -urd nethack-3.4.3/src/pickup.c nh343sortl/src/pickup.c
---- nethack-3.4.3/src/pickup.c	2003-12-08 01:39:13.000000000 +0200
-+++ nh343sortl/src/pickup.c	2004-01-09 17:46:28.000000000 +0200
-@@ -690,9 +690,15 @@
+diff --git a/src/pickup.c b/src/pickup.c
+index 07be607..8dea122 100644
+--- a/src/pickup.c
++++ b/src/pickup.c
+@@ -690,9 +690,15 @@ menu_item **pick_list;		/* return list of items picked */
  int how;			/* type of query */
  boolean FDECL((*allow), (OBJ_P));/* allow function */
  {
@@ -492,7 +510,7 @@ diff -urd nethack-3.4.3/src/pickup.c nh343sortl/src/pickup.c
  	char *pack;
  	anything any;
  	boolean printed_type_name;
-@@ -717,6 +723,33 @@
+@@ -717,6 +723,33 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
  	    return 1;
  	}
  
@@ -526,7 +544,7 @@ diff -urd nethack-3.4.3/src/pickup.c nh343sortl/src/pickup.c
  	win = create_nhwindow(NHW_MENU);
  	start_menu(win);
  	any.a_obj = (struct obj *) 0;
-@@ -730,7 +763,12 @@
+@@ -730,7 +763,12 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
  	pack = flags.inv_order;
  	do {
  	    printed_type_name = FALSE;
@@ -539,7 +557,7 @@ diff -urd nethack-3.4.3/src/pickup.c nh343sortl/src/pickup.c
  		if ((qflags & FEEL_COCKATRICE) && curr->otyp == CORPSE &&
  		     will_feel_cockatrice(curr, FALSE)) {
  			destroy_nhwindow(win);	/* stop the menu and revert */
-@@ -758,6 +796,9 @@
+@@ -758,6 +796,9 @@ boolean FDECL((*allow), (OBJ_P));/* allow function */
  	    pack++;
  	} while (qflags & INVORDER_SORT && *pack);
  
@@ -549,13 +567,3 @@ diff -urd nethack-3.4.3/src/pickup.c nh343sortl/src/pickup.c
  	end_menu(win, qstr);
  	n = select_menu(win, how, pick_list);
  	destroy_nhwindow(win);
---- nethack-3.4.3/include/config.h~	2004-07-11 00:41:08.000000000 -0700
-+++ nethack-3.4.3/include/config.h	2004-07-11 00:41:54.000000000 -0700
-@@ -342,6 +342,7 @@
- #define PARANOID
- 
- #define HPMON           /* Color HP monitor */
-+#define SORTLOOT        /* Sort yer loot by alphabetical order, not index */
- 
- /* #define SCORE_ON_BOTL */	/* added by Gary Erickson (erickson at ucivax) */
- 
diff --git a/debian/patches/95_enh_engulf_prayers.dpatch b/debian/patches/0015-95_enh_engulf_prayers.dpatch-by-Joshua-Kwan.patch
similarity index 67%
rename from debian/patches/95_enh_engulf_prayers.dpatch
rename to debian/patches/0015-95_enh_engulf_prayers.dpatch-by-Joshua-Kwan.patch
index 923b726..b01ecf8 100644
--- a/debian/patches/95_enh_engulf_prayers.dpatch
+++ b/debian/patches/0015-95_enh_engulf_prayers.dpatch-by-Joshua-Kwan.patch
@@ -1,30 +1,18 @@
-#! /bin/sh -e
-## 95_enh_engulf_prayers.dpatch by Joshua Kwan
-## 
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Prayer can expel you from being swallowed.
+From 382bd8c14d2749df0325358278acc04b9e30ae26 Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: =?UTF-8?q?95=5Fenh=5Fengulf=5Fprayers.dpatch=20by=20Joshua=20Kwan=0A?=
+ =?UTF-8?q?Prayer=20can=20expel=20you=20from=20being=20swallowed.?=
 
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
+---
+ src/pray.c |   28 ++++++++++++++++++++++------
+ 1 file changed, 22 insertions(+), 6 deletions(-)
 
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
-
---- nethack-3.4.3/src/pray.c~	2003-12-08 01:39:13.000000000 +0200
-+++ nethack-3.4.3/src/pray.c	2005-07-14 11:49:16.000000000 +0300
-@@ -70,12 +70,13 @@
+diff --git a/src/pray.c b/src/pray.c
+index 0df2855..3caa8c4 100644
+--- a/src/pray.c
++++ b/src/pray.c
+@@ -70,12 +70,13 @@ static int p_type; /* (-1)-3: (-1)=really naughty, 3=really good */
   * order to have the values be meaningful.
   */
  
@@ -44,7 +32,7 @@ exit 0
  #define TROUBLE_HIT			 7
  #define TROUBLE_LYCANTHROPE		 6
  #define TROUBLE_COLLAPSING		 5
-@@ -141,6 +142,7 @@
+@@ -141,6 +142,7 @@ in_trouble()
  	if(u.utrap && u.utraptype == TT_LAVA) return(TROUBLE_LAVA);
  	if(Sick) return(TROUBLE_SICK);
  	if(u.uhs >= WEAK) return(TROUBLE_STARVING);
@@ -52,7 +40,7 @@ exit 0
  	if (Upolyd ? (u.mh <= 5 || u.mh*7 <= u.mhmax) :
  		(u.uhp <= 5 || u.uhp*7 <= u.uhpmax)) return TROUBLE_HIT;
  	if(u.ulycn >= LOW_PM) return(TROUBLE_LYCANTHROPE);
-@@ -267,6 +269,7 @@
+@@ -267,6 +269,7 @@ register int trouble;
  	int i;
  	struct obj *otmp = 0;
  	const char *what = (const char *)0;
@@ -60,7 +48,7 @@ exit 0
  	static NEARDATA const char leftglow[] = "left ring softly glows",
  				   rightglow[] = "right ring softly glows";
  
-@@ -312,6 +315,19 @@
+@@ -312,6 +315,19 @@ register int trouble;
  		    You_feel("better.");
  		    make_sick(0L, (char *) 0, FALSE, SICK_ALL);
  		    break;
diff --git a/debian/patches/0016-fix-non-constant-format-strings.patch b/debian/patches/0016-fix-non-constant-format-strings.patch
new file mode 100644
index 0000000..94dabc6
--- /dev/null
+++ b/debian/patches/0016-fix-non-constant-format-strings.patch
@@ -0,0 +1,1414 @@
+From 01b718a7e0faa11ba36313b661e38e345f49231d Mon Sep 17 00:00:00 2001
+From: "Bernhard R. Link" <brlink at debian.org>
+Date: Sun, 10 Jun 2012 14:28:44 +0200
+Subject: fix non-constant format strings
+
+With the default dpkg-buildflags, gcc reports format strings it
+cannot check as errors. This patch avoids all cases where gcc
+complains.
+---
+ include/extern.h |    1 +
+ src/apply.c      |   58 +++++++++++++++++++++++++++---------------------------
+ src/artifact.c   |    2 +-
+ src/botl.c       |    4 ++--
+ src/cmd.c        |    8 ++++----
+ src/detect.c     |    4 ++--
+ src/dig.c        |    2 +-
+ src/do.c         |   10 +++++-----
+ src/dothrow.c    |    2 +-
+ src/dungeon.c    |    2 +-
+ src/eat.c        |    6 +++---
+ src/engrave.c    |    8 ++++----
+ src/hack.c       |    6 +++---
+ src/invent.c     |   12 +++++------
+ src/lock.c       |    2 +-
+ src/mail.c       |    2 +-
+ src/makemon.c    |    2 +-
+ src/mcastu.c     |    2 +-
+ src/mhitu.c      |    8 ++++----
+ src/mon.c        |    2 +-
+ src/mthrowu.c    |    2 +-
+ src/muse.c       |    4 ++--
+ src/pline.c      |    6 ++++++
+ src/polyself.c   |    4 ++--
+ src/potion.c     |    6 +++---
+ src/pray.c       |    2 +-
+ src/priest.c     |    6 +++---
+ src/questpgr.c   |    2 +-
+ src/read.c       |   18 ++++++++---------
+ src/region.c     |    4 ++--
+ src/restore.c    |    2 +-
+ src/rumors.c     |    4 ++--
+ src/shk.c        |    6 +++---
+ src/sounds.c     |   18 ++++++++---------
+ src/spell.c      |    2 +-
+ src/steed.c      |    2 +-
+ src/teleport.c   |   12 +++++------
+ src/timeout.c    |    8 ++++----
+ src/trap.c       |    4 ++--
+ src/uhitm.c      |    2 +-
+ src/zap.c        |   24 +++++++++++-----------
+ 41 files changed, 144 insertions(+), 137 deletions(-)
+
+diff --git a/include/extern.h b/include/extern.h
+index 4c0225a..3e986b3 100644
+--- a/include/extern.h
++++ b/include/extern.h
+@@ -1525,6 +1525,7 @@ E boolean FDECL(is_autopickup_exception, (struct obj *, BOOLEAN_P));
+ /* ### pline.c ### */
+ 
+ E void VDECL(pline, (const char *,...)) PRINTF_F(1,2);
++E void FDECL(plines, (const char *));
+ E void VDECL(Norep, (const char *,...)) PRINTF_F(1,2);
+ E void NDECL(free_youbuf);
+ E void VDECL(You, (const char *,...)) PRINTF_F(1,2);
+diff --git a/src/apply.c b/src/apply.c
+index f45e196..25f5b40 100644
+--- a/src/apply.c
++++ b/src/apply.c
+@@ -62,7 +62,7 @@ use_camera(obj)
+ 	if(!getdir((char *)0)) return(0);
+ 
+ 	if (obj->spe <= 0) {
+-		pline(nothing_happens);
++		plines(nothing_happens);
+ 		return (1);
+ 	}
+ 	consume_obj_charge(obj, TRUE);
+@@ -802,7 +802,7 @@ struct obj **optr;
+ 		if (!obj->cursed)
+ 		    (void) openit();
+ 		else
+-		    pline(nothing_happens);
++		    plines(nothing_happens);
+ 
+ 	    } else if (obj->cursed) {
+ 		coord mm;
+@@ -834,7 +834,7 @@ struct obj **optr;
+ 		}
+ 		res += openit();
+ 		switch (res) {
+-		  case 0:  pline(nothing_happens); break;
++		  case 0:  plines(nothing_happens); break;
+ 		  case 1:  pline("%s opens...", Something);
+ 			   learno = TRUE; break;
+ 		  default: pline("Things open around you...");
+@@ -846,7 +846,7 @@ struct obj **optr;
+ 		amii_speaker( obj, "AeFeaeFeAefegw", AMII_OKAY_VOLUME );
+ #endif
+ 		if (findit() != 0) learno = TRUE;
+-		else pline(nothing_happens);
++		else plines(nothing_happens);
+ 	    }
+ 
+ 	}	/* charged BofO */
+@@ -1192,12 +1192,12 @@ dorub()
+ 		update_inventory();
+ 	    } else if (rn2(2) && !Blind)
+ 		You("see a puff of smoke.");
+-	    else pline(nothing_happens);
++	    else plines(nothing_happens);
+ 	} else if (obj->otyp == BRASS_LANTERN) {
+ 	    /* message from Adventure */
+ 	    pline("Rubbing the electric lamp is not particularly rewarding.");
+ 	    pline("Anyway, nothing exciting happens.");
+-	} else pline(nothing_happens);
++	} else plines(nothing_happens);
+ 	return 1;
+ }
+ 
+@@ -1510,7 +1510,7 @@ struct obj *obj;
+ 	}
+ 
+ 	if (trouble_count == 0) {
+-	    pline(nothing_happens);
++	    plines(nothing_happens);
+ 	    return;
+ 	} else if (trouble_count > 1) {		/* shuffle */
+ 	    int i, j, k;
+@@ -1888,7 +1888,7 @@ struct obj *tstone;
+     }
+ 
+     if (Blind) {
+-	pline(scritch);
++	plines(scritch);
+ 	return;
+     } else if (Hallucination) {
+ 	pline("Oh wow, man: Fractals!");
+@@ -1966,7 +1966,7 @@ struct obj *tstone;
+     else if (streak_color)
+ 	pline("You see %s streaks on the %s.", streak_color, stonebuf);
+     else
+-	pline(scritch);
++	plines(scritch);
+     return;
+ }
+ 
+@@ -2172,7 +2172,7 @@ struct obj *obj;
+ 		You("wrap your bullwhip around %s on the %s.",
+ 		    an(singular(otmp, xname)), surface(u.ux, u.uy));
+ 		if (rnl(6) || pickup_object(otmp, 1L, TRUE) < 1)
+-		    pline(msg_slipsfree);
++		    plines(msg_slipsfree);
+ 		return 1;
+ 	    }
+ 	}
+@@ -2213,7 +2213,7 @@ struct obj *obj;
+ 		wrapped_what = strcpy(buf, mon_nam(mtmp));
+ 	    } else if (proficient) {
+ 		if (attack(mtmp)) return 1;
+-		else pline(msg_snap);
++		else plines(msg_snap);
+ 	    }
+ 	}
+ 	if (!wrapped_what) {
+@@ -2235,10 +2235,10 @@ struct obj *obj;
+ 		    vision_full_recalc = 1;
+ 		}
+ 	    } else {
+-		pline(msg_slipsfree);
++		plines(msg_slipsfree);
+ 	    }
+ 	    if (mtmp) wakeup(mtmp);
+-	} else pline(msg_snap);
++	} else plines(msg_snap);
+ 
+     } else if (mtmp) {
+ 	if (!canspotmon(mtmp) &&
+@@ -2330,7 +2330,7 @@ struct obj *obj;
+ 		    break;
+ 		}
+ 	    } else {
+-		pline(msg_slipsfree);
++		plines(msg_slipsfree);
+ 	    }
+ 	    wakeup(mtmp);
+ 	} else {
+@@ -2340,7 +2340,7 @@ struct obj *obj;
+ 	    else You("flick your bullwhip towards %s.", mon_nam(mtmp));
+ 	    if (proficient) {
+ 		if (attack(mtmp)) return 1;
+-		else pline(msg_snap);
++		else plines(msg_snap);
+ 	    }
+ 	}
+ 
+@@ -2349,7 +2349,7 @@ struct obj *obj;
+ 	    You("snap your whip through thin air.");
+ 
+     } else {
+-	pline(msg_snap);
++	plines(msg_snap);
+ 
+     }
+     return 1;
+@@ -2374,7 +2374,7 @@ use_pole (obj)
+ 
+ 	/* Are you allowed to use the pole? */
+ 	if (u.uswallow) {
+-	    pline(not_enough_room);
++	    plines(not_enough_room);
+ 	    return (0);
+ 	}
+ 	if (obj != uwep) {
+@@ -2384,7 +2384,7 @@ use_pole (obj)
+      /* assert(obj == uwep); */
+ 
+ 	/* Prompt for a location */
+-	pline(where_to_hit);
++	plines(where_to_hit);
+ 	cc.x = u.ux;
+ 	cc.y = u.uy;
+ 	if (getpos(&cc, TRUE, "the spot to hit") < 0)
+@@ -2404,10 +2404,10 @@ use_pole (obj)
+ 	} else if (!cansee(cc.x, cc.y) &&
+ 		   ((mtmp = m_at(cc.x, cc.y)) == (struct monst *)0 ||
+ 		    !canseemon(mtmp))) {
+-	    You(cant_see_spot);
++	    You("%s", cant_see_spot);
+ 	    return (res);
+ 	} else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
+-	    You(cant_reach);
++	    You("%s", cant_reach);
+ 	    return res;
+ 	}
+ 
+@@ -2426,7 +2426,7 @@ use_pole (obj)
+ 		u.uconduct.weaphit++;
+ 	} else
+ 	    /* Now you know that nothing is there... */
+-	    pline(nothing_happens);
++	    plines(nothing_happens);
+ 	return (1);
+ }
+ 
+@@ -2480,7 +2480,7 @@ use_grapple (obj)
+ 
+ 	/* Are you allowed to use the hook? */
+ 	if (u.uswallow) {
+-	    pline(not_enough_room);
++	    plines(not_enough_room);
+ 	    return (0);
+ 	}
+ 	if (obj != uwep) {
+@@ -2490,7 +2490,7 @@ use_grapple (obj)
+      /* assert(obj == uwep); */
+ 
+ 	/* Prompt for a location */
+-	pline(where_to_hit);
++	plines(where_to_hit);
+ 	cc.x = u.ux;
+ 	cc.y = u.uy;
+ 	if (getpos(&cc, TRUE, "the spot to hit") < 0)
+@@ -2505,10 +2505,10 @@ use_grapple (obj)
+ 	    pline("Too far!");
+ 	    return (res);
+ 	} else if (!cansee(cc.x, cc.y)) {
+-	    You(cant_see_spot);
++	    You("%s", cant_see_spot);
+ 	    return (res);
+ 	} else if (!couldsee(cc.x, cc.y)) { /* Eyes of the Overworld */
+-	    You(cant_reach);
++	    You("%s", cant_reach);
+ 	    return res;
+ 	}
+ 
+@@ -2588,7 +2588,7 @@ use_grapple (obj)
+ 	    }
+ 	    break;
+ 	}
+-	pline(nothing_happens);
++	plines(nothing_happens);
+ 	return (1);
+ }
+ 
+@@ -2638,7 +2638,7 @@ do_break_wand(obj)
+     setnotworn(obj);		/* so we need to do this ourselves */
+ 
+     if (obj->spe <= 0) {
+-	pline(nothing_else_happens);
++	plines(nothing_else_happens);
+ 	goto discard_broken_wand;
+     }
+     obj->ox = u.ux;
+@@ -2654,7 +2654,7 @@ do_break_wand(obj)
+     case WAN_ENLIGHTENMENT:
+     case WAN_OPENING:
+     case WAN_SECRET_DOOR_DETECTION:
+-	pline(nothing_else_happens);
++	plines(nothing_else_happens);
+ 	goto discard_broken_wand;
+     case WAN_DEATH:
+     case WAN_LIGHTNING:
+@@ -2989,7 +2989,7 @@ doapply()
+ 					       (const char *)0);
+ 		    makeknown(HORN_OF_PLENTY);
+ 		} else
+-		    pline(nothing_happens);
++		    plines(nothing_happens);
+ 		break;
+ 	case LAND_MINE:
+ 	case BEARTRAP:
+diff --git a/src/artifact.c b/src/artifact.c
+index ef27bd5..8336d20 100644
+--- a/src/artifact.c
++++ b/src/artifact.c
+@@ -1191,7 +1191,7 @@ arti_invoke(obj)
+ 	if(obj->otyp == CRYSTAL_BALL)
+ 	    use_crystal_ball(obj);
+ 	else
+-	    pline(nothing_happens);
++	    plines(nothing_happens);
+ 	return 1;
+     }
+ 
+diff --git a/src/botl.c b/src/botl.c
+index 7defa38..dea4361 100644
+--- a/src/botl.c
++++ b/src/botl.c
+@@ -195,9 +195,9 @@ bot1()
+ 			mbot[k] += 'A' - 'a';
+ 		    k++;
+ 		}
+-		Sprintf(nb = eos(nb), mbot);
++		Sprintf(nb = eos(nb), "%s", mbot);
+ 	} else
+-		Sprintf(nb = eos(nb), rank());
++		Sprintf(nb = eos(nb), "%s", rank());
+ 
+ 	Sprintf(nb = eos(nb),"  ");
+ 	i = mrank_sz + 15;
+diff --git a/src/cmd.c b/src/cmd.c
+index c85d851..22487f7 100644
+--- a/src/cmd.c
++++ b/src/cmd.c
+@@ -602,7 +602,7 @@ wiz_level_change()
+     else ret = sscanf(buf, "%d", &newlevel);
+ 
+     if (ret != 1) {
+-	pline(Never_mind);
++	plines(Never_mind);
+ 	return 0;
+     }
+     if (newlevel == u.ulevel) {
+@@ -2447,7 +2447,7 @@ coord *cc;
+ {
+ 	xchar new_x, new_y;
+ 	if (!getdir(prompt)) {
+-		pline(Never_mind);
++		plines(Never_mind);
+ 		return 0;
+ 	}
+ 	new_x = x + u.dx;
+@@ -2456,7 +2456,7 @@ coord *cc;
+ 		cc->x = new_x;
+ 		cc->y = new_y;
+ 	} else {
+-		if (emsg) pline(emsg);
++		if (emsg) plines(emsg);
+ 		return 0;
+ 	}
+ 	return 1;
+@@ -2727,7 +2727,7 @@ parse()
+ 		    if (multi > 9) {
+ 			clear_nhwindow(WIN_MESSAGE);
+ 			Sprintf(in_line, "Count: %d", multi);
+-			pline(in_line);
++			plines(in_line);
+ 			mark_synch();
+ 		    }
+ 		    last_multi = multi;
+diff --git a/src/detect.c b/src/detect.c
+index 5da025f..6f5ca5e 100644
+--- a/src/detect.c
++++ b/src/detect.c
+@@ -808,7 +808,7 @@ struct obj *obj;
+ 	case 3 : if (!resists_blnd(&youmonst)) {
+ 		pline("%s your vision!", Tobjnam(obj, "damage"));
+ 		make_blinded(Blinded + rnd(100),FALSE);
+-		if (!Blind) Your(vision_clears);
++		if (!Blind) Your("%s", vision_clears);
+ 	    } else {
+ 		pline("%s your vision.", Tobjnam(obj, "assault"));
+ 		You("are unaffected!");
+@@ -857,7 +857,7 @@ struct obj *obj;
+     ch = yn_function("What do you look for?", (char *)0, '\0');
+     /* Don't filter out ' ' here; it has a use */
+     if ((ch != def_monsyms[S_GHOST]) && index(quitchars,ch)) { 
+-	if (flags.verbose) pline(Never_mind);
++	if (flags.verbose) plines(Never_mind);
+ 	return;
+     }
+     You("peer into %s...", the(xname(obj)));
+diff --git a/src/dig.c b/src/dig.c
+index 4c40a59..a93bebd 100644
+--- a/src/dig.c
++++ b/src/dig.c
+@@ -379,7 +379,7 @@ dig()
+ 		    feel_location(dpx, dpy);
+ 		else
+ 		    newsym(dpx, dpy);
+-		if(digtxt && !digging.quiet) pline(digtxt); /* after newsym */
++		if(digtxt && !digging.quiet) plines(digtxt); /* after newsym */
+ 		if(dmgtxt)
+ 		    pay_for_damage(dmgtxt, FALSE);
+ 
+diff --git a/src/do.c b/src/do.c
+index 858777f..42234a2 100644
+--- a/src/do.c
++++ b/src/do.c
+@@ -1310,7 +1310,7 @@ boolean at_stairs, falling, portal;
+ 		Sprintf(buf, mesg, !Blind ? "looks" : "seems");
+ 		mesg = buf;
+ 	    }
+-	    if (mesg) pline(mesg);
++	    if (mesg) plines(mesg);
+ 	}
+ 
+ #ifdef REINCARNATION
+@@ -1422,8 +1422,8 @@ final_level()
+ 	}
+ }
+ 
+-static char *dfr_pre_msg = 0,	/* pline() before level change */
+-	    *dfr_post_msg = 0;	/* pline() after level change */
++static char *dfr_pre_msg = 0,	/* plines() before level change */
++	    *dfr_post_msg = 0;	/* plines() after level change */
+ 
+ /* change levels at the end of this turn, after monsters finish moving */
+ void
+@@ -1459,7 +1459,7 @@ deferred_goto()
+ 	    int typmask = u.utotype; /* save it; goto_level zeroes u.utotype */
+ 
+ 	    assign_level(&dest, &u.utolev);
+-	    if (dfr_pre_msg) pline(dfr_pre_msg);
++	    if (dfr_pre_msg) plines(dfr_pre_msg);
+ 	    goto_level(&dest, !!(typmask&1), !!(typmask&2), !!(typmask&4));
+ 	    if (typmask & 0200) {	/* remove portal */
+ 		struct trap *t = t_at(u.ux, u.uy);
+@@ -1469,7 +1469,7 @@ deferred_goto()
+ 		    newsym(u.ux, u.uy);
+ 		}
+ 	    }
+-	    if (dfr_post_msg) pline(dfr_post_msg);
++	    if (dfr_post_msg) plines(dfr_post_msg);
+ 	}
+ 	u.utotype = 0;		/* our caller keys off of this */
+ 	if (dfr_pre_msg)
+diff --git a/src/dothrow.c b/src/dothrow.c
+index 2c4389a..325ea88 100644
+--- a/src/dothrow.c
++++ b/src/dothrow.c
+@@ -770,7 +770,7 @@ boolean hitsroof;
+ 			pline("It blinds you!");
+ 		    u.ucreamed += blindinc;
+ 		    make_blinded(Blinded + (long)blindinc, FALSE);
+-		    if (!Blind) Your(vision_clears);
++		    if (!Blind) Your("%s", vision_clears);
+ 		}
+ 		break;
+ 	default:
+diff --git a/src/dungeon.c b/src/dungeon.c
+index b87b8bb..ff5c394 100644
+--- a/src/dungeon.c
++++ b/src/dungeon.c
+@@ -674,7 +674,7 @@ init_dungeons()		/* initialize the "dungeon" structs */
+ 	    interject_assistance(1, INTERJECT_PANIC, (genericptr_t)tbuf,
+ 				 (genericptr_t)fqn_prefix[DATAPREFIX]);
+ #endif
+-	    panic(tbuf);
++	    panic("%s", tbuf);
+ 	}
+ 
+ 	/* validate the data's version against the program's version */
+diff --git a/src/eat.c b/src/eat.c
+index 12e8d9b..27fe5bf 100644
+--- a/src/eat.c
++++ b/src/eat.c
+@@ -422,7 +422,7 @@ boolean message;
+ 	occupation = 0; /* do this early, so newuhs() knows we're done */
+ 	newuhs(FALSE);
+ 	if (nomovemsg) {
+-		if (message) pline(nomovemsg);
++		if (message) plines(nomovemsg);
+ 		nomovemsg = 0;
+ 	} else if (message)
+ 		You("finish eating %s.", food_xname(victual.piece, TRUE));
+@@ -1208,7 +1208,7 @@ struct obj *obj;
+ 	} else if(!rn2(4) && !Blind) {
+ 		pline("Everything suddenly goes dark.");
+ 		make_blinded((long)d(2,10),FALSE);
+-		if (!Blind) Your(vision_clears);
++		if (!Blind) Your("%s", vision_clears);
+ 	} else if(!rn2(3)) {
+ 		const char *what, *where;
+ 		if (!Blind)
+@@ -2360,7 +2360,7 @@ boolean incr;
+ 			break;
+ 		case WEAK:
+ 			if (Hallucination)
+-			    pline((!incr) ?
++			    plines((!incr) ?
+ 				  "You still have the munchies." :
+       "The munchies are interfering with your motor capabilities.");
+ 			else if (incr &&
+diff --git a/src/engrave.c b/src/engrave.c
+index fe09b4f..11b1be4 100644
+--- a/src/engrave.c
++++ b/src/engrave.c
+@@ -890,7 +890,7 @@ doengrave()
+ 		c = yn_function("Do you want to add to the current engraving?",
+ 				ynqchars, 'y');
+ 		if (c == 'q') {
+-		    pline(Never_mind);
++		    plines(Never_mind);
+ 		    return(0);
+ 		}
+ 	    }
+@@ -983,7 +983,7 @@ doengrave()
+ 			  Tobjnam(otmp, "glow"), otense(otmp, "fade"));
+ 		return(1);
+ 	    } else {
+-		pline(Never_mind);
++		plines(Never_mind);
+ 		return(0);
+ 	    }
+ 	}
+@@ -1100,12 +1100,12 @@ doengrave()
+ 
+ 	make_engr_at(u.ux, u.uy, buf, (moves - multi), type);
+ 
+-	if (post_engr_text[0]) pline(post_engr_text);
++	if (post_engr_text[0]) plines(post_engr_text);
+ 
+ 	if (doblind && !resists_blnd(&youmonst)) {
+ 	    You("are blinded by the flash!");
+ 	    make_blinded((long)rnd(50),FALSE);
+-	    if (!Blind) Your(vision_clears);
++	    if (!Blind) Your("%s", vision_clears);
+ 	}
+ 
+ 	return(1);
+diff --git a/src/hack.c b/src/hack.c
+index 0e89c3b..e636549 100644
+--- a/src/hack.c
++++ b/src/hack.c
+@@ -423,7 +423,7 @@ still_chewing(x,y)
+ 
+     unblock_point(x, y);	/* vision */
+     newsym(x, y);
+-    if (digtxt) You(digtxt);	/* after newsym */
++    if (digtxt) You("%s", digtxt);	/* after newsym */
+     if (dmgtxt) pay_for_damage(dmgtxt, FALSE);
+     (void) memset((genericptr_t)&digging, 0, sizeof digging);
+     return 0;
+@@ -2082,7 +2082,7 @@ const char *msg_override;
+ 	multi = 0;	/* caller will usually have done this already */
+ 	if (msg_override) nomovemsg = msg_override;
+ 	else if (!nomovemsg) nomovemsg = You_can_move_again;
+-	if (*nomovemsg) pline(nomovemsg);
++	if (*nomovemsg) plines(nomovemsg);
+ 	nomovemsg = 0;
+ 	u.usleep = 0;
+ 	if (afternmv) (*afternmv)();
+@@ -2257,7 +2257,7 @@ const char *str;
+ {
+     if(near_capacity() >= EXT_ENCUMBER) {
+ 	if(str)
+-	    pline(str);
++	    plines(str);
+ 	else
+ 	    You_cant("do that while carrying so much stuff.");
+ 	return 1;
+diff --git a/src/invent.c b/src/invent.c
+index a35da0a..ee401c5 100644
+--- a/src/invent.c
++++ b/src/invent.c
+@@ -976,7 +976,7 @@ register const char *let,*word;
+ 		}
+ 		if(index(quitchars,ilet)) {
+ 		    if(flags.verbose)
+-			pline(Never_mind);
++			plines(Never_mind);
+ 		    return((struct obj *)0);
+ 		}
+ 		if(ilet == '-') {
+@@ -1035,7 +1035,7 @@ register const char *let,*word;
+ 		    }
+ 		    if(ilet == '\033') {
+ 			if(flags.verbose)
+-			    pline(Never_mind);
++			    plines(Never_mind);
+ 			return((struct obj *)0);
+ 		    }
+ 		    /* they typed a letter (not a space) at the prompt */
+@@ -2347,7 +2347,7 @@ boolean picked_some;
+ 		Sprintf(fbuf, "There is %s here.", an(dfeature));
+ 
+ 	if (!otmp || is_lava(u.ux,u.uy) || (is_pool(u.ux,u.uy) && !Underwater)) {
+-		if (dfeature) pline(fbuf);
++		if (dfeature) plines(fbuf);
+ 		read_engr_at(u.ux, u.uy); /* Eric Backus */
+ 		if (!skip_objects && (Blind || !dfeature))
+ 		    You("%s no objects here.", verb);
+@@ -2356,14 +2356,14 @@ boolean picked_some;
+ 	/* we know there is something here */
+ 
+ 	if (skip_objects) {
+-	    if (dfeature) pline(fbuf);
++	    if (dfeature) plines(fbuf);
+ 	    read_engr_at(u.ux, u.uy); /* Eric Backus */
+ 	    There("are %s%s objects here.",
+ 		  (obj_cnt <= 10) ? "several" : "many",
+ 		  picked_some ? " more" : "");
+ 	} else if (!otmp->nexthere) {
+ 	    /* only one object */
+-	    if (dfeature) pline(fbuf);
++	    if (dfeature) plines(fbuf);
+ 	    read_engr_at(u.ux, u.uy); /* Eric Backus */
+ #ifdef INVISIBLE_OBJECTS
+ 	    if (otmp->oinvis && !See_invisible) verb = "feel";
+@@ -2817,7 +2817,7 @@ doorganize()	/* inventory organizer by Del Lamb */
+ 		Sprintf(qbuf, "Adjust letter to what [%s]?",buf);
+ 		let = yn_function(qbuf, (char *)0, '\0');
+ 		if(index(quitchars,let)) {
+-			pline(Never_mind);
++			plines(Never_mind);
+ 			return(0);
+ 		}
+ 		if (let == '@' || !letter(let))
+diff --git a/src/lock.c b/src/lock.c
+index 4d5d333..f73b503 100644
+--- a/src/lock.c
++++ b/src/lock.c
+@@ -862,7 +862,7 @@ int x, y;
+ 	default: impossible("magic (%d) attempted on door.", otmp->otyp);
+ 	    break;
+ 	}
+-	if (msg && cansee(x,y)) pline(msg);
++	if (msg && cansee(x,y)) plines(msg);
+ 	if (loudness > 0) {
+ 	    /* door was destroyed */
+ 	    wake_nearto(x, y, loudness);
+diff --git a/src/mail.c b/src/mail.c
+index 9b1e4f6..dd8fb4a 100644
+--- a/src/mail.c
++++ b/src/mail.c
+@@ -321,7 +321,7 @@ md_rush(md,tx,ty)
+ 	if (fx == tx && fy == ty) break;
+ 
+ 	if ((mon = m_at(fx,fy)) != 0)	/* save monster at this position */
+-	    verbalize(md_exclamations());
++	    verbalize("%s", md_exclamations());
+ 	else if (fx == u.ux && fy == u.uy)
+ 	    verbalize("Excuse me.");
+ 
+diff --git a/src/makemon.c b/src/makemon.c
+index 89098dd..32ae932 100644
+--- a/src/makemon.c
++++ b/src/makemon.c
+@@ -1779,7 +1779,7 @@ struct obj *bag;
+     if (!bag || bag->otyp != BAG_OF_TRICKS) {
+ 	impossible("bad bag o' tricks");
+     } else if (bag->spe < 1) {
+-	pline(nothing_happens);
++	plines(nothing_happens);
+     } else {
+ 	boolean gotone = FALSE;
+ 	int cnt = 1;
+diff --git a/src/mcastu.c b/src/mcastu.c
+index 93d3b8d..549caf4 100644
+--- a/src/mcastu.c
++++ b/src/mcastu.c
+@@ -590,7 +590,7 @@ int spellnum;
+ 		  (num_eyes == 1) ?
+ 		  body_part(EYE) : makeplural(body_part(EYE)));
+ 	    make_blinded(Half_spell_damage ? 100L : 200L, FALSE);
+-	    if (!Blind) Your(vision_clears);
++	    if (!Blind) Your("%s", vision_clears);
+ 	    dmg = 0;
+ 	} else
+ 	    impossible("no reason for monster to cast blindness spell?");
+diff --git a/src/mhitu.c b/src/mhitu.c
+index c0711fc..7df5b5e 100644
+--- a/src/mhitu.c
++++ b/src/mhitu.c
+@@ -1036,7 +1036,7 @@ hitmu(mtmp, mattk)
+ 		if (can_blnd(mtmp, &youmonst, mattk->aatyp, (struct obj*)0)) {
+ 		    if (!Blind) pline("%s blinds you!", Monnam(mtmp));
+ 		    make_blinded(Blinded+(long)dmg,FALSE);
+-		    if (!Blind) Your(vision_clears);
++		    if (!Blind) Your("%s", vision_clears);
+ 		}
+ 		dmg = 0;
+ 		break;
+@@ -1742,7 +1742,7 @@ gulpmu(mtmp, mattk)	/* monster swallows you, or damage if u.uswallow */
+ 			if(!Blind) {
+ 			    You_cant("see in here!");
+ 			    make_blinded((long)tmp,FALSE);
+-			    if (!Blind) Your(vision_clears);
++			    if (!Blind) Your("%s", vision_clears);
+ 			} else
+ 			    /* keep him blind until disgorged */
+ 			    make_blinded(Blinded+1,FALSE);
+@@ -1858,7 +1858,7 @@ common:
+ 		    if (mon_visible(mtmp) || (rnd(tmp /= 2) > u.ulevel)) {
+ 			You("are blinded by a blast of light!");
+ 			make_blinded((long)tmp, FALSE);
+-			if (!Blind) Your(vision_clears);
++			if (!Blind) Your("%s", vision_clears);
+ 		    } else if (flags.verbose)
+ 			You("get the impression it was not terribly bright.");
+ 		}
+@@ -1985,7 +1985,7 @@ gazemu(mtmp, mattk)	/* monster gazes at you */
+ 		    /* not blind at this point implies you're wearing
+ 		       the Eyes of the Overworld; make them block this
+ 		       particular stun attack too */
+-		    if (!Blind) Your(vision_clears);
++		    if (!Blind) Your("%s", vision_clears);
+ 		    else make_stunned((long)d(1,3),TRUE);
+ 		}
+ 		break;
+diff --git a/src/mon.c b/src/mon.c
+index c769953..74bb15c 100644
+--- a/src/mon.c
++++ b/src/mon.c
+@@ -2370,7 +2370,7 @@ struct monst *mon;
+ 				You("cannot polymorph %s into that.", mon_nam(mon));
+ 			else break;
+ 		} while(++tries < 5);
+-		if (tries==5) pline(thats_enough_tries);
++		if (tries==5) plines(thats_enough_tries);
+ 	}
+ #endif /*WIZARD*/
+ 	if (mndx == NON_PM) mndx = rn1(SPECIAL_PM - LOW_PM, LOW_PM);
+diff --git a/src/mthrowu.c b/src/mthrowu.c
+index 3038ced..0ce7832 100644
+--- a/src/mthrowu.c
++++ b/src/mthrowu.c
+@@ -450,7 +450,7 @@ m_throw(mon, x, y, dx, dy, range, obj)
+ 	if (blindinc) {
+ 		u.ucreamed += blindinc;
+ 		make_blinded(Blinded + (long)blindinc, FALSE);
+-		if (!Blind) Your(vision_clears);
++		if (!Blind) Your("%s", vision_clears);
+ 	}
+ }
+ 
+diff --git a/src/muse.c b/src/muse.c
+index 86044e5..5628181 100644
+--- a/src/muse.c
++++ b/src/muse.c
+@@ -79,7 +79,7 @@ struct obj *obj;
+ 		    m_useup(mon, obj);
+ 		    mtmp = makemon(&mons[PM_GHOST], cc.x, cc.y, NO_MM_FLAGS);
+ 		    if (!mtmp) {
+-			if (vis) pline(empty);
++			if (vis) plines(empty);
+ 		    } else {
+ 			if (vis) {
+ 			    pline("As %s opens the bottle, an enormous %s emerges!",
+@@ -102,7 +102,7 @@ struct obj *obj;
+ 		m_useup(mon, obj);
+ 		mtmp = makemon(&mons[PM_DJINNI], cc.x, cc.y, NO_MM_FLAGS);
+ 		if (!mtmp) {
+-		    if (vis) pline(empty);
++		    if (vis) plines(empty);
+ 		} else {
+ 		    if (vis)
+ 			pline("In a cloud of smoke, %s emerges!",
+diff --git a/src/pline.c b/src/pline.c
+index 8210f8d..4f1149f 100644
+--- a/src/pline.c
++++ b/src/pline.c
+@@ -55,6 +55,12 @@ pline VA_DECL(const char *, line)
+ 	    Vsprintf(pbuf,line,VA_ARGS);
+ 	    line = pbuf;
+ 	}
++	plines(line);
++}
++
++void
++plines(const char *line) {
++	if (!line || !*line) return;
+ 	if (!iflags.window_inited) {
+ 	    raw_print(line);
+ 	    return;
+diff --git a/src/polyself.c b/src/polyself.c
+index b051acb..2f6552c 100644
+--- a/src/polyself.c
++++ b/src/polyself.c
+@@ -234,7 +234,7 @@ boolean forcecontrol;
+ 
+         if(!Polymorph_control && !forcecontrol && !draconian && !iswere && !isvamp) {
+ 	    if (rn2(20) > ACURR(A_CON)) {
+-		You(shudder_for_moment);
++		You("%s", shudder_for_moment);
+ 		losehp(rnd(30), "system shock", KILLED_BY_AN);
+ 		exercise(A_CON, FALSE);
+ 		return;
+@@ -256,7 +256,7 @@ boolean forcecontrol;
+ 				You("cannot polymorph into that.");
+ 			else break;
+ 		} while(++tries < 5);
+-		if (tries==5) pline(thats_enough_tries);
++		if (tries==5) plines(thats_enough_tries);
+ 		/* allow skin merging, even when polymorph is controlled */
+ 		if (draconian &&
+ 		    (mntmp == armor_to_dragon(uarm->otyp) || tries == 5))
+diff --git a/src/potion.c b/src/potion.c
+index 04abd41..d4baf04 100644
+--- a/src/potion.c
++++ b/src/potion.c
+@@ -932,7 +932,7 @@ register const char *txt;
+ 		You("have a %s feeling for a moment, then it passes.",
+ 		Hallucination ? "normal" : "strange");
+ 	else
+-		pline(txt);
++		plines(txt);
+ 
+ 	if(!obj)	/* e.g., crystal ball finds no traps */
+ 		return;
+@@ -1280,7 +1280,7 @@ register struct obj *obj;
+ 		    pline("It suddenly gets dark.");
+ 		}
+ 		make_blinded(itimeout_incr(Blinded, rnd(5)), FALSE);
+-		if (!Blind && !u.usleep) Your(vision_clears);
++		if (!Blind && !u.usleep) Your("%s", vision_clears);
+ 		break;
+ 	case POT_WATER:
+ 		if(u.umonnum == PM_GREMLIN) {
+@@ -1633,7 +1633,7 @@ dodip()
+ 		    obj == uball || obj == uskin ||
+ 		    obj_resists(obj->otyp == POT_POLYMORPH ?
+ 				potion : obj, 5, 95)) {
+-		pline(nothing_happens);
++		plines(nothing_happens);
+ 	    } else {
+ 	    	boolean was_wep = FALSE, was_swapwep = FALSE, was_quiver = FALSE;
+ 		short save_otyp = obj->otyp;
+diff --git a/src/pray.c b/src/pray.c
+index 3caa8c4..d34046e 100644
+--- a/src/pray.c
++++ b/src/pray.c
+@@ -1333,7 +1333,7 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!");
+     } /* fake Amulet */
+ 
+     if (value == 0) {
+-	pline(nothing_happens);
++	plines(nothing_happens);
+ 	return (1);
+     }
+ 
+diff --git a/src/priest.c b/src/priest.c
+index 5681930..effd0db 100644
+--- a/src/priest.c
++++ b/src/priest.c
+@@ -363,8 +363,8 @@ register int roomno;
+ 		    msg1 = buf;
+ 		}
+ 		if (can_speak) {
+-		    verbalize(msg1);
+-		    if (msg2) verbalize(msg2);
++		    verbalize("%s", msg1);
++		    if (msg2) verbalize("%s", msg2);
+ 		}
+ 		if(!sanctum) {
+ 		    /* !tended -> !shrined */
+@@ -433,7 +433,7 @@ register struct monst *priest;
+ 		priest->mcanmove = 1;
+ 	    }
+ 	    priest->mpeaceful = 0;
+-	    verbalize(cranky_msg[rn2(3)]);
++	    verbalize("%s", cranky_msg[rn2(3)]);
+ 	    return;
+ 	}
+ 
+diff --git a/src/questpgr.c b/src/questpgr.c
+index b4b80af..130169f 100644
+--- a/src/questpgr.c
++++ b/src/questpgr.c
+@@ -364,7 +364,7 @@ struct qtmsg *qt_msg;
+ 	for (size = 0; size < qt_msg->size; size += (long)strlen(in_line)) {
+ 	    (void) dlb_fgets(in_line, 80, msg_file);
+ 	    convert_line();
+-	    pline(out_line);
++	    plines(out_line);
+ 	}
+ 
+ }
+diff --git a/src/read.c b/src/read.c
+index ab530f0..743d13a 100644
+--- a/src/read.c
++++ b/src/read.c
+@@ -156,14 +156,14 @@ static void
+ stripspe(obj)
+ register struct obj *obj;
+ {
+-	if (obj->blessed) pline(nothing_happens);
++	if (obj->blessed) plines(nothing_happens);
+ 	else {
+ 		if (obj->spe > 0) {
+ 		    obj->spe = 0;
+ 		    if (obj->otyp == OIL_LAMP || obj->otyp == BRASS_LANTERN)
+ 			obj->age = 0;
+ 		    Your("%s %s briefly.",xname(obj), otense(obj, "vibrate"));
+-		} else pline(nothing_happens);
++		} else plines(nothing_happens);
+ 	}
+ }
+ 
+@@ -320,7 +320,7 @@ int curse_bless;
+ 		    if (obj->spe < 3)
+ 			Your("marker seems permanently dried out.");
+ 		    else
+-			pline(nothing_happens);
++			plines(nothing_happens);
+ 		} else if (is_blessed) {
+ 		    n = rn1(16,15);		/* 15..30 */
+ 		    if (obj->spe + n <= 50)
+@@ -378,7 +378,7 @@ int curse_bless;
+ 		    if (obj->spe < 5) {
+ 			obj->spe++;
+ 			p_glow1(obj);
+-		    } else pline(nothing_happens);
++		    } else plines(nothing_happens);
+ 		}
+ 		break;
+ 	    case HORN_OF_PLENTY:
+@@ -1284,7 +1284,7 @@ register struct obj	*sobj;
+ 		cc.x = u.ux;
+ 		cc.y = u.uy;
+ 		if (getpos(&cc, TRUE, "the desired position") < 0) {
+-		    pline(Never_mind);
++		    plines(Never_mind);
+ 		    return 0;
+ 		}
+ 		if (!cansee(cc.x, cc.y) || distu(cc.x, cc.y) >= 32) {
+@@ -1433,7 +1433,7 @@ do_class_genocide()
+ 
+ 	for(j=0; ; j++) {
+ 		if (j >= 5) {
+-			pline(thats_enough_tries);
++			plines(thats_enough_tries);
+ 			return;
+ 		}
+ 		do {
+@@ -1602,7 +1602,7 @@ int how;
+ 	} else {
+ 	    for(i = 0; ; i++) {
+ 		if(i >= 5) {
+-		    pline(thats_enough_tries);
++		    plines(thats_enough_tries);
+ 		    return;
+ 		}
+ 		getlin("What monster do you want to genocide? [type the name]",
+@@ -1725,7 +1725,7 @@ int how;
+ 	    if (cnt)
+ 		pline("Sent in some %s.", makeplural(buf));
+ 	    else
+-		pline(nothing_happens);
++		plines(nothing_happens);
+ 	}
+ }
+ 
+@@ -1845,7 +1845,7 @@ create_particular()
+ 	} while (++tries < 5);
+ 
+ 	if (tries == 5) {
+-	    pline(thats_enough_tries);
++	    plines(thats_enough_tries);
+ 	} else {
+ 	    (void) cant_create(&which, FALSE);
+ 	    whichpm = &mons[which];
+diff --git a/src/region.c b/src/region.c
+index e4d12af..ec598e1 100644
+--- a/src/region.c
++++ b/src/region.c
+@@ -445,7 +445,7 @@ xchar
+ 		!regions[i]->attach_2_u && !inside_region(regions[i], x, y)) {
+ 	    clear_hero_inside(regions[i]);
+ 	    if (regions[i]->leave_msg != NULL)
+-		pline(regions[i]->leave_msg);
++		plines(regions[i]->leave_msg);
+ 	    if ((f_indx = regions[i]->leave_f) != NO_CALLBACK)
+ 		(void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0);
+ 	}
+@@ -456,7 +456,7 @@ xchar
+ 		!regions[i]->attach_2_u && inside_region(regions[i], x, y)) {
+ 	    set_hero_inside(regions[i]);
+ 	    if (regions[i]->enter_msg != NULL)
+-		pline(regions[i]->enter_msg);
++		plines(regions[i]->enter_msg);
+ 	    if ((f_indx = regions[i]->enter_f) != NO_CALLBACK)
+ 		(void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0);
+ 	}
+diff --git a/src/restore.c b/src/restore.c
+index aaabbed..cb7b581 100644
+--- a/src/restore.c
++++ b/src/restore.c
+@@ -737,7 +737,7 @@ boolean ghostly;
+ 	    else
+ 		Sprintf(trickbuf, "This is level %d, not %d!", dlvl, lev);
+ #ifdef WIZARD
+-	    if (wizard) pline(trickbuf);
++	    if (wizard) plines(trickbuf);
+ #endif
+ 	    trickery(trickbuf);
+ 	}
+diff --git a/src/rumors.c b/src/rumors.c
+index 3272d1c..fb2065a 100644
+--- a/src/rumors.c
++++ b/src/rumors.c
+@@ -152,7 +152,7 @@ int mechanism;
+ 	    	return;
+ 	    else if (Blind) {
+ 		if (mechanism == BY_COOKIE)
+-			pline(fortune_msg);
++			plines(fortune_msg);
+ 		pline("What a pity that you cannot read it!");
+ 	    	return;
+ 	    }
+@@ -170,7 +170,7 @@ int mechanism;
+ 		exercise(A_WIS, TRUE);
+ 		return;
+ 	    case BY_COOKIE:
+-		pline(fortune_msg);
++		plines(fortune_msg);
+ 		/* FALLTHRU */
+ 	    case BY_PAPER:
+ 		pline("It reads:");
+diff --git a/src/shk.c b/src/shk.c
+index 53c868b..fc30c7b 100644
+--- a/src/shk.c
++++ b/src/shk.c
+@@ -516,7 +516,7 @@ register char *enterstring;
+ 	    if (!index(empty_shops, *enterstring) &&
+ 		in_rooms(u.ux, u.uy, SHOPBASE) !=
+ 				  in_rooms(u.ux0, u.uy0, SHOPBASE))
+-		pline(no_shk);
++		plines(no_shk);
+ 	    Strcpy(empty_shops, u.ushops);
+ 	    u.ushops[0] = '\0';
+ 	    return;
+@@ -528,7 +528,7 @@ register char *enterstring;
+ 	    /* dump core when referenced */
+ 	    eshkp->bill_p = (struct bill_x *) -1000;
+ 	    if (!index(empty_shops, *enterstring))
+-		pline(no_shk);
++		plines(no_shk);
+ 	    Strcpy(empty_shops, u.ushops);
+ 	    u.ushops[0] = '\0';
+ 	    return;
+@@ -1345,7 +1345,7 @@ proceed:
+ 		    else Strcat(sbuf,
+ 			   "for gold picked up and the use of merchandise.");
+ 		} else Strcat(sbuf, "for the use of merchandise.");
+-		pline(sbuf);
++		plines(sbuf);
+ #ifndef GOLDOBJ
+ 		if (u.ugold + eshkp->credit < dtmp) {
+ #else
+diff --git a/src/sounds.c b/src/sounds.c
+index ebd51aa..0740ab4 100644
+--- a/src/sounds.c
++++ b/src/sounds.c
+@@ -53,7 +53,7 @@ dosounds()
+ 		"the splashing of a naiad.",
+ 		"a soda fountain!",
+ 	};
+-	You_hear(fountain_msg[rn2(3)+hallu]);
++	You_hear("%s", fountain_msg[rn2(3)+hallu]);
+     }
+ #ifdef SINK
+     if (level.flags.nsinks && !rn2(300)) {
+@@ -62,7 +62,7 @@ dosounds()
+ 		"a gurgling noise.",
+ 		"dishes being washed!",
+ 	};
+-	You_hear(sink_msg[rn2(2)+hallu]);
++	You_hear("%s", sink_msg[rn2(2)+hallu]);
+     }
+ #endif
+     if (level.flags.has_court && !rn2(200)) {
+@@ -81,7 +81,7 @@ dosounds()
+ 		/* finding one is enough, at least for now */
+ 		int which = rn2(3)+hallu;
+ 
+-		if (which != 2) You_hear(throne_msg[which]);
++		if (which != 2) You_hear("%s", throne_msg[which]);
+ 		else		pline(throne_msg[2], uhis());
+ 		return;
+ 	    }
+@@ -93,7 +93,7 @@ dosounds()
+ 		"smell marsh gas!",	/* so it's a smell...*/
+ 		"hear Donald Duck!",
+ 	};
+-	You(swamp_msg[rn2(2)+hallu]);
++	You("%s", swamp_msg[rn2(2)+hallu]);
+ 	return;
+     }
+     if (level.flags.has_vault && !rn2(200)) {
+@@ -201,7 +201,7 @@ dosounds()
+ 		mon_in_room(mtmp, BARRACKS) &&
+ 		/* sleeping implies not-yet-disturbed (usually) */
+ 		(mtmp->msleeping || ++count > 5)) {
+-		You_hear(barracks_msg[rn2(3)+hallu]);
++		You_hear("%s", barracks_msg[rn2(3)+hallu]);
+ 		return;
+ 	    }
+ 	}
+@@ -216,7 +216,7 @@ dosounds()
+ 	    if (DEADMONSTER(mtmp)) continue;
+ 	    if ((mtmp->msleeping || is_animal(mtmp->data)) &&
+ 		    mon_in_room(mtmp, ZOO)) {
+-		You_hear(zoo_msg[rn2(2)+hallu]);
++		You_hear("%s", zoo_msg[rn2(2)+hallu]);
+ 		return;
+ 	    }
+ 	}
+@@ -234,7 +234,7 @@ dosounds()
+ 		    "the chime of a cash register.",
+ 		    "Neiman and Marcus arguing!",
+ 	    };
+-	    You_hear(shop_msg[rn2(2)+hallu]);
++	    You_hear("%s", shop_msg[rn2(2)+hallu]);
+ 	}
+ 	return;
+     }
+@@ -252,7 +252,7 @@ dosounds()
+ 		    "someone say \"No more woodchucks!\"",
+ 		    "a loud ZOT!"		/* both rec.humor.oracle */
+ 	    };
+-	    You_hear(ora_msg[rn2(3)+hallu*2]);
++	    You_hear("%s", ora_msg[rn2(3)+hallu*2]);
+ 	}
+ 	return;
+     }
+@@ -816,7 +816,7 @@ register struct monst *mtmp;
+     }
+ 
+     if (pline_msg) pline("%s %s", Monnam(mtmp), pline_msg);
+-    else if (verbl_msg) verbalize(verbl_msg);
++    else if (verbl_msg) verbalize("%s", verbl_msg);
+     return(1);
+ }
+ 
+diff --git a/src/spell.c b/src/spell.c
+index bd57569..afacac0 100644
+--- a/src/spell.c
++++ b/src/spell.c
+@@ -948,7 +948,7 @@ boolean atme;
+ 		break;
+ 	case SPE_JUMPING:
+ 		if (!jump(max(role_skill,1)))
+-			pline(nothing_happens);
++			plines(nothing_happens);
+ 		break;
+ 	default:
+ 		impossible("Unknown spell %d attempted.", spell);
+diff --git a/src/steed.c b/src/steed.c
+index 52e97dc..e9eeda2 100644
+--- a/src/steed.c
++++ b/src/steed.c
+@@ -58,7 +58,7 @@ use_saddle(otmp)
+ 
+ 	/* Select an animal */
+ 	if (u.uswallow || Underwater || !getdir((char *)0)) {
+-	    pline(Never_mind);
++	    plines(Never_mind);
+ 	    return 0;
+ 	}
+ 	if (!u.dx && !u.dy) {
+diff --git a/src/teleport.c b/src/teleport.c
+index c913e3c..e7c1e9f 100644
+--- a/src/teleport.c
++++ b/src/teleport.c
+@@ -552,7 +552,7 @@ dotele()
+ 		else tele();
+ 		(void) next_to_u();
+ 	} else {
+-		You(shudder_for_moment);
++		You("%s", shudder_for_moment);
+ 		return(0);
+ 	}
+ 	if (!trap) morehungry(100);
+@@ -663,7 +663,7 @@ level_tele()
+ 	     * we let negative values requests fall into the "heaven" loop.
+ 	     */
+ 	    if (Is_knox(&u.uz) && newlev > 0) {
+-		You(shudder_for_moment);
++		You("%s", shudder_for_moment);
+ 		return;
+ 	    }
+ 	    /* if in Quest, the player sees "Home 1", etc., on the status
+@@ -680,13 +680,13 @@ level_tele()
+  random_levtport:
+ 	    newlev = random_teleport_level();
+ 	    if (newlev == depth(&u.uz)) {
+-		You(shudder_for_moment);
++		You("%s", shudder_for_moment);
+ 		return;
+ 	    }
+ 	}
+ 
+ 	if (!next_to_u()) {
+-		You(shudder_for_moment);
++		You("%s", shudder_for_moment);
+ 		return;
+ 	}
+ #ifdef WIZARD
+@@ -812,7 +812,7 @@ register struct trap *ttmp;
+ 	struct d_level target_level;
+ 
+ 	if (!next_to_u()) {
+-		You(shudder_for_moment);
++		You("%s", shudder_for_moment);
+ 		return;
+ 	}
+ 
+@@ -846,7 +846,7 @@ struct trap *trap;
+ 			shieldeff(u.ux, u.uy);
+ 		You_feel("a wrenching sensation.");
+ 	} else if (!next_to_u()) {
+-		You(shudder_for_moment);
++		You("%s", shudder_for_moment);
+ 	} else if (trap->once) {
+ 		deltrap(trap);
+ 		newsym(u.ux,u.uy);	/* get rid of trap symbol */
+diff --git a/src/timeout.c b/src/timeout.c
+index 6a336d6..0ad7550 100644
+--- a/src/timeout.c
++++ b/src/timeout.c
+@@ -31,7 +31,7 @@ stoned_dialogue()
+ 	register long i = (Stoned & TIMEOUT);
+ 
+ 	if (i > 0L && i <= SIZE(stoned_texts))
+-		pline(stoned_texts[SIZE(stoned_texts) - i]);
++		plines(stoned_texts[SIZE(stoned_texts) - i]);
+ 	if (i == 5L)
+ 		HFast = 0L;
+ 	if (i == 3L)
+@@ -55,7 +55,7 @@ vomiting_dialogue()
+ 
+ 	if ((((Vomiting & TIMEOUT) % 3L) == 2) && (i >= 0)
+ 	    && (i < SIZE(vomiting_texts)))
+-		You(vomiting_texts[SIZE(vomiting_texts) - i - 1]);
++		You("%s", vomiting_texts[SIZE(vomiting_texts) - i - 1]);
+ 
+ 	switch ((int) i) {
+ 	case 0:
+@@ -102,7 +102,7 @@ choke_dialogue()
+ 		if (index(str, '%'))
+ 		    pline(str, hcolor(NH_BLUE));
+ 		else
+-		    pline(str);
++		    plines(str);
+ 	    }
+ 	}
+ 	exercise(A_STR, FALSE);
+@@ -132,7 +132,7 @@ slime_dialogue()
+ 		} else
+ 		    pline(str, an(Hallucination ? rndmonnam() : "green slime"));
+ 	    } else
+-		pline(str);
++		plines(str);
+ 	}
+ 	if (i == 3L) {	/* limbs becoming oozy */
+ 	    HFast = 0L;	/* lose intrinsic speed */
+diff --git a/src/trap.c b/src/trap.c
+index d336276..1724267 100644
+--- a/src/trap.c
++++ b/src/trap.c
+@@ -359,7 +359,7 @@ boolean td;	/* td == TRUE : trap door or hole */
+ 	    dont_fall = "are jerked back by your pet!";
+ 	}
+ 	if (dont_fall) {
+-	    You(dont_fall);
++	    You("%s", dont_fall);
+ 	    /* hero didn't fall through, but any objects here might */
+ 	    impact_drop((struct obj *)0, u.ux, u.uy, 0);
+ 	    if (!td) {
+@@ -2498,7 +2498,7 @@ domagictrap()
+ 	  if (!resists_blnd(&youmonst)) {
+ 		You("are momentarily blinded by a flash of light!");
+ 		make_blinded((long)rn1(5,10),FALSE);
+-		if (!Blind) Your(vision_clears);
++		if (!Blind) Your("%s", vision_clears);
+ 	  } else if (!Blind) {
+ 		You("see a flash of light!");
+ 	  }  else
+diff --git a/src/uhitm.c b/src/uhitm.c
+index 4a980d6..b418a43 100644
+--- a/src/uhitm.c
++++ b/src/uhitm.c
+@@ -858,7 +858,7 @@ int thrown;
+ 				mon->mblinded = 127;
+ 			    else mon->mblinded += tmp;
+ 			} else {
+-			    pline(obj->otyp==CREAM_PIE ? "Splat!" : "Splash!");
++			    plines(obj->otyp==CREAM_PIE ? "Splat!" : "Splash!");
+ 			    setmangry(mon);
+ 			}
+ 			if (thrown) obfree(obj, (struct obj *)0);
+diff --git a/src/zap.c b/src/zap.c
+index 991c429..0f23b62 100644
+--- a/src/zap.c
++++ b/src/zap.c
+@@ -1835,7 +1835,7 @@ dozap()
+ 	check_unpaid(obj);
+ 
+ 	/* zappable addition done by GAN 11/03/86 */
+-	if(!zappable(obj)) pline(nothing_happens);
++	if(!zappable(obj)) plines(nothing_happens);
+ 	else if(obj->cursed && !rn2(100)) {
+ 		backfire(obj);	/* the wand blows up in your face! */
+ 		exercise(A_STR, FALSE);
+@@ -1912,7 +1912,7 @@ boolean ordinary;
+ 		    if (!resists_blnd(&youmonst)) {
+ 			    You(are_blinded_by_the_flash);
+ 			    make_blinded((long)rnd(100),FALSE);
+-			    if (!Blind) Your(vision_clears);
++			    if (!Blind) Your("%s", vision_clears);
+ 		    }
+ 		    break;
+ 
+@@ -2050,7 +2050,7 @@ boolean ordinary;
+ 		case WAN_DEATH:
+ 		case SPE_FINGER_OF_DEATH:
+ 		    if (nonliving(youmonst.data) || is_demon(youmonst.data)) {
+-			pline((obj->otyp == WAN_DEATH) ?
++			plines((obj->otyp == WAN_DEATH) ?
+ 			  "The wand shoots an apparently harmless beam at you."
+ 			  : "You seem no deader than before.");
+ 			break;
+@@ -2093,7 +2093,7 @@ boolean ordinary;
+ 			You(are_blinded_by_the_flash);
+ 			make_blinded((long)damage, FALSE);
+ 			makeknown(obj->otyp);
+-			if (!Blind) Your(vision_clears);
++			if (!Blind) Your("%s", vision_clears);
+ 		    }
+ 		    damage = 0;	/* reset */
+ 		    break;
+@@ -2373,7 +2373,7 @@ struct obj *obj;	/* wand or spell */
+ 	case SPE_STONE_TO_FLESH:
+ 	    if (Is_airlevel(&u.uz) || Is_waterlevel(&u.uz) ||
+ 		     Underwater || (Is_qstart(&u.uz) && u.dz < 0)) {
+-		pline(nothing_happens);
++		plines(nothing_happens);
+ 	    } else if (u.dz < 0) {	/* we should do more... */
+ 		pline("Blood drips on your %s.", body_part(FACE));
+ 	    } else if (u.dz > 0 && !OBJ_AT(u.ux, u.uy)) {
+@@ -2384,7 +2384,7 @@ struct obj *obj;	/* wand or spell */
+ 		e = engr_at(u.ux, u.uy);
+ 		if (!(e && e->engr_type == ENGRAVE)) {
+ 		    if (is_pool(u.ux, u.uy) || is_ice(u.ux, u.uy))
+-			pline(nothing_happens);
++			plines(nothing_happens);
+ 		    else
+ 			pline("Blood %ss %s your %s.",
+ 			      is_lava(u.ux, u.uy) ? "boil" : "pool",
+@@ -3463,7 +3463,7 @@ register int dx,dy;
+ 	    if (abstype == ZT_LIGHTNING && !resists_blnd(&youmonst)) {
+ 		You(are_blinded_by_the_flash);
+ 		make_blinded((long)d(nd,50),FALSE);
+-		if (!Blind) Your(vision_clears);
++		if (!Blind) Your("%s", vision_clears);
+ 	    }
+ 	    stop_occupation();
+ 	    nomul(0);
+@@ -3597,7 +3597,7 @@ boolean *shopdamage;
+ 		    if (ttmp) ttmp->tseen = 1;
+ 		    if (cansee(x,y)) msgtxt = "The water evaporates.";
+ 		}
+-		Norep(msgtxt);
++		Norep("%s", msgtxt);
+ 		if (lev->typ == ROOM) newsym(x,y);
+ 	    } else if(IS_FOUNTAIN(lev->typ)) {
+ 		    if (cansee(x,y))
+@@ -3721,12 +3721,12 @@ boolean *shopdamage;
+ 		    lev->doormask = new_doormask;
+ 		    unblock_point(x, y);	/* vision */
+ 		    if (cansee(x, y)) {
+-			pline(see_txt);
++			plines(see_txt);
+ 			newsym(x, y);
+ 		    } else if (sense_txt) {
+-			You(sense_txt);
++			You("%s", sense_txt);
+ 		    } else if (hear_txt) {
+-			if (flags.soundok) You_hear(hear_txt);
++			if (flags.soundok) You_hear("%s", hear_txt);
+ 		    }
+ 		    if (picking_at(x, y)) {
+ 			stop_occupation();
+@@ -4111,7 +4111,7 @@ retry:
+ 	if (!otmp) {
+ 	    pline("Nothing fitting that description exists in the game.");
+ 	    if (++tries < 5) goto retry;
+-	    pline(thats_enough_tries);
++	    plines(thats_enough_tries);
+ 	    otmp = readobjnam((char *)0, (struct obj *)0, TRUE);
+ 	    if (!otmp) return;	/* for safety; should never happen */
+ 	} else if (otmp == &nothing) {
diff --git a/debian/patches/0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch b/debian/patches/0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch
new file mode 100644
index 0000000..58edce4
--- /dev/null
+++ b/debian/patches/0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch
@@ -0,0 +1,175 @@
+From f14dd4457436451d4447ed3cce26b55a75d3e183 Mon Sep 17 00:00:00 2001
+From: Joshua Kwan <joshk at triplehelix.org>
+Date: Thu, 24 Sep 2009 14:21:19 -0700
+Subject: Debian (and Linux) specifics defined in unixconf.h.
+
+---
+ include/unixconf.h |   15 +++++++++------
+ src/mail.c         |    5 +++--
+ util/makedefs.c    |   16 ++++++++--------
+ 3 files changed, 20 insertions(+), 16 deletions(-)
+
+--- a/include/unixconf.h
++++ b/include/unixconf.h
+@@ -19,8 +19,9 @@
+  */
+ 
+ /* define exactly one of the following four choices */
+-/* #define BSD 1 */	/* define for 4.n/Free/Open/Net BSD  */
+-			/* also for relatives like SunOS 4.x, DG/UX, and */
++#if defined(__FreeBSD_kernel__)
++#define BSD 1 	/* define for 4.n/Free/Open/Net BSD  */
++#endif			/* also for relatives like SunOS 4.x, DG/UX, and */
+ 			/* older versions of Linux */
+ /* #define ULTRIX */	/* define for Ultrix v3.0 or higher (but not lower) */
+ 			/* Use BSD for < v3.0 */
+@@ -32,12 +33,14 @@
+ 
+ 
+ /* define any of the following that are appropriate */
+-#define SVR4		/* use in addition to SYSV for System V Release 4 */
++/* #define SVR4	*/	/* use in addition to SYSV for System V Release 4 */
+ 			/* including Solaris 2+ */
+ #define NETWORK		/* if running on a networked system */
+ 			/* e.g. Suns sharing a playground through NFS */
+ /* #define SUNOS4 */	/* SunOS 4.x */
+-/* #define LINUX */	/* Another Unix clone */
++#ifdef __linux__
++#define LINUX	/* Another Unix clone */
++#endif
+ /* #define CYGWIN32 */	/* Unix on Win32 -- use with case sensitive defines */
+ /* #define GENIX */	/* Yet Another Unix Clone */
+ /* #define HISX */	/* Bull Unix for XPS Machines */
+@@ -102,7 +105,7 @@
+  * If you want the static parts of your playground on a read-only file
+  * system, define VAR_PLAYGROUND to be where the variable parts are kept.
+  */
+-/* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
++#define VAR_PLAYGROUND "/var/games/nethack"
+ 
+ 
+ /*
+@@ -132,7 +135,7 @@
+  * "extra output" method is used, but not all systems provide access to
+  * a fine-grained timer.
+  */
+-/* #define TIMED_DELAY */	/* usleep() */
++#define TIMED_DELAY	/* usleep() */
+ #endif
+ 
+ /*
+@@ -166,12 +169,12 @@
+ 
+ /* #define NO_MAILREADER */	/* have mail daemon just tell player of mail */
+ 
+-#ifdef	MAIL
++#ifdef MAIL
+ # if defined(BSD) || defined(ULTRIX)
+ #  ifdef AMS
+ #define AMS_MAILBOX	"/Mailbox"
+ #  else
+-#   if defined(__FreeBSD__) || defined(__OpenBSD__)
++#   if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
+ #define DEF_MAILREADER	"/usr/bin/mail"
+ #   else
+ #define DEF_MAILREADER	"/usr/ucb/Mail"
+@@ -189,7 +192,8 @@
+ #   endif
+ #  endif
+ # else
+-#define DEF_MAILREADER	"/bin/mail"
++/* Debian mail reader is /usr/bin/mail, not /bin/mail */
++#define DEF_MAILREADER	"/usr/bin/mail"
+ # endif
+ #endif
+ 
+--- a/src/mail.c
++++ b/src/mail.c
+@@ -72,10 +72,11 @@
+ # if !defined(MAILPATH) && defined(AMS)	/* Just a placeholder for AMS */
+ #  define MAILPATH "/dev/null"
+ # endif
+-# if !defined(MAILPATH) && (defined(LINUX) || defined(__osf__))
++# if !defined(MAILPATH) && defined(__osf__)
+ #  define MAILPATH "/var/spool/mail/"
+ # endif
+-# if !defined(MAILPATH) && defined(__FreeBSD__)
++/* Debian uses /var/mail, too. */
++# if !defined(MAILPATH) && (defined(__FreeBSD__) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__))
+ #  define MAILPATH "/var/mail/"
+ # endif
+ # if !defined(MAILPATH) && (defined(BSD) || defined(ULTRIX))
+--- a/util/makedefs.c
++++ b/util/makedefs.c
+@@ -358,7 +358,7 @@
+ 		perror(filename);
+ 		exit(EXIT_FAILURE);
+ 	}
+-	Fprintf(ofp,Dont_Edit_Data);
++	Fprintf(ofp, "%s", Dont_Edit_Data);
+ 
+ 	Sprintf(infile, DATA_IN_TEMPLATE, RUMOR_FILE);
+ 	Strcat(infile, ".tru");
+@@ -557,7 +557,7 @@
+ 		exit(EXIT_FAILURE);
+ 	}
+ 	Fprintf(ofp,"/*\tSCCS Id: @(#)date.h\t3.4\t2002/02/03 */\n\n");
+-	Fprintf(ofp,Dont_Edit_Code);
++	Fprintf(ofp, "%s", Dont_Edit_Code);
+ 
+ #ifdef KR1ED
+ 	(void) time(&clocktim);
+@@ -1236,7 +1236,7 @@
+ 		perror(filename);
+ 		exit(EXIT_FAILURE);
+ 	}
+-	Fprintf(ofp,Dont_Edit_Data);
++	Fprintf(ofp, "%s", Dont_Edit_Data);
+ 
+ 	while (fgets(in_line, sizeof in_line, ifp) != 0) {
+ 	    SpinCursor(3);
+@@ -1358,7 +1358,7 @@
+ 	perror(filename);
+ 	exit(EXIT_FAILURE);
+     }
+-    Fprintf(ofp,Dont_Edit_Code);
++    Fprintf(ofp,"%s", Dont_Edit_Code);
+     Fprintf(ofp,"#include \"config.h\"\n");
+     Fprintf(ofp,"\nconst int monstr[] = {\n");
+     for (ptr = &mons[0], j = 0; ptr->mlet; ptr++) {
+@@ -1399,7 +1399,7 @@
+ 		exit(EXIT_FAILURE);
+ 	}
+ 	Fprintf(ofp,"/*\tSCCS Id: @(#)pm.h\t3.4\t2002/02/03 */\n\n");
+-	Fprintf(ofp,Dont_Edit_Code);
++	Fprintf(ofp,"%s", Dont_Edit_Code);
+ 	Fprintf(ofp,"#ifndef PM_H\n#define PM_H\n");
+ 
+ 	if (strcmp(mons[0].mname, "playermon") != 0)
+@@ -1715,7 +1715,7 @@
+ 		exit(EXIT_FAILURE);
+ 	}
+ 	Fprintf(ofp,"/*\tSCCS Id: @(#)onames.h\t3.4\t2002/02/03 */\n\n");
+-	Fprintf(ofp,Dont_Edit_Code);
++	Fprintf(ofp,"%s", Dont_Edit_Code);
+ 	Fprintf(ofp,"#ifndef ONAMES_H\n#define ONAMES_H\n\n");
+ 
+ 	for(i = 0; !i || objects[i].oc_class != ILLOBJ_CLASS; i++) {
+@@ -1870,7 +1870,7 @@
+ 	perror(filename);
+ 	exit(EXIT_FAILURE);
+     }
+-    Fprintf(ofp,Dont_Edit_Code);
++    Fprintf(ofp,"%s", Dont_Edit_Code);
+     Fprintf(ofp,"#ifdef VISION_TABLES\n");
+ #ifdef VISION_TABLES
+     H_close_gen();
+@@ -1895,7 +1895,7 @@
+ 	Unlink(filename);
+ 	exit(EXIT_FAILURE);
+     }
+-    Fprintf(ofp,Dont_Edit_Code);
++    Fprintf(ofp,"%s", Dont_Edit_Code);
+     Fprintf(ofp,"#include \"config.h\"\n");
+     Fprintf(ofp,"#ifdef VISION_TABLES\n");
+     Fprintf(ofp,"#include \"vis_tab.h\"\n");
diff --git a/debian/patches/0018-lisp-support-in-src-Makefile.patch b/debian/patches/0018-lisp-support-in-src-Makefile.patch
new file mode 100644
index 0000000..10405cd
--- /dev/null
+++ b/debian/patches/0018-lisp-support-in-src-Makefile.patch
@@ -0,0 +1,54 @@
+From a933713c8f8a28aa2f8b917bb80c43d15eb1ac96 Mon Sep 17 00:00:00 2001
+From: "Bernhard R. Link" <brlink at debian.org>
+Date: Sun, 10 Jun 2012 16:37:19 +0200
+Subject: lisp support in src/Makefile
+
+some left over parts of some older patches
+belonging to the lisp part.
+---
+ sys/unix/Makefile.src |   11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src
+index 29ad99a..0b75660 100644
+--- a/sys/unix/Makefile.src
++++ b/sys/unix/Makefile.src
+@@ -216,6 +216,9 @@ WINBEOBJ =
+ #
+ WINSRC = $(WINTTYSRC)
+ WINOBJ = $(WINTTYOBJ)
++# Files for the lisp port
++WINLISPSRC = ../win/lisp/winlisp.c tile.c
++WINLISPOBJ = winlisp.o tile.o
+ 
+ # on some systems the termcap library is in -ltermcap or -lcurses
+ # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
+@@ -338,7 +341,7 @@ SYSCSRC = ../sys/atari/tos.c ../sys/share/pcmain.c ../sys/share/pcsys.c \
+ GENCSRC = monstr.c vis_tab.c	#tile.c
+ 
+ # all windowing-system-dependent .c (for dependencies and such)
+-WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
++WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC) $(WINLISPSRC)
+ # all windowing-system-dependent .cpp (for dependencies and such)
+ WINCXXSRC = $(WINQTSRC) $(WINBESRC)
+ 
+@@ -683,6 +686,9 @@ load_img.o: ../win/gem/load_img.c ../include/load_img.h
+ 	$(CC) $(CFLAGS) -c ../win/gem/load_img.c
+ gr_rect.o: ../win/gem/gr_rect.c ../include/gr_rect.h
+ 	$(CC) $(CFLAGS) -c ../win/gem/gr_rect.c
++winlisp.o: ../win/lisp/winlisp.c $(HACK_H) ../include/winlisp.h \
++		../include/func_tab.h ../include/dlb.h ../include/patchlevel.h
++	$(CC) $(CFLAGS) -c ../win/lisp/winlisp.c
+ tile.o: tile.c $(HACK_H)
+ qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../include/func_tab.h \
+ 		../include/dlb.h ../include/patchlevel.h ../include/tile2x11.h \
+@@ -803,7 +809,8 @@ vision.o: vision.c $(HACK_H) ../include/vis_tab.h
+ weapon.o: weapon.c $(HACK_H)
+ were.o: were.c $(HACK_H)
+ wield.o: wield.c $(HACK_H)
+-windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h
++windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h \
++		../include/winlisp.h
+ wizard.o: wizard.c $(HACK_H) ../include/qtext.h ../include/epri.h
+ worm.o: worm.c $(HACK_H) ../include/lev.h
+ worn.o: worn.c $(HACK_H)
diff --git a/debian/patches/0019-stay-in-array-bounds.patch b/debian/patches/0019-stay-in-array-bounds.patch
new file mode 100644
index 0000000..df46b38
--- /dev/null
+++ b/debian/patches/0019-stay-in-array-bounds.patch
@@ -0,0 +1,25 @@
+From e5fe232d25d77490d2a830cdee89e3d73ac8ba83 Mon Sep 17 00:00:00 2001
+From: "Bernhard R. Link" <brlink at debian.org>
+Date: Sun, 10 Jun 2012 17:41:55 +0200
+Subject: stay in array bounds
+
+Fix code reading a element after an array. As that is undefined
+behaviour it gets a warning and might lead to later hard to detect
+misoptimisations by the compiler.
+---
+ src/mhitu.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/mhitu.c b/src/mhitu.c
+index 7df5b5e..6b10f33 100644
+--- a/src/mhitu.c
++++ b/src/mhitu.c
+@@ -233,7 +233,7 @@ boolean message;
+ 			for(i = 0; i < NATTK; i++)
+ 				if(mdat->mattk[i].aatyp == AT_ENGL)
+ 					break;
+-			if (mdat->mattk[i].aatyp != AT_ENGL)
++			if (i >= NATTK || mdat->mattk[i].aatyp != AT_ENGL)
+ 			      impossible("Swallower has no engulfing attack?");
+ 			else {
+ 				if (is_whirly(mdat)) {
diff --git a/debian/patches/0020-fix-64-bit-issues-in-lisp-code.patch b/debian/patches/0020-fix-64-bit-issues-in-lisp-code.patch
new file mode 100644
index 0000000..b97dc48
--- /dev/null
+++ b/debian/patches/0020-fix-64-bit-issues-in-lisp-code.patch
@@ -0,0 +1,45 @@
+From fd9b0e0a5bcd0fa29507ab645719225eb7780c21 Mon Sep 17 00:00:00 2001
+From: "Bernhard R. Link" <brlink at debian.org>
+Date: Sun, 10 Jun 2012 18:15:17 +0200
+Subject: fix 64 bit issues in lisp code
+
+some arguments are longs where ints are expected,
+so explicitly cast them.
+---
+ win/lisp/winlisp.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/win/lisp/winlisp.c b/win/lisp/winlisp.c
+index 290a457..15f685c 100644
+--- a/win/lisp/winlisp.c
++++ b/win/lisp/winlisp.c
+@@ -1004,7 +1004,7 @@ generate_status_line ()
+ 		 lisp_int (depth(&u.uz)););
+ 
+   lisp_list (lisp_string ("$");
+-	     lisp_int (u.ugold););
++	     lisp_int ((int)u.ugold););
+   lisp_list (lisp_string ("HP");
+ 	     lisp_int (hp););
+   lisp_list (lisp_string ("HPmax");
+@@ -1031,10 +1031,10 @@ generate_status_line ()
+ 	     lisp_int (u.ulevel););
+ #ifdef EXP_ON_BOTL
+   lisp_list (lisp_string ("XP");
+-	     lisp_int (u.uexp););
++	     lisp_int ((int)u.uexp););
+ #endif
+   lisp_list (lisp_string ("T");
+-	     lisp_int (moves););
++	     lisp_int ((int)moves););
+ 
+   if (Confusion)
+     lisp_list (lisp_string ("confusion"); lisp_string ("Conf"));
+@@ -1932,6 +1932,6 @@ lisp_outrip(window, how)
+   lisp_cmd ("outrip",
+ 	    lisp_int (window);	    
+ 	    lisp_string (plname);
+-	    lisp_int (u.ugold);
++	    lisp_int ((int)u.ugold);
+ 	    lisp_string ("Died while trying to finish nethack-el."));
+ }
diff --git a/debian/patches/0021-fix-kfreebsd-ftbfs.patch b/debian/patches/0021-fix-kfreebsd-ftbfs.patch
new file mode 100644
index 0000000..73cca07
--- /dev/null
+++ b/debian/patches/0021-fix-kfreebsd-ftbfs.patch
@@ -0,0 +1,49 @@
+Description: Fix FTBFS on kfreebsd
+ "#define BSD 1" also has to be un-commented in include/unixconf.h in order
+ for nethack to be built successfully on kfreebsd (see
+ 0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch). Also, if
+ 0011-Pasi-Kallinen-s-patch-to-add-colors-to-inventory-ite.patch (i.e. the
+ menucolors patch) is applied, defining MENU_COLOR_REGEX causes a FTBFS on
+ kfreebsd (not sure why), so define it only on Linux for now.
+Author: Vincent Cheng <Vincentc1208 at gmail.com>
+Last-Update: 2012-06-11
+
+--- a/src/hacklib.c
++++ b/src/hacklib.c
+@@ -3,6 +3,10 @@
+ /* Copyright (c) Robert Patrick Rankin, 1991		  */
+ /* NetHack may be freely redistributed.  See license for details. */
+ 
++#if defined(__FreeBSD_kernel__)
++#include <time.h>
++#endif
++
+ /* We could include only config.h, except for the overlay definitions... */
+ #include "hack.h"
+ /*=
+--- a/util/makedefs.c
++++ b/util/makedefs.c
+@@ -4,6 +4,10 @@
+ /* Copyright (c) Dean Luick, 1990.				  */
+ /* NetHack may be freely redistributed.  See license for details. */
+ 
++#if defined(__FreeBSD_kernel__)
++#include <time.h>
++#endif
++
+ #define MAKEDEFS_C	/* use to conditionally include file sections */
+ /* #define DEBUG */	/* uncomment for debugging info */
+ 
+--- a/win/tty/termcap.c
++++ b/win/tty/termcap.c
+@@ -835,10 +835,6 @@
+ 
+ #include <curses.h>
+ 
+-#ifndef LINUX
+-extern char *tparm();
+-#endif
+-
+ #  ifdef COLOR_BLACK	/* trust include file */
+ #undef COLOR_BLACK
+ #  else
diff --git a/debian/patches/00list b/debian/patches/00list
deleted file mode 100644
index f07d3ce..0000000
--- a/debian/patches/00list
+++ /dev/null
@@ -1,25 +0,0 @@
-01_fix_qt
-02_SECURITY_recover_secure
-04_manpage_paths
-05_makefile_logic
-06_x11_data
-08_linux_specifics
-09_use_gnu_source
-10_gnome_add_quiver
-12_lisp_windowing
-13_simple_mail
-14_common_config
-15_recover_errormsg
-16_pixmapdir
-17_gnome_remove_drop_many
-18_overridewin
-19_gnome_ext_events
-20_gcc4_fix
-21_gnome_umask
-90_enh_hpmon
-91_enh_menucolors
-92_enh_paranoid_hit
-93_enh_dump
-94_enh_sortloot
-95_enh_engulf_prayers
-96_binutils-gold
diff --git a/debian/patches/01_fix_qt.dpatch b/debian/patches/01_fix_qt.dpatch
deleted file mode 100644
index faf1ecf..0000000
--- a/debian/patches/01_fix_qt.dpatch
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh -e
-## 01_qt_fixes.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Various accumulated Qt fixes.
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
---- nethack-3.4.1.orig/win/Qt/qt_win.cpp
-+++ nethack-3.4.1/win/Qt/qt_win.cpp
-@@ -58,6 +58,7 @@
- #include "patchlevel.h"
- #include "tile2x11.h"
- #undef Warning
-+#undef Invisible
- #undef red
- #undef green
- #undef blue
---- nethack-3.4.1.orig/include/qt_win.h
-+++ nethack-3.4.1/include/qt_win.h
-@@ -34,7 +34,7 @@
- #include <qmessagebox.h>
- #include <qpixmap.h>
- #include <qimage.h>
--#include <qarray.h>
-+#include <qmemarray.h>
- #include <qcombobox.h>
- #include <qscrollview.h>
- #if QT_VERSION >= 300
diff --git a/debian/patches/05_makefile_logic.dpatch b/debian/patches/05_makefile_logic.dpatch
deleted file mode 100644
index 297434e..0000000
--- a/debian/patches/05_makefile_logic.dpatch
+++ /dev/null
@@ -1,165 +0,0 @@
-#! /bin/sh -e
-## 05_makefile_logic.dpatch by Aaron Lehmann <aaronl at vitelus.com>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Move some of the logical burden to make
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
---- nethack-3.4.3/sys/unix/Makefile.src~	2003-12-22 01:54:52.000000000 -0800
-+++ nethack-3.4.3/sys/unix/Makefile.src	2003-12-22 01:55:01.000000000 -0800
-@@ -125,7 +125,7 @@
- # flags for Linux
- #   compile normally
- # CFLAGS = -O2 -fomit-frame-pointer -I../include
--# LFLAGS = -L/usr/X11R6/lib
-+LFLAGS = -L/usr/X11R6/lib
- #   OR compile backwards compatible a.out format
- # CFLAGS = -O2 -b i486-linuxaout -fomit-frame-pointer -I../include
- # LFLAGS = -b i486-linuxaout -L/usr/X11R6/lib
-@@ -146,18 +146,16 @@
- # directories.  The ones given below is the usual spot for linux systems.
- # The paths are for glibconfig.h and gnomesupport.h respectively.
- #
--GNOMEINC=-I/usr/lib/glib/include -I/usr/lib/gnome-libs/include -I../win/gnome
-+GNOMEINC=$(shell gnome-config --cflags gnomeui)
- 
- # flags for debugging:
- # CFLAGS = -g -I../include
- 
--CFLAGS = -O -I../include
--LFLAGS = 
--
- # The Qt and Be window systems are written in C++, while the rest of
- # NetHack is standard C.  If using Qt, uncomment the LINK line here to get
- # the C++ libraries linked in.
--CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include
-+QTDIR = /usr
-+CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include/qt3
- CXX=g++
- #LINK=g++
- #	For cross-compiling, eg. with gcc on Linux (see also CC further up):
-@@ -212,10 +210,41 @@
- #	../win/BeOS/NHMenuWindow.cpp ../win/BeOS/NHMapWindow.cpp tile.c
- #WINBEOBJ = winbe.o NHWindow.o NHMenuWindow.o NHMapWindow.o tile.o
- 
-+# Files for the lisp port
-+WINLISPSRC = ../win/lisp/winlisp.c tile.c
-+WINLISPOBJ = winlisp.o tile.o
-+
- #
- #
--WINSRC = $(WINTTYSRC)
--WINOBJ = $(WINTTYOBJ)
-+ifeq ($(WIN),console)
-+	WINSRC = $(WINTTYSRC)
-+	WINOBJ = $(WINTTYOBJ)
-+	WINLIB = $(WINTTYLIB)
-+endif
-+ifeq ($(WIN),x11)
-+	WINSRC = $(WINTTYSRC) $(WINX11SRC)
-+	WINOBJ = $(WINTTYOBJ) $(WINX11OBJ)
-+	WINLIB = $(WINTTYLIB) $(WINX11LIB)
-+	CFLAGS += -I/usr/X11R6/include -DX11_GRAPHICS
-+endif
-+ifeq ($(WIN),gnome)
-+	WINSRC = $(WINTTYSRC) $(WINGNOMESRC)
-+	WINOBJ = $(WINTTYOBJ) $(WINGNOMEOBJ)
-+	WINLIB = $(WINTTYLIB) $(WINGNOMELIB)
-+	CFLAGS += -DGNOME_GRAPHICS
-+endif
-+ifeq ($(WIN),qt)
-+	WINSRC = $(WINTTYSRC) $(WINQTSRC)
-+	WINOBJ = $(WINTTYOBJ) $(WINQTOBJ)
-+	WINLIB = $(WINTTYLIB) $(WINQTLIB)
-+	CFLAGS += -DQT_GRAPHICS
-+endif
-+ifeq ($(WIN),lisp)
-+	WINSRC = $(WINLISPSRC)
-+	WINOBJ = $(WINLISPOBJ)
-+	WINLIB = $(WINLISPLIB)
-+	CFLAGS += -DLISP_GRAPHICS -DDEFAULT_WINDOW_SYS=\"lisp\"
-+endif
- 
- # on some systems the termcap library is in -ltermcap or -lcurses
- # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
-@@ -230,24 +259,24 @@
- # WINTTYLIB = -ltermcap
- # WINTTYLIB = -lcurses
- # WINTTYLIB = -lcurses16
--# WINTTYLIB = -lncurses
--WINTTYLIB = -ltermlib
-+WINTTYLIB = -lncurses
-+# WINTTYLIB = -ltermlib
- #
- # libraries for X11
- # If USE_XPM is defined in config.h, you will also need -lXpm here.
--WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
-+WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
- # WINX11LIB = -lXaw -lXmu -lXt -lX11
- # WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
- # WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0
- #
- # libraries for Qt
--WINQTLIB = -L$(QTDIR)/lib -lqt
-+WINQTLIB = -L$(QTDIR)/lib -lqt-mt
- #
- # libraries for KDE (with Qt)
- WINKDELIB = -lkdecore -lkdeui -lXext
- #
- # libraries for Gnome
--WINGNOMELIB = -lgnomeui -lgnome -lart_lgpl -lgtk -lgdk -lpopt
-+WINGNOMELIB = $(shell gnome-config --libs gnomeui)
- #
- # libraries for Gem port
- WINGEMLIB = -le_gem -lgem
-@@ -255,8 +284,6 @@
- # libraries for BeOS 
- WINBELIB = -lbe
- 
--WINLIB = $(WINTTYLIB)
--
- # any other strange libraries your system needs (for Sysunix only -- the more
- # specialized targets should already be right)
- #
-@@ -338,7 +365,7 @@
- GENCSRC = monstr.c vis_tab.c	#tile.c
- 
- # all windowing-system-dependent .c (for dependencies and such)
--WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC)
-+WINCSRC = $(WINTTYSRC) $(WINX11SRC) $(WINGNOMESRC) $(WINGEMSRC) $(WINLISPSRC)
- # all windowing-system-dependent .cpp (for dependencies and such)
- WINCXXSRC = $(WINQTSRC) $(WINBESRC)
- 
-@@ -683,6 +710,9 @@
- 	$(CC) $(CFLAGS) -c ../win/gem/load_img.c
- gr_rect.o: ../win/gem/gr_rect.c ../include/gr_rect.h
- 	$(CC) $(CFLAGS) -c ../win/gem/gr_rect.c
-+winlisp.o: ../win/lisp/winlisp.c $(HACK_H) ../include/winlisp.h \
-+		../include/func_tab.h ../include/dlb.h ../include/patchlevel.h
-+	$(CC) $(CFLAGS) -c ../win/lisp/winlisp.c
- tile.o: tile.c $(HACK_H)
- qt_win.o: ../win/Qt/qt_win.cpp $(HACK_H) ../include/func_tab.h \
- 		../include/dlb.h ../include/patchlevel.h ../include/tile2x11.h \
-@@ -803,7 +833,8 @@
- weapon.o: weapon.c $(HACK_H)
- were.o: were.c $(HACK_H)
- wield.o: wield.c $(HACK_H)
--windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h
-+windows.o: windows.c $(HACK_H) ../include/wingem.h ../include/winGnome.h \
-+		../include/winlisp.h
- wizard.o: wizard.c $(HACK_H) ../include/qtext.h ../include/epri.h
- worm.o: worm.c $(HACK_H) ../include/lev.h
- worn.o: worn.c $(HACK_H)
diff --git a/debian/patches/06_x11_data.dpatch b/debian/patches/06_x11_data.dpatch
deleted file mode 100644
index bba1f9e..0000000
--- a/debian/patches/06_x11_data.dpatch
+++ /dev/null
@@ -1,40 +0,0 @@
-#! /bin/sh -e
-## 06_x11_data.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Add optional tiles to the X11 build.
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
---- a/sys/unix/Makefile.top~	2003-10-06 22:00:18.000000000 -0700
-+++ b/sys/unix/Makefile.top	2003-10-06 22:00:55.000000000 -0700
-@@ -40,7 +40,7 @@
- SHELLDIR = $(PREFIX)/games
- 
- # per discussion in Install.X11 and Install.Qt
--VARDATND = 
-+# VARDATND = 
- # VARDATND = x11tiles NetHack.ad pet_mark.xbm
- # VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm
- # for Atari/Gem
-@@ -48,7 +48,7 @@
- # for BeOS
- # VARDATND = beostiles
- # for Gnome
--# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm
-+VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm
- 
- VARDATD = data oracles options quest.dat rumors
- VARDAT = $(VARDATD) $(VARDATND)
diff --git a/debian/patches/08_linux_specifics.dpatch b/debian/patches/08_linux_specifics.dpatch
deleted file mode 100644
index 8f27c63..0000000
--- a/debian/patches/08_linux_specifics.dpatch
+++ /dev/null
@@ -1,94 +0,0 @@
-#! /bin/sh -e
-## 08_linux_specifics.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Debian (and Linux) specifics defined in unixconf.h.
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
-diff -ur nethack-3.4.3.old/include/unixconf.h nethack-3.4.3/include/unixconf.h
---- nethack-3.4.3.old/include/unixconf.h	2003-12-08 00:39:13.000000000 +0100
-+++ nethack-3.4.3/include/unixconf.h	2005-01-13 17:15:28.000000000 +0100
-@@ -32,12 +32,14 @@
- 
- 
- /* define any of the following that are appropriate */
--#define SVR4		/* use in addition to SYSV for System V Release 4 */
-+/* #define SVR4	*/	/* use in addition to SYSV for System V Release 4 */
- 			/* including Solaris 2+ */
- #define NETWORK		/* if running on a networked system */
- 			/* e.g. Suns sharing a playground through NFS */
- /* #define SUNOS4 */	/* SunOS 4.x */
--/* #define LINUX */	/* Another Unix clone */
-+#ifdef __linux__
-+#define LINUX	/* Another Unix clone */
-+#endif
- /* #define CYGWIN32 */	/* Unix on Win32 -- use with case sensitive defines */
- /* #define GENIX */	/* Yet Another Unix Clone */
- /* #define HISX */	/* Bull Unix for XPS Machines */
-@@ -102,7 +104,7 @@
-  * If you want the static parts of your playground on a read-only file
-  * system, define VAR_PLAYGROUND to be where the variable parts are kept.
-  */
--/* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
-+#define VAR_PLAYGROUND "/var/games/nethack"
- 
- 
- /*
-@@ -132,7 +134,7 @@
-  * "extra output" method is used, but not all systems provide access to
-  * a fine-grained timer.
-  */
--/* #define TIMED_DELAY */	/* usleep() */
-+#define TIMED_DELAY	/* usleep() */
- #endif
- 
- /*
-@@ -166,7 +168,7 @@
- 
- /* #define NO_MAILREADER */	/* have mail daemon just tell player of mail */
- 
--#ifdef	MAIL
-+#ifdef MAIL
- # if defined(BSD) || defined(ULTRIX)
- #  ifdef AMS
- #define AMS_MAILBOX	"/Mailbox"
-@@ -189,7 +191,8 @@
- #   endif
- #  endif
- # else
--#define DEF_MAILREADER	"/bin/mail"
-+/* Debian mail reader is /usr/bin/mail, not /bin/mail */
-+#define DEF_MAILREADER	"/usr/bin/mail"
- # endif
- #endif
- 
-diff -ur nethack-3.4.3.old/src/mail.c nethack-3.4.3/src/mail.c
---- nethack-3.4.3.old/src/mail.c	2003-12-08 00:39:13.000000000 +0100
-+++ nethack-3.4.3/src/mail.c	2005-01-13 17:14:01.000000000 +0100
-@@ -68,10 +68,11 @@
- # if !defined(MAILPATH) && defined(AMS)	/* Just a placeholder for AMS */
- #  define MAILPATH "/dev/null"
- # endif
--# if !defined(MAILPATH) && (defined(LINUX) || defined(__osf__))
-+# if !defined(MAILPATH) && defined(__osf__)
- #  define MAILPATH "/var/spool/mail/"
- # endif
--# if !defined(MAILPATH) && defined(__FreeBSD__)
-+/* Debian uses /var/mail, too. */
-+# if !defined(MAILPATH) && (defined(__FreeBSD__) || defined(LINUX) || defined(__GNU__) || defined(__GLIBC__))
- #  define MAILPATH "/var/mail/"
- # endif
- # if !defined(MAILPATH) && (defined(BSD) || defined(ULTRIX))
diff --git a/debian/patches/09_use_gnu_source.dpatch b/debian/patches/09_use_gnu_source.dpatch
deleted file mode 100644
index 3b4bda1..0000000
--- a/debian/patches/09_use_gnu_source.dpatch
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /bin/sh -e
-## 09_use_gnu_source.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Define _GNU_SOURCE for RTLD_NEXT.
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
---- a/sys/unix/unixres.c~	2003-10-06 22:02:16.000000000 -0700
-+++ b/sys/unix/unixres.c	2003-10-06 22:02:33.000000000 -0700
-@@ -21,6 +21,7 @@
- # if defined(LINUX)
- 
- /* requires dynamic linking with libc */
-+#define _GNU_SOURCE
- #include <dlfcn.h>
- 
- static int
diff --git a/debian/patches/10_gnome_add_quiver.dpatch b/debian/patches/10_gnome_add_quiver.dpatch
deleted file mode 100644
index 95d55b8..0000000
--- a/debian/patches/10_gnome_add_quiver.dpatch
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh -e
-## 10_gnome_add_quiver.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Add a 'Quiver/Ready' option to the GNOME UI menu.
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
---- a/win/gnome/gnmain.c~	2003-10-06 23:39:19.000000000 -0700
-+++ b/win/gnome/gnmain.c	2003-10-06 23:38:39.000000000 -0700
-@@ -361,6 +361,12 @@
- 	       ghack_accelerator_selected, 
- 	       GINT_TO_POINTER('t'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 't',0
- 	   },
-+           {
-+               GNOME_APP_UI_ITEM, N_("Quiver/Ready"),
-+               N_("ready or quiver some ammunition"),
-+               ghack_accelerator_selected,
-+               GINT_TO_POINTER('Q'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'Q',0
-+           },
- 	   { 
- 	       GNOME_APP_UI_ITEM, N_("Open Door"), 
- 	       N_("open a door"),
diff --git a/debian/patches/12_lisp_windowing.copyright b/debian/patches/12_lisp_windowing.copyright
deleted file mode 100644
index 2f7da63..0000000
--- a/debian/patches/12_lisp_windowing.copyright
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Redistribution and use in source and binary forms, with or without modification, are permitted
-provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice, this list of conditions
-    and the following disclaimer.
- 2. 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.
- 3. The name of the author may not be used to endorse or promote products derived from this
-    software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
diff --git a/debian/patches/16_pixmapdir.dpatch b/debian/patches/16_pixmapdir.dpatch
deleted file mode 100644
index ac0235c..0000000
--- a/debian/patches/16_pixmapdir.dpatch
+++ /dev/null
@@ -1,106 +0,0 @@
-#! /bin/sh -e
-## 16_pixmapdir.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Use /usr/share/pixmaps/nethack/ for pretty pictures.
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
---- nethack/win/Qt/qt_win.cpp~	2003-10-22 21:25:09.000000000 -0700
-+++ nethack/win/Qt/qt_win.cpp	2003-10-22 21:29:31.000000000 -0700
-@@ -3177,7 +3177,7 @@
- {
-     if (!pixmap) {
- 	pixmap=new QPixmap;
--	tryload(*pixmap, "rip.xpm");
-+	tryload(*pixmap, PIXMAPDIR "rip.xpm");
-     }
-     riplines=0;
-     resize(pixmap->width(),pixmap->height());
-@@ -4286,7 +4286,7 @@
- 	tile_file = iflags.wc_tile_file;
- 
-     if (!img.load(tile_file)) {
--	tile_file = "x11tiles";
-+	tile_file = PIXMAPDIR "x11tiles";
- 	if (!img.load(tile_file)) {
- 	    QString msg;
- 	    msg.sprintf("Cannot load x11tiles or nhtiles.bmp");
---- nethack/win/X11/winX.c~	2003-10-22 21:15:53.000000000 -0700
-+++ nethack/win/X11/winX.c	2003-10-22 21:16:08.000000000 -0700
-@@ -919,12 +919,12 @@
-     { "message_lines", "Message_lines", XtRInt, sizeof(int),
-       XtOffset(AppResources *,message_lines), XtRString, "12" },
-     { "pet_mark_bitmap", "Pet_mark_bitmap", XtRString, sizeof(String),
--      XtOffset(AppResources *,pet_mark_bitmap), XtRString, "pet_mark.xbm" },
-+      XtOffset(AppResources *,pet_mark_bitmap), XtRString, PIXMAPDIR "pet_mark.xbm" },
-     { "pet_mark_color", "Pet_mark_color", XtRPixel, sizeof(XtRPixel),
-       XtOffset(AppResources *,pet_mark_color), XtRString, "Red" },
- #ifdef GRAPHIC_TOMBSTONE
-     { "tombstone", "Tombstone", XtRString, sizeof(String),
--      XtOffset(AppResources *,tombstone), XtRString, "rip.xpm" },
-+      XtOffset(AppResources *,tombstone), XtRString, PIXMAPDIR "rip.xpm" },
-     { "tombtext_x", "Tombtext_x", XtRInt, sizeof(int),
-       XtOffset(AppResources *,tombtext_x), XtRString, "155" },
-     { "tombtext_y", "Tombtext_y", XtRInt, sizeof(int),
---- nethack/win/gnome/gnbind.c~	2003-10-22 21:20:43.000000000 -0700
-+++ nethack/win/gnome/gnbind.c	2003-10-22 21:20:49.000000000 -0700
-@@ -7,6 +7,8 @@
-  * code in the Gnome port and the rest of the nethack game engine. 
- */
- 
-+#include "config.h"
-+
- #include "gnbind.h"
- #include "gnmain.h"
- #include "gnaskstr.h"
-@@ -97,7 +97,7 @@
- 
- #ifdef HACKDIR
-     //if (ghack_init_glyphs(HACKDIR "/t32-1024.xpm"))
--    if (ghack_init_glyphs(HACKDIR "/x11tiles"))
-+    if (ghack_init_glyphs(PIXMAPDIR "/x11tiles"))
-       g_error ("ERROR:  Could not initialize glyphs.\n");
- #else
- #   error HACKDIR is not defined!
---- nethack/win/gnome/gnopts.c~	2003-10-22 21:21:01.000000000 -0700
-+++ nethack/win/gnome/gnopts.c	2003-10-22 21:21:20.000000000 -0700
-@@ -97,13 +97,13 @@
- 	case 0:
- 	    /* They selected traditional */
- 	    ghack_free_glyphs();
--	    if (ghack_init_glyphs(HACKDIR "/x11tiles"))
-+	    if (ghack_init_glyphs(PIXMAPDIR "/x11tiles"))
- 		      g_error ("ERROR:  Could not initialize glyphs.\n");
- 	    ghack_reinit_map_window();
- 	    break;
- 	case 1:
- 	    ghack_free_glyphs();
--	    if (ghack_init_glyphs(HACKDIR "/t32-1024.xpm"))
-+	    if (ghack_init_glyphs(PIXMAPDIR "/t32-1024.xpm"))
- 		      g_error ("ERROR:  Could not initialize glyphs.\n");
- 	    ghack_reinit_map_window();
- 
---- nethack/win/gnome/gnmap.c~	2003-10-22 21:57:08.000000000 -0700
-+++ nethack/win/gnome/gnmap.c	2003-10-22 21:57:20.000000000 -0700
-@@ -179,7 +179,7 @@
- 		    NULL) );
- 
-   /* Tile the map background with a pretty image */ 
--  background = gdk_imlib_load_image((char *) "mapbg.xpm");
-+  background = gdk_imlib_load_image((char *) PIXMAPDIR "mapbg.xpm");
-   if (background == NULL) {
-       g_warning("Bummer! Failed to load the map background image (mapbg.xpm)!");
-   }
diff --git a/debian/patches/17_gnome_remove_drop_many.dpatch b/debian/patches/17_gnome_remove_drop_many.dpatch
deleted file mode 100644
index 469fa9a..0000000
--- a/debian/patches/17_gnome_remove_drop_many.dpatch
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /bin/sh -e
-## 17_gnome_remove_drop_many.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Bug#154750; drop many and drop are the same, so pull the former
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
---- nethack/win/gnome/gnmain.c~	2003-10-24 11:29:11.000000000 -0700
-+++ nethack/win/gnome/gnmain.c	2003-10-24 11:29:19.000000000 -0700
-@@ -381,12 +381,6 @@
- 	       GINT_TO_POINTER('d'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'd',0
- 	   },
- 	   { 
--	       GNOME_APP_UI_ITEM, N_("Drop Many"), 
--	       N_("drop selected types of objects"),
--	       ghack_accelerator_selected, 
--	       GINT_TO_POINTER('D'), NULL, GNOME_APP_PIXMAP_NONE, NULL, 'D',GDK_SHIFT_MASK
--	   },
--	   { 
- 	       GNOME_APP_UI_ITEM, N_("Eat"), 
- 	       N_("eat something"),
- 	       ghack_accelerator_selected, 
diff --git a/debian/patches/18_overridewin.dpatch b/debian/patches/18_overridewin.dpatch
deleted file mode 100644
index b1af4ee..0000000
--- a/debian/patches/18_overridewin.dpatch
+++ /dev/null
@@ -1,45 +0,0 @@
-#! /bin/sh -e
-## 18_overridewin.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Better way to do it.
-
-if [ $# -ne 1 ]; then
-    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-    exit 1
-fi
-case "$1" in
-    -patch) patch -f --no-backup-if-mismatch -p0 < $0;;
-    -unpatch) patch -f --no-backup-if-mismatch -R -p0 < $0;;
-    *)
-        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
-        exit 1;;
-esac
-
-exit 0
-
-Index: src/windows.c
-===================================================================
-RCS file: /cvsroot/pkg-nethack/nethack/src/windows.c,v
-retrieving revision 1.1.1.1
-diff -u -u -r1.1.1.1 windows.c
---- src/windows.c	7 Oct 2003 19:00:21 -0000	1.1.1.1
-+++ src/windows.c	9 Dec 2003 18:20:08 -0000
-@@ -96,10 +103,16 @@
- choose_windows(s)
- const char *s;
- {
-+    char *ow; const char *wt;
-     register int i;
-+    
-+    if (!strcmp(s, DEFAULT_WINDOW_SYS) && (ow = getenv("OVERRIDEWIN")))
-+      wt = ow;
-+    else
-+      wt = s;
- 
-     for(i=0; winchoices[i].procs; i++)
--	if (!strcmpi(s, winchoices[i].procs->name)) {
-+	if (!strcmpi(wt, winchoices[i].procs->name)) {
- 	    windowprocs = *winchoices[i].procs;
- 	    if (winchoices[i].ini_routine) (*winchoices[i].ini_routine)();
- 	    return;
diff --git a/debian/patches/19_gnome_ext_events.dpatch b/debian/patches/19_gnome_ext_events.dpatch
deleted file mode 100644
index 668a757..0000000
--- a/debian/patches/19_gnome_ext_events.dpatch
+++ /dev/null
@@ -1,79 +0,0 @@
-#! /bin/sh -e
-## 19_gnome_ext_events.dpatch by  <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Extended menu didn't handle enough events. Handle stuff like mouse click
-
-if [ $# -lt 1 ]; then
-    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-    exit 1
-fi
-
-[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
-patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
-
-case "$1" in
-    -patch) patch -p1 ${patch_opts} < $0;;
-    -unpatch) patch -R -p1 ${patch_opts} < $0;;
-    *)
-        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
-        exit 1;;
-esac
-
-exit 0
-
---- orig/nethack-3.4.3/win/gnome/gnmenu.c	2003-12-24 21:41:57.000000000 -0800
-+++ nethack-3.4.3/win/gnome/gnmenu.c	2004-04-28 22:28:13.000000000 -0700
-@@ -30,9 +30,9 @@
- 	guint32 lastTime;
- } extMenu;
- 
-+static extMenu info = { 0 };
- static GdkColor color_blue = { 0, 0, 0, 0xffff };
- 
--
- static void
- ghack_menu_window_key(GtkWidget *menuWin, GdkEventKey *event, gpointer data)
- {
-@@ -83,10 +83,9 @@
- static void
- ghack_menu_row_selected (GtkCList *clist, int row, int col, GdkEvent *event)
- {
--    /* FIXME: Do something */
-+  info.curItem = row;
- }
- 
--
- void
- ghack_menu_window_clear(GtkWidget *menuWin, gpointer data)
- {
-@@ -640,6 +639,17 @@
-     int i;
-     char c = event->string[0];
- 
-+    switch (event->keyval)
-+    {
-+      case GDK_Up:
-+	--info->curItem;
-+	return;
-+
-+      case GDK_Down:
-+	++info->curItem;
-+	return;
-+    }
-+    
-     clist = GTK_WIDGET(gtk_object_get_data(GTK_OBJECT(menuWin), "clist"));
-     g_assert(clist != NULL);
- 
-@@ -697,7 +707,10 @@
-     GtkWidget* swin;
-     GtkWidget* frame1;
-     GtkWidget* clist;
--    extMenu info;
-+
-+    /* Reset, because it's now a static var */
-+    info.charIdx = 0;
-+    info.lastTime = 0;
- 
-     dialog = gnome_dialog_new("Extended Commands",
- 			      GNOME_STOCK_BUTTON_OK,
diff --git a/debian/patches/20_gcc4_fix.dpatch b/debian/patches/20_gcc4_fix.dpatch
deleted file mode 100644
index 9ae8586..0000000
--- a/debian/patches/20_gcc4_fix.dpatch
+++ /dev/null
@@ -1,18 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 20_gcc4_fix.dpatch by Andreas Jochens <aj at andaco.de>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: gcc 4 fix
-
---- nethack-3.4.3/win/Qt/qt_win.cpp~	2005-07-15 13:19:44.000000000 +0300
-+++ nethack-3.4.3/win/Qt/qt_win.cpp	2005-07-15 13:19:45.000000000 +0300
-@@ -4437,7 +4437,7 @@
- // XXX       define "-" to do "E-yyyyyyyy\r", but would still need "-" for
- // XXX       other purposes.  Maybe just too bad.
- //
--struct {
-+static struct {
-     int key;
-     int state;
-     const char* macro;
-
diff --git a/debian/patches/21_gnome_umask.dpatch b/debian/patches/21_gnome_umask.dpatch
deleted file mode 100644
index 68f7247..0000000
--- a/debian/patches/21_gnome_umask.dpatch
+++ /dev/null
@@ -1,27 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 21_gnome_umask.dpatch by Joshua Kwan <joshk at triplehelix.org>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: No description.
-
- at DPATCH@
---- nethack-3.4.3/win/gnome/gnmain.c~	2006-11-08 15:41:29.000000000 -0800
-+++ nethack-3.4.3/win/gnome/gnmain.c	2006-11-08 15:41:31.000000000 -0800
-@@ -710,6 +710,7 @@
-     int i;
-     struct timeval tv;
-     uid_t uid, euid;
-+    mode_t oldumask;
- 
-     /* It seems that the authors of gnome_score_init() drop group
-      * priveledges.  We need group priveledges, so until we change the
-@@ -728,7 +729,9 @@
-       setuid(uid);
-     hide_privileges(TRUE);
-     /* XXX gnome_init must print nethack options for --help, but does not */
-+    oldumask = umask(022); /* god, gnome 1.2 is retaded */
-     gnome_init ("nethack", VERSION_STRING, argc, argv);
-+    umask(oldumask);
-     hide_privileges(FALSE);
-     parse_args (argc, argv);
- 
diff --git a/debian/patches/22_qt_savegame.dpatch b/debian/patches/22_qt_savegame.dpatch
deleted file mode 100644
index 0e868cc..0000000
--- a/debian/patches/22_qt_savegame.dpatch
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 22_qt_savegame.dpatch by Sven Jonsson <sven.jonsson at ebox.tninet.se>
-##
-## All lines beginning with `## DP:' are a description of the patch.
-## DP: Search in the correct location for nethack-qt savegames
-## DP: This is filed as upstream bug Q343-2.
-
-
diff --git a/debian/patches/96_binutils-gold.dpatch b/debian/patches/96_binutils-gold.dpatch
deleted file mode 100644
index 67ab5e1..0000000
--- a/debian/patches/96_binutils-gold.dpatch
+++ /dev/null
@@ -1,17 +0,0 @@
-#! /bin/sh /usr/share/dpatch/dpatch-run
-## 96_binutils-gold.dpatch by Luca Falavigna <dktrkranz at debian.org>
-## DP: Fix FTBFS with binutils-gold.
-
- at DPATCH@
-diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' nethack-3.4.3~/sys/unix/Makefile.src nethack-3.4.3/sys/unix/Makefile.src
---- nethack-3.4.3~/sys/unix/Makefile.src	2011-08-26 21:13:05.938567905 +0200
-+++ nethack-3.4.3/sys/unix/Makefile.src	2011-08-26 21:14:23.510570283 +0200
-@@ -309,7 +309,7 @@
- # IRIX 4.0.x needs -lsun if NIS (YP) is being used for passwd file lookup
- # LIBS = -lsun
- #
--LIBS =
-+LIBS = -lstdc++
- 
- # make NetHack
- GAME     = nethack
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..6e0c9aa
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,21 @@
+0001-Make-sure-the-user-calling-recover-owns-the-file.patch
+0002-Change-paths-in-the-default-manpage-to-what-is-used-.patch
+0003-Define-_GNU_SOURCE-for-RTLD_NEXT.patch
+0004-Add-LISP-based-windowing-system.patch
+0005-Simple-mail.patch
+0006-Common-config.h-for-all-binary-packages.patch
+0007-Be-a-little-bit-more-useful-with-recover-s-error-mes.patch
+0008-Use-usr-share-pixmaps-nethack-for-pretty-pictures.patch
+0009-Better-way-to-do-it.patch
+0010-Enables-color-HP-monitor-for-textmode-NetHack.patch
+0011-Pasi-Kallinen-s-patch-to-add-colors-to-inventory-ite.patch
+0012-Paranoid-hit-asks-you-to-confirm-yes-instead-of-y-wh.patch
+0013-93_enh_dump.dpatch-by-Tom-Friedetzky-Jukka-Lahtinen-.patch
+0014-94_enh_sortloot.dpatch-by-Jeroen-Demeyer-and-Jukka-L.patch
+0015-95_enh_engulf_prayers.dpatch-by-Joshua-Kwan.patch
+0016-fix-non-constant-format-strings.patch
+0017-Debian-and-Linux-specifics-defined-in-unixconf.h.patch
+0018-lisp-support-in-src-Makefile.patch
+0019-stay-in-array-bounds.patch
+0020-fix-64-bit-issues-in-lisp-code.patch
+0021-fix-kfreebsd-ftbfs.patch
diff --git a/debian/qt/nethack-tty.sh b/debian/qt/nethack-tty.sh
deleted file mode 100644
index e3763f9..0000000
--- a/debian/qt/nethack-tty.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-set -e
-
-HACKSTYLE=qt
-
-if [ -z "$NETHACKOPTIONS" ]; then
-  if [ -e $HOME/.nethackrc ]; then
-    NETHACKOPTIONS=$HOME/.nethackrc
-    export NETHACKOPTIONS
-  else
-    NETHACKOPTIONS=/etc/nethack/nethackrc.tty
-    export NETHACKOPTIONS
-  fi
-fi
-
-HACKDIR=/usr/lib/games/nethack
-export HACKDIR
-HACK=$HACKDIR/nethack-$HACKSTYLE
-
-# see if we can find the full path name of PAGER, so help files work properly
-# assume that if someone sets up a special variable (HACKPAGER) for NetHack,
-# it will already be in a form acceptable to NetHack
-# ideas from brian at radio.astro.utoronto.ca
-if test \( "xxx$PAGER" != xxx \) -a \( "xxx$HACKPAGER" = xxx \)
-then
-
-        HACKPAGER=$PAGER
-
-#       use only the first word of the pager variable
-#       this prevents problems when looking for file names with trailing
-#       options, but also makes the options unavailable for later use from
-#       NetHack
-        for i in $HACKPAGER
-        do
-                HACKPAGER=$i
-                break
-        done
-
-        if test ! -f $HACKPAGER
-        then
-                IFS=:
-                for i in $PATH
-                do
-                        if test -f $i/$HACKPAGER
-                        then
-                                HACKPAGER=$i/$HACKPAGER
-                                export HACKPAGER
-                                break
-                        fi
-                done
-                IFS='   '
-        fi
-        if test ! -f $HACKPAGER
-        then
-                echo Cannot find $PAGER -- unsetting PAGER.
-                unset HACKPAGER
-                unset PAGER
-        fi
-fi
-
-cd $HACKDIR
-
-exec $HACK "$@" $ARGS
diff --git a/debian/qt/nethack.sh b/debian/qt/nethack.sh
deleted file mode 100644
index 8b30481..0000000
--- a/debian/qt/nethack.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-set -e
-
-HACKSTYLE=qt
-
-if [ -z "$NETHACKOPTIONS" ]; then
-  if [ -e $HOME/.nethackrc.$HACKSTYLE ]; then
-    NETHACKOPTIONS=$HOME/.nethackrc.$HACKSTYLE
-    export NETHACKOPTIONS
-  elif [ -e $HOME/.nethackrc ]; then
-    NETHACKOPTIONS=$HOME/.nethackrc
-    export NETHACKOPTIONS
-  else
-    NETHACKOPTIONS=/etc/nethack/nethackrc.$HACKSTYLE
-    export NETHACKOPTIONS
-  fi
-fi
-
-HACKDIR=/usr/lib/games/nethack
-export HACKDIR
-HACK=$HACKDIR/nethack-$HACKSTYLE
-
-cd $HACKDIR
-
-export OVERRIDEWIN=$HACKSTYLE
-
-exec $HACK "$@" $ARGS
diff --git a/debian/qt/nethackrc b/debian/qt/nethackrc
deleted file mode 100644
index 7afe47a..0000000
--- a/debian/qt/nethackrc
+++ /dev/null
@@ -1,33 +0,0 @@
-#
-# System-wide NetHack configuration file for Qt-based NetHack.
-#
-
-OPTIONS=windowtype:Qt,toptenwin,hilite_pet,tiled_map,!ascii_map
-OPTIONS=fixinv,safe_pet,sortpack,tombstone,color,!number_pad
-OPTIONS=verbose,news,fruit:potato
-OPTIONS=dogname:Slinky
-OPTIONS=catname:Rex
-OPTIONS=pickup_types:$
-OPTIONS=nomail
-OPTIONS=menustyle:partial,!time,showexp
-OPTIONS=msghistory:200
-
-# Enable this if you want to see your inventory sorted in alphabetical
-# order by item instead of by index letter:
-# OPTIONS=sortloot:full
-# or if you just want containers sorted:
-# OPTIONS=sortloot:loot
-
-# Optional Qt-specific options.
-
-# QT_TILEWIDTH=20
-# QT_TILEHEIGHT=24
-
-# These are the possible settings for QT_FONTSIZE:
-# t -> tiny
-# s -> small
-# m -> medium
-# l -> large
-# h -> huge
-
-# QT_FONTSIZE=m
diff --git a/debian/rules b/debian/rules
index 0c788bb..7c44ea8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,71 +1,80 @@
 #!/usr/bin/make -f
 
-# Nethack build script for Debian
-#
-# Behold, mortal, the origins of this makefile...
-#
-# Ben Gertzfield wrote the original debian/rules in 1997.
-# Joshua Kwan revised it in 2003.
-#
-# Copyright 1997-2003 Ben Gertzfield, Joshua Kwan. This script is
-# released under the GNU General Public License, version 2 or later.
-
-include /usr/share/dpatch/dpatch.make
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-	optimize := -O0
-else
-	optimize := -O2
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+        MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
 endif
-
-export CFLAGS = $(optimize) -I../include -g -Wall -DGCC_WARN -D__CORRECT_ISO_CPP_STRINGS_H_PROTO
+DEB_CFLAGS := $(shell dpkg-buildflags --get CFLAGS) -Wall
+DEB_CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS)
+DEB_LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS)
+
+# upstream Makefile only has CFLAGS (missing CPPFLAGS)
+# and does not give CFLAGS to linking calls, so add them.
+# also needs some stuff so the Makefile can be overriden:
+CFLAGS = $(DEB_CPPFLAGS) $(DEB_CFLAGS) -I../include -g -Wall -DGCC_WARN
+LFLAGS = $(DEB_CFLAGS) $(DEB_LDFLAGS)
+
+build-arch: build-arch-stamp
+build-arch-stamp: Makefile
+	if dpkg-buildflags --status >/dev/null 2>&1 ; then dpkg-buildflags --status ; fi
+	+$(call build_target,console)
+	+$(call build_target,x11)
+	+$(call build_target,lisp)
+	touch src/nethack.dummy ; sleep 2
+	$(MAKE) -j1 LFLAGS='$(LFLAGS)' CFLAGS='$(CFLAGS) -DUSE_XPM' \
+	  GAME=src/nethack.dummy \
+	  VARDATND="x11tiles pet_mark.xbm rip.xpm mapbg.xpm" \
+	  Guidebook data oracles options quest.dat rumors dungeon spec_levs \
+	  check-dlb x11tiles pet_mark.xbm rip.xpm mapbg.xpm
+	$(MAKE) -C util LFLAGS='$(LFLAGS)' CFLAGS='$(CFLAGS)' recover
+	touch $@
 
 TARGETS = console lisp x11
 
-TARGET_NAMES = $(TARGETS:%=build-%)
-TARGET_STAMPS = $(TARGET_NAMES:%=%-stamp)
+define build_target
+	$(MAKE) clean
+	touch include/config.h
+	sleep 2
+	$(MAKE) LFLAGS='$(LFLAGS)' CFLAGS='$(CFLAGS) $(EXTRACPP_$1)' \
+		WINSRC='$(SRC_$1)' WINOBJ='$(OBJ_$1)' WINLIB='$(LIB_$1)' \
+		$(EXTRA_$1) GAME='nethack.$1' \
+		-C src 'nethack.$1'
+endef
+SRC_console = $$(WINTTYSRC)
+OBJ_console = $$(WINTTYOBJ)
+LIB_console = -lncurses
+EXTRACPP_console =
+SRC_x11 = $$(WINTTYSRC) $$(WINX11SRC)
+OBJ_x11 = $$(WINTTYOBJ) $$(WINX11OBJ)
+LIB_x11 = -lncurses -lXaw -Wl,--as-needed -lXmu -lXext -Wl,--no-as-needed -lXt -lXpm -lX11 -Wl,--as-needed -lm -Wl,--no-as-needed
+EXTRACPP_x11 = -DX11_GRAPHICS
+SRC_lisp = $$(WINLISPSRC)
+OBJ_lisp = $$(WINLISPOBJ)
+LIB_lisp = $$(WINLISPLIB)
+EXTRACPP_lisp = -DLISP_GRAPHICS -DDEFAULT_WINDOW_SYS=\"lisp\"
 
-build: patch-stamp build-stamp
-build-stamp: $(TARGET_NAMES) build-common
-	touch build-stamp
 
 Makefile:
 # setup.sh makes the symlinks for the Makefiles. Giving it any
 # (in this case, 1) tells it to make symlinks.
 	sh sys/unix/setup.sh 1
 
-$(TARGET_NAMES): %: %-stamp
-
-$(TARGET_STAMPS): Makefile patch-stamp
-	dh_testdir
-	dh_installdirs
-
-	touch include/config.h
-	$(MAKE) nethack WIN=$(patsubst build-%-stamp,%,$@)
-	cp src/nethack debian/$(patsubst build-%-stamp,%,$@)
-	touch $@
-
-build-common: patch-stamp build-common-stamp
-
-build-common-stamp: Makefile $(TARGET_NAMES)
-	$(MAKE) CFLAGS="$(CFLAGS) -DUSE_XPM" \
-	  Guidebook data oracles options quest.dat rumors dungeon spec_levs \
-	  check-dlb x11tiles pet_mark.xbm rip.xpm mapbg.xpm
-	cd util && $(MAKE) recover
-	touch build-common-stamp
 
-clean: unpatch
+clean:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp build-common-stamp $(TARGET_STAMPS)
+	rm -f build-arch-stamp
 	rm -f nh10.pcf*
-	rm -f $(patsubst %,debian/%/nethack,$(TARGETS))
-	-$(MAKE) spotless
-	-find . -name Makefile -print0 | xargs -r -0 rm
+	rm -f $(patsubst %,src/nethack.%,$(TARGETS) dummy)
+	if [ -f Makefile ] ; then $(MAKE) spotless ; fi
+	find . -name Makefile -print0 | xargs -r -0 --no-run-if-empty rm
 
 	dh_clean
 
-install: build
+build-indep:
+binary-indep:
+# Ye olde no-op.
+
+binary-arch: build-arch-stamp
 	dh_testdir
 	dh_testroot
 	dh_prep
@@ -94,7 +103,7 @@ install: build
 	install -m 644 debian/x11/NetHack.ad \
 	  debian/nethack-x11/etc/X11/app-defaults/NetHack
 
-	/usr/bin/X11/bdftopcf -o nh10.pcf win/X11/nh10.bdf
+	/usr/bin/bdftopcf -o nh10.pcf win/X11/nh10.bdf
 	gzip -9f nh10.pcf
 	install -m 644 nh10.pcf.gz debian/nethack-x11/usr/share/fonts/X11/misc
 	# all graphics data needed by the graphical front ends
@@ -113,7 +122,7 @@ install: build
 	install -m 0755 -o root -g games util/recover \
 	  debian/nethack-common/usr/lib/games/nethack/recover; \
 
-	# all shell scripts, nethack binaries, overrides, and nethackrcs
+	# all shell scripts, nethack binaries, and nethackrcs
 	for flavor in $(TARGETS); do \
 	  install -m 0755 -o root -g root debian/$$flavor/nethack.sh \
 	    debian/nethack-$$flavor/usr/lib/games/nethack/nethack-$$flavor.sh; \
@@ -123,26 +132,11 @@ install: build
 	  fi; \
 	  install -m 0644 -o root -g root debian/$$flavor/nethackrc \
 	    debian/nethack-$$flavor/etc/nethack/nethackrc.$$flavor; \
-	  install -m 2755 -o root -g games debian/$$flavor/nethack \
+	  install -m 2755 -o root -g games src/nethack.$$flavor \
 	    debian/nethack-$$flavor/usr/lib/games/nethack/nethack-$$flavor; \
 	done
 
-	for pkg in $(addprefix nethack-,$(TARGETS) common); do \
-	  if [ -f "debian/overrides/lintian/$$pkg" ]; then \
-	    mkdir -p debian/$$pkg/usr/share/lintian/overrides; \
-	    cp debian/overrides/lintian/$$pkg debian/$$pkg/usr/share/lintian/overrides; \
-	  fi; \
-	done
-
-# spoilers have been split out into nethack-spoilers
-
-binary-indep:
-# Ye olde no-op.
-
-binary-arch: build install
-	dh_testdir
-	dh_testroot
-	dh_installdocs -a -A debian/README.Debian README.menucolor
+	dh_installdocs -a -A README.menucolor
 	dh_installdocs -pnethack-common debian/README.patches
 	dh_install
 	dh_installmenu -a
@@ -151,6 +145,7 @@ binary-arch: build install
 	dh_installman -a
 	dh_installchangelogs -a
 	dh_installxfonts -a
+	dh_lintian -a
 	dh_strip -a
 	dh_compress -a
 	dh_fixperms -a -Xnethack
@@ -160,9 +155,7 @@ binary-arch: build install
 	dh_md5sums -a
 	dh_builddeb -a
 
-source diff:
-	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
-
 binary: binary-indep binary-arch
+build: build-arch build-indep
 
-.PHONY: build build-common clean binary-indep binary-arch binary source diff install patch unpatch $(TARGET_NAMES)
+.PHONY: build build-arch build-indep clean binary-indep binary-arch binary
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..943ad9b
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,3 @@
+version=3
+opts=dversionmangle=s/\.//g \
+http://sf.net/nethack/nethack-(\d+)-src\.tgz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/nethack.git



More information about the Pkg-games-commits mailing list