pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/45010: destdir-ification of games/nethack*



>Number:         45010
>Category:       pkg
>Synopsis:       destdir-ification of games/nethack*
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 31 19:55:00 +0000 2011
>Originator:     Rhialto
>Release:        NetBSD 5.1
>Organization:
>Environment:
        
        
System: NetBSD radl.falu.nl 5.1 NetBSD 5.1 
(Radl-s_Pervasion_of_the_Incorrect_Chord) #0: Mon Jan 24 20:25:13 CET 2011 
root%vargaz.falu.nl@localhost:/usr/src/sys/arch/amd64/compile/RADL5.1 amd64
Architecture: x86_64
Machine: amd64
>Description:
        The various games/nethack packages don't support DESTDIR.
>How-To-Repeat:
        Try to build with DESTDIR support turned on.
>Fix:
        I revamped all the nethack packages a bit.

        I de-duplicated all patches for instance: now they are all in
        nethack-lib and identical for all versions. They were of course
        a maintenance nightmare (and already diverging).

        I separated the read-only games files (GAMESDIR) from the
        writable (VARDIR) and sanitized permissions. Building nethack-lib
        doesn't build the executable any more, since it isn't installed
        anyway (saves a lot of wasted time).

        I supplied diffs from pkgsrc-2011Q1 and a fresh shar file 
        of the complete set, so it also includes the new files.

        Removed are the patches and distinfos from all directories except
        nethack-lib.

        The nethack-license file for in licenses/ is the file named "license"
        in the distfile.


? nethack-lib/.Makefile.swp
? nethack-lib/patches/patch-ai
? nethack-lib/patches/patch-sys_unix_Makefile.src
? nethack-lib/patches/patch-sys_unix_Makefile.utl
Index: nethack-lib/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/Makefile,v
retrieving revision 1.26
diff -u -r1.26 Makefile
--- nethack-lib/Makefile        25 Sep 2008 14:02:09 -0000      1.26
+++ nethack-lib/Makefile        31 May 2011 19:47:21 -0000
@@ -4,7 +4,7 @@
 .include               "../../games/nethack-lib/Makefile.common"
 
 PKGNAME=               nethack-lib-${NETHACK_VERSION}
-PKGREVISION=           2
+PKGREVISION=           3
 
 COMMENT=               Data files for Nethack
 
@@ -20,17 +20,20 @@
 # These should eventually migrate to a better location, but keep them
 # here for now until we lose backward compatibility because of changes
 # to the fileformat.
-CONF_FILES_PERMS+=     /dev/null ${PREFIX}/share/${NETHACK_DIR}/record \
-                       ${ROOT_USER} ${NETHACK_GROUP} 664
-CONF_FILES_PERMS+=     /dev/null ${PREFIX}/share/${NETHACK_DIR}/logfile \
-                       ${ROOT_USER} ${NETHACK_GROUP} 664
-
-REQD_DIRS_PERMS+=      ${PREFIX}/share/${NETHACK_DIR}                  \
-                       ${ROOT_USER} ${NETHACK_GROUP} 775
-REQD_DIRS_PERMS+=      ${PREFIX}/share/${NETHACK_DIR}/save             \
-                       ${ROOT_USER} ${NETHACK_GROUP} 770
-
-CHECK_FILES_SKIP+=     ${PREFIX}/share/${NETHACK_DIR}/logfile          \
-                       ${PREFIX}/share/${NETHACK_DIR}/record
+CONF_FILES_PERMS+=     /dev/null ${VARDIR}/logfile \
+                       ${NETHACK_USER} ${NETHACK_GROUP} 664
+CONF_FILES_PERMS+=     /dev/null ${VARDIR}/perm \
+                       ${NETHACK_USER} ${NETHACK_GROUP} 664
+CONF_FILES_PERMS+=     /dev/null ${VARDIR}/record \
+                       ${NETHACK_USER} ${NETHACK_GROUP} 664
+
+REQD_DIRS_PERMS+=      ${VARDIR}                                       \
+                       ${NETHACK_USER} ${NETHACK_GROUP} 775
+REQD_DIRS_PERMS+=      ${VARDIR}/save                                  \
+                       ${NETHACK_USER} ${NETHACK_GROUP} 770
+
+CHECK_FILES_SKIP+=     ${VARDIR}/logfile                               \
+                       ${VARDIR}/perm                                  \
+                       ${VARDIR}/record
 
 .include "../../mk/bsd.pkg.mk"
Index: nethack-lib/Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/Makefile.common,v
retrieving revision 1.26
diff -u -r1.26 Makefile.common
--- nethack-lib/Makefile.common 4 Aug 2009 13:58:57 -0000       1.26
+++ nethack-lib/Makefile.common 31 May 2011 19:47:21 -0000
@@ -1,5 +1,10 @@
 # $NetBSD: Makefile.common,v 1.26 2009/08/04 13:58:57 joerg Exp $
 #
+# used by games/nethack/Makefile
+# used by games/nethack-lib/Makefile
+# used by games/nethack-x11/Makefile
+# used by games/nethack-tty/Makefile
+# used by games/nethack-qt/Makefile
 
 NETHACK_BASEVER=       3.4.3
 NETHACK_VERSION=       ${NETHACK_BASEVER}
@@ -13,15 +18,17 @@
 
 MAINTAINER=            pooka%NetBSD.org@localhost
 HOMEPAGE=              http://www.nethack.org/
+LICENSE=               nethack-license
 
 MAKE_JOBS_SAFE=                no
+PKG_DESTDIR_SUPPORT=   user-destdir
 
 .if !defined(META_PACKAGE)
 
 WRKSRC=                        ${WRKDIR}/nethack-${NETHACK_BASEVER}
 HAS_CONFIGURE=         yes
 CONFIGURE_SCRIPT=      ./sys/unix/setup.sh
-USE_TOOLS+=            gzip yacc lex
+USE_TOOLS+=            gzip yacc lex awk
 
 .include "../../mk/bsd.prefs.mk"
 
@@ -40,20 +47,28 @@
 NETHACK_OS?=           BSD
 
 SUBST_CLASSES+=                os
-SUBST_MESSAGE.os=      Configuring for $(NETHACK_OS)
+SUBST_MESSAGE.os=      Configuring for ${NETHACK_OS}
 SUBST_STAGE.os=                post-patch
 SUBST_FILES.os=                include/unixconf.h
 SUBST_SED.os=          -e 's,__NETHACK_OS__,${NETHACK_OS},'
 
-NETHACK_GROUP=         games
-PKG_GROUPS=            ${NETHACK_GROUP}
+USE_GAMESGROUP=                yes
+NETHACK_USER=          ${GAMES_USER}
+NETHACK_GROUP=         ${GAMES_GROUP}
+BUILD_DEFS+=           GAMES_USER GAMES_GROUP
+GAMEPERM=              ${NETHACK_USER} ${NETHACK_GROUP} 2555
+
+GAMEDIR=               ${PREFIX}/share/${NETHACK_DIR}
+VARDIR=                        /var/games/nethack340
+MAKE_ENV+=             GAMEDIR=${GAMEDIR:Q}
+MAKE_ENV+=             VARDIR=${VARDIR:Q}
 
 pre-configure:
        @${CHMOD} 755 ${WRKSRC}/sys/unix/setup.sh
 
 post-patch:
        @${MV} ${WRKSRC}/include/config.h ${WRKSRC}/config.h-pre
-       @${SED} -e 's@XXXPREFIXXXX@${PREFIX}@g'                         \
+       @${SED} -e 's|@PREFIX@|${PREFIX}|g'                             \
                -e 's|@GZIP_PROGRAM@|'`${ECHO} ${GZIP_CMD}              \
                | ${AWK} '{ print $$1 }'`'|g'                           \
                < ${WRKSRC}/config.h-pre > ${WRKSRC}/include/config.h
Index: nethack-lib/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/PLIST,v
retrieving revision 1.7
diff -u -r1.7 PLIST
--- nethack-lib/PLIST   14 Jun 2009 17:56:52 -0000      1.7
+++ nethack-lib/PLIST   31 May 2011 19:47:21 -0000
@@ -113,7 +113,6 @@
 share/nethackdir340/oracle.lev
 share/nethackdir340/oracles
 share/nethackdir340/orcus.lev
-share/nethackdir340/perm
 share/nethackdir340/pet_mark.xbm
 share/nethackdir340/quest.dat
 share/nethackdir340/rip.xpm
Index: nethack-lib/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/distinfo,v
retrieving revision 1.16
diff -u -r1.16 distinfo
--- nethack-lib/distinfo        20 May 2008 19:47:16 -0000      1.16
+++ nethack-lib/distinfo        31 May 2011 19:47:21 -0000
@@ -3,10 +3,13 @@
 SHA1 (nethack-343-src.tgz) = c26537093c38152bc0fbcec20468d975b35f59fd
 RMD160 (nethack-343-src.tgz) = 42f600d24715a0b7e631b357c135761410b3ca95
 Size (nethack-343-src.tgz) = 3497458 bytes
-SHA1 (patch-aa) = ed5c55651acf81c459867c99026e13a6c5ed34a0
-SHA1 (patch-ab) = 73a1ac287ded70f371bb38c82cdbcd36182ce3a5
-SHA1 (patch-ac) = e447b4c60ef7db7cfcd35a9be8b8d2f86fc0c27b
-SHA1 (patch-ad) = 05bb391eb0e4382c906251bc8b8627124873a7a0
-SHA1 (patch-ae) = ff98bb6b76795b7ae69c3602f70a1a597c28633c
-SHA1 (patch-af) = e4723716f326df242279953b6091e528eb7e0007
-SHA1 (patch-ag) = 6aeae6bde079b9c9081f6e32523687010c9bc674
+SHA1 (patch-aa) = e3e420b901a91e773384a995912e0ecc6bd6e87f
+SHA1 (patch-ab) = 49947b960f2b7871fc798398d1c1ceab8d462ec9
+SHA1 (patch-ac) = 50cac811281c629edf2a72e523b62b51f8c3c840
+SHA1 (patch-ad) = be56ef8459f3273a0b316bb94e0ae7397a53c37f
+SHA1 (patch-ae) = 8530c1e033f2522e05b699db36d84f77ecf886be
+SHA1 (patch-af) = a567c4c664f135ad24f3f0069ddc29bf5b950b21
+SHA1 (patch-ag) = 5bf322fb92a3cd9df9559e56265f0477d9e92487
+SHA1 (patch-ai) = 73c5b2ea1227531089474705f2f18bc411366365
+SHA1 (patch-sys_unix_Makefile.src) = 003f16fba997ac61efc92adecc13b883135a86bc
+SHA1 (patch-sys_unix_Makefile.utl) = 409e1f8b58c7e2709d224f42c19fdfd162d9cea7
Index: nethack-lib/patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/patches/patch-aa,v
retrieving revision 1.9
diff -u -r1.9 patch-aa
--- nethack-lib/patches/patch-aa        5 Mar 2004 15:21:01 -0000       1.9
+++ nethack-lib/patches/patch-aa        31 May 2011 19:47:21 -0000
@@ -1,8 +1,45 @@
 $NetBSD: patch-aa,v 1.9 2004/03/05 15:21:01 pooka Exp $
 
---- include/config.h.old       2004-03-05 15:39:59.000000000 +0200
-+++ include/config.h   2004-03-05 15:40:05.000000000 +0200
-@@ -169,11 +169,11 @@
+Make configurable.
+
+--- include/config.h.orig      2003-12-07 23:39:13.000000000 +0000
++++ include/config.h
+@@ -42,6 +42,16 @@
+  * Define all of those you want supported in your binary.
+  * Some combinations make no sense.  See the installation document.
+  */
++#if   defined(GTYPE_TTY)
++#  define DEFAULT_WINDOW_SYS "tty"
++#elif defined(GTYPE_X11)
++#  define X11_GRAPHICS
++#  define DEFAULT_WINDOW_SYS "x11"
++#elif defined(GTYPE_QT)
++#  define QT_GRAPHICS
++#  define DEFAULT_WINDOW_SYS "Qt"
++#endif
++
+ #define TTY_GRAPHICS  /* good old tty based graphics */
+ /* #define X11_GRAPHICS */    /* X11 interface */
+ /* #define QT_GRAPHICS */     /* Qt interface */
+@@ -86,7 +96,7 @@
+ # define DEFAULT_WC_TILED_MAP   /* Default to tiles if users doesn't say 
wc_ascii_map */
+ # define USER_SOUNDS          /* Use sounds */
+ # ifndef __APPLE__
+-#  define USER_SOUNDS_REGEX
++/*#  define USER_SOUNDS_REGEX */
+ # endif
+ # define USE_XPM              /* Use XPM format for images (required) */
+ # define GRAPHIC_TOMBSTONE    /* Use graphical tombstone (rip.ppm) */
+@@ -126,7 +136,7 @@
+  * would allow:
+  *  xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
+  */
+-/* # define USE_XPM */                /* Disable if you do not have the XPM 
library */
++# define USE_XPM              /* Disable if you do not have the XPM library */
+ # ifdef USE_XPM
+ #  define GRAPHIC_TOMBSTONE   /* Use graphical tombstone (rip.xpm) */
+ # endif
+@@ -169,11 +179,11 @@
  
  #ifdef UNIX
  /* path and file name extension for compression program */
@@ -13,21 +50,21 @@
  /* An example of one alternative you might want to use: */
 -/* #define COMPRESS "/usr/local/bin/gzip" */  /* FSF gzip compression */
 -/* #define COMPRESS_EXTENSION ".gz" */                /* normal gzip 
extension */
-+#define COMPRESS "@GZIP_PROGRAM@"             /* FSF gzip compression */
++#define COMPRESS "/usr/bin/gzip"              /* FSF gzip compression */
 +#define COMPRESS_EXTENSION ".gz"              /* normal gzip extension */
  #endif
  
  #ifndef COMPRESS
-@@ -204,7 +204,7 @@
+@@ -204,7 +214,7 @@
   * otherwise it will be the current directory.
   */
  # ifndef HACKDIR
 -#  define HACKDIR "/usr/games/lib/nethackdir"
-+#  define HACKDIR "XXXPREFIXXXX/share/nethackdir340"
++#  define HACKDIR "/usr/pkg/share/nethackdir340"
  # endif
  
  /*
-@@ -300,7 +300,7 @@
+@@ -300,7 +310,7 @@ typedef unsigned char      uchar;
   * functions that have been macroized.
   */
  
Index: nethack-lib/patches/patch-ab
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/patches/patch-ab,v
retrieving revision 1.11
diff -u -r1.11 patch-ab
--- nethack-lib/patches/patch-ab        5 Mar 2004 15:21:01 -0000       1.11
+++ nethack-lib/patches/patch-ab        31 May 2011 19:47:21 -0000
@@ -1,8 +1,10 @@
 $NetBSD: patch-ab,v 1.11 2004/03/05 15:21:01 pooka Exp $
 
---- sys/unix/Makefile.top.orig 2003-12-08 01:39:13.000000000 +0200
-+++ sys/unix/Makefile.top      2004-03-05 15:40:57.000000000 +0200
-@@ -14,18 +14,17 @@
+Make configurable.
+
+--- sys/unix/Makefile.top.orig 2003-12-07 23:39:13.000000000 +0000
++++ sys/unix/Makefile.top
+@@ -14,18 +14,18 @@
  # MAKE = make
  
  # make NetHack
@@ -17,23 +19,24 @@
  # Permissions - some places use setgid instead of setuid, for instance
  # See also the option "SECURE" in include/config.h
 -GAMEPERM = 04755
--FILEPERM = 0644
 +GAMEPERM = 2755
-+FILEPERM = 0664
+ FILEPERM = 0644
++VARFILEPERM = 0664
  EXEPERM  = 0755
 -DIRPERM  = 0755
 +DIRPERM  = 0775
  
  # GAMEDIR also appears in config.h as "HACKDIR".
  # VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else GAMEDIR
-@@ -35,12 +34,12 @@
+@@ -35,12 +35,12 @@ DIRPERM  = 0755
  # therefore there should not be anything in GAMEDIR that you want to keep
  # (if there is, you'll have to do the installation by hand or modify the
  # instructions)
 -GAMEDIR  = $(PREFIX)/games/lib/$(GAME)dir
-+GAMEDIR  = $(PREFIX)/share/$(GAME)dir340
- VARDIR  = $(GAMEDIR)
+-VARDIR  = $(GAMEDIR)
 -SHELLDIR = $(PREFIX)/games
++GAMEDIR  ?= $(PREFIX)/share/$(GAME)dir340
++VARDIR  ?= /var/games/nethack340
 +SHELLDIR = $(PREFIX)/bin
  
  # per discussion in Install.X11 and Install.Qt
@@ -42,7 +45,18 @@
  # VARDATND = x11tiles NetHack.ad pet_mark.xbm
  # VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm
  # for Atari/Gem
-@@ -87,9 +86,12 @@
+@@ -64,8 +64,8 @@ VARDAT = $(VARDATD) $(VARDATND)
+ # other permission-related reasons.  If that happens, you may want to set the
+ # command to "true", which is a no-op. Note that disabling chown or chgrp
+ # will only work if setuid (or setgid) behavior is not desired or required.
+-CHOWN = chown
+-CHGRP = chgrp
++CHOWN = : # chown
++CHGRP = : # chgrp
+ 
+ #
+ # end of configuration
+@@ -87,9 +87,12 @@ DAT = $(DATNODLB) $(DATDLB)
  $(GAME):
        ( cd src ; $(MAKE) )
  
@@ -56,29 +70,127 @@
  # Note: many of the dependencies below are here to allow parallel make
  # to generate valid output
  
-@@ -183,18 +185,15 @@
+@@ -99,20 +102,20 @@ Guidebook:
+ manpages:
+       ( cd doc ; $(MAKE) manpages )
+ 
+-data: $(GAME)
++data: # $(GAME)
+       ( cd dat ; $(MAKE) data )
+ 
+-rumors: $(GAME)
++rumors: # $(GAME)
+       ( cd dat ; $(MAKE) rumors )
+ 
+-oracles: $(GAME)
++oracles: # $(GAME)
+       ( cd dat ; $(MAKE) oracles )
+ 
+ #     Note: options should have already been made with make, but...
+-options: $(GAME)
++options: # $(GAME)
+       ( cd dat ; $(MAKE) options )
+ 
+-quest.dat: $(GAME)
++quest.dat: # $(GAME)
+       ( cd dat ; $(MAKE) quest.dat )
+ 
+ spec_levs: dungeon
+@@ -120,22 +123,22 @@ spec_levs: dungeon
+       ( cd dat ; $(MAKE) spec_levs )
+       ( cd dat ; $(MAKE) quest_levs )
+ 
+-dungeon: $(GAME)
++dungeon: # $(GAME)
+       ( cd util ; $(MAKE) dgn_comp )
+       ( cd dat ; $(MAKE) dungeon )
+ 
+-nhtiles.bmp: $(GAME)
++nhtiles.bmp: # $(GAME)
+       ( cd dat ; $(MAKE) nhtiles.bmp )
+ 
+-x11tiles: $(GAME)
++x11tiles: # $(GAME)
+       ( cd util ; $(MAKE) tile2x11 )
+       ( cd dat ; $(MAKE) x11tiles )
+ 
+-beostiles: $(GAME)
++beostiles: # $(GAME)
+       ( cd util ; $(MAKE) tile2beos )
+       ( cd dat ; $(MAKE) beostiles )
+ 
+-NetHack.ad: $(GAME)
++NetHack.ad: # $(GAME)
+       ( cd dat ; $(MAKE) NetHack.ad )
+ 
+ pet_mark.xbm:
+@@ -150,7 +153,7 @@ mapbg.xpm:
+ nhsplash.xpm:
+       ( cd dat ; $(MAKE) nhsplash.xpm )
+ 
+-nh16.img: $(GAME)
++nh16.img: # $(GAME)
+       ( cd util ; $(MAKE) tile2img.ttp )
+       ( cd dat ; $(MAKE) nh16.img )
+ 
+@@ -172,7 +175,7 @@ dlb:
+ 
+ # recover can be used when INSURANCE is defined in include/config.h
+ # and the checkpoint option is true
+-recover: $(GAME)
++recover: # $(GAME)
+       ( cd util ; $(MAKE) recover )
+ 
+ dofiles:
+@@ -183,34 +186,31 @@ dofiles:
                -e '}'                                  \
                -e '$$s/.*/nodlb/p' < dat/options` ;    \
        $(MAKE) dofiles-$${target-nodlb}
 -      cp src/$(GAME) $(GAMEDIR)
 -      cp util/recover $(GAMEDIR)
-+      cp util/recover $(PREFIX)/bin
-       -rm -f $(SHELLDIR)/$(GAME)
-       sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
+-      -rm -f $(SHELLDIR)/$(GAME)
+-      sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
++      cp util/recover $(DESTDIR)$(PREFIX)/bin
++      -rm -f $(DESTDIR)$(SHELLDIR)/$(GAME)
++      sed -e 's;@GAMEDIR@;$(GAMEDIR);' \
                -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
-+              -e 's;XXXPREFIXXXX;$(PREFIX);' \
++              -e 's;@PREFIX@;$(PREFIX);' \
                < sys/unix/nethack.sh \
-               > $(SHELLDIR)/$(GAME)
+-              > $(SHELLDIR)/$(GAME)
++              > $(DESTDIR)$(SHELLDIR)/$(GAME)
  # set up their permissions
 -      -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \
 -                      $(CHGRP) $(GAMEGRP) $(GAME) recover )
 -      chmod $(GAMEPERM) $(GAMEDIR)/$(GAME)
 -      chmod $(EXEPERM) $(GAMEDIR)/recover
-+      chmod $(EXEPERM) $(PREFIX)/bin/recover
-       -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME)
-       $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME)
-       chmod $(EXEPERM) $(SHELLDIR)/$(GAME)
-@@ -230,16 +229,16 @@
+-      -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME)
+-      $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME)
+-      chmod $(EXEPERM) $(SHELLDIR)/$(GAME)
++      chmod $(EXEPERM) $(DESTDIR)$(PREFIX)/bin/recover
++      -$(CHOWN) $(GAMEUID) $(DESTDIR)$(SHELLDIR)/$(GAME)
++      $(CHGRP) $(GAMEGRP) $(DESTDIR)$(SHELLDIR)/$(GAME)
++      chmod $(EXEPERM) $(DESTDIR)$(SHELLDIR)/$(GAME)
+ 
+ dofiles-dlb: check-dlb
+-      ( cd dat ; cp nhdat $(DATNODLB) $(GAMEDIR) )
++      ( cd dat ; cp nhdat $(DATNODLB) $(DESTDIR)$(GAMEDIR) )
+ # set up their permissions
+-      -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \
++      -( cd $(DESTDIR)$(GAMEDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \
+                       $(CHGRP) $(GAMEGRP) nhdat $(DATNODLB) ; \
+                       chmod $(FILEPERM) nhdat $(DATNODLB) )
+ 
+ dofiles-nodlb:
+ # copy over the game files
+-      ( cd dat ; cp $(DAT) $(GAMEDIR) )
++      ( cd dat ; cp $(DAT) $(DESTDIR)$(GAMEDIR) )
+ # set up their permissions
+-      -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \
++      -( cd $(DESTDIR)$(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \
+                       $(CHGRP) $(GAMEGRP) $(DAT) ; \
+                       chmod $(FILEPERM) $(DAT) )
+ 
+@@ -230,26 +230,39 @@ update: $(GAME) recover $(VARDAT) dungeo
  # and a reminder
        @echo You may also want to install the man pages via the doc Makefile.
  
@@ -86,36 +198,45 @@
 +install-dat: recover $(VARDAT) dungeon spec_levs
  # set up the directories
  # not all mkdirs have -p; those that don't will create a -p directory
-       -mkdir -p $(SHELLDIR)
+-      -mkdir -p $(SHELLDIR)
 -      -rm -rf $(GAMEDIR) $(VARDIR)
-       -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save
+-      -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save
++      -mkdir -p $(DESTDIR)$(SHELLDIR)
++      -mkdir -p $(DESTDIR)$(GAMEDIR) $(DESTDIR)$(VARDIR) 
$(DESTDIR)$(VARDIR)/save
        -rmdir ./-p
-       -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
-       $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
+-      -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
+-      $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
 -      chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
-+      chmod $(DIRPERM) $(GAMEDIR) $(VARDIR)
-+      chmod 770 $(VARDIR)/save
++      -$(CHOWN) $(GAMEUID) $(DESTDIR)$(GAMEDIR) $(DESTDIR)$(VARDIR) 
$(DESTDIR)$(VARDIR)/save
++      $(CHGRP) $(DESTDIR)$(GAMEGRP) $(DESTDIR)$(GAMEDIR) $(DESTDIR)$(VARDIR) 
$(DESTDIR)$(VARDIR)/save
++      chmod $(DIRPERM) $(DESTDIR)$(GAMEDIR) $(DESTDIR)$(VARDIR)
++      chmod 770 $(DESTDIR)$(VARDIR)/save
  # set up the game files
        ( $(MAKE) dofiles )
  # set up some additional files
-@@ -247,9 +246,20 @@
-       -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
+-      touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile
+-      -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
++      touch $(DESTDIR)$(VARDIR)/perm $(DESTDIR)$(VARDIR)/record 
$(DESTDIR)$(VARDIR)/logfile
++      -( cd $(DESTDIR)$(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
                        $(CHGRP) $(GAMEGRP) perm record logfile ; \
-                       chmod $(FILEPERM) perm record logfile )
-+      -touch -c $(VARDIR)/bones* $(VARDIR)/?lock* $(VARDIR)/wizard*
-+      -touch -c $(VARDIR)/save/*
-+      -mkdir -p $(PREFIX)/share/doc/nethack
-+      cp doc/Guidebook $(PREFIX)/share/doc/nethack
-+      chown $(GAMEUID):$(GAMEGRP) $(PREFIX)/share/doc/nethack/Guidebook
-+      chmod $(FILEPERM) $(PREFIX)/share/doc/nethack/Guidebook
+-                      chmod $(FILEPERM) perm record logfile )
++                      chmod $(VARFILEPERM) perm record logfile )
++      -touch -c $(DESTDIR)$(VARDIR)/bones* $(DESTDIR)$(VARDIR)/?lock* 
$(DESTDIR)$(VARDIR)/wizard*
++      -touch -c $(DESTDIR)$(VARDIR)/save/*
++      -mkdir -p $(DESTDIR)$(PREFIX)/share/doc/nethack
++      cp doc/Guidebook $(DESTDIR)$(PREFIX)/share/doc/nethack
++      $(CHOWN) $(GAMEUID):$(GAMEGRP) 
$(DESTDIR)$(PREFIX)/share/doc/nethack/Guidebook
++      chmod $(FILEPERM) $(DESTDIR)$(PREFIX)/share/doc/nethack/Guidebook
  # and a reminder
        @echo You may also want to reinstall the man pages via the doc Makefile.
  
 +binfiles: $(GAME)
-+      cp src/$(GAME) $(SHELLDIR)/$(GAME)$(GTYPE)
-+      -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME)$(GTYPE) ; \
-+              $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME)$(GTYPE) )
-+       chmod $(GAMEPERM) $(SHELLDIR)/$(GAME)$(GTYPE)
++      mkdir -p $(DESTDIR)$(SHELLDIR)
++      mkdir -p $(DESTDIR)$(GAMEDIR)
++      cp src/$(GAME) $(DESTDIR)$(SHELLDIR)/$(GAME)$(GTYPE)
++      -( cd $(DESTDIR)$(GAMEDIR) ; $(CHOWN) $(GAMEUID) 
$(DESTDIR)$(SHELLDIR)/$(GAME)$(GTYPE) ; \
++              $(CHGRP) $(GAMEGRP) $(DESTDIR)$(SHELLDIR)/$(GAME)$(GTYPE) )
++       #chmod $(GAMEPERM) $(DESTDIR)$(SHELLDIR)/$(GAME)$(GTYPE)
  
  # 'make clean' removes all the .o files, but leaves around all the executables
  # and compiled data files
Index: nethack-lib/patches/patch-ac
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/patches/patch-ac,v
retrieving revision 1.9
diff -u -r1.9 patch-ac
--- nethack-lib/patches/patch-ac        19 Jun 2006 17:07:45 -0000      1.9
+++ nethack-lib/patches/patch-ac        31 May 2011 19:47:21 -0000
@@ -1,5 +1,7 @@
 $NetBSD: patch-ac,v 1.9 2006/06/19 17:07:45 minskim Exp $
 
+Fix for NetBSD.
+
 --- include/system.h.orig      2003-12-07 15:39:13.000000000 -0800
 +++ include/system.h
 @@ -79,10 +79,10 @@ typedef long       off_t;
Index: nethack-lib/patches/patch-ad
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/patches/patch-ad,v
retrieving revision 1.7
diff -u -r1.7 patch-ad
--- nethack-lib/patches/patch-ad        27 Oct 2007 18:26:34 -0000      1.7
+++ nethack-lib/patches/patch-ad        31 May 2011 19:47:21 -0000
@@ -1,7 +1,9 @@
 $NetBSD: patch-ad,v 1.7 2007/10/27 18:26:34 pooka Exp $
 
---- sys/unix/nethack.sh.orig   2003-12-08 00:39:13.000000000 +0100
-+++ sys/unix/nethack.sh        2007-10-27 20:18:37.000000000 +0200
+Make configurable.
+
+--- sys/unix/nethack.sh.orig   2003-12-07 23:39:13.000000000 +0000
++++ sys/unix/nethack.sh
 @@ -1,9 +1,31 @@
  #!/bin/sh
  #     SCCS Id: @(#)nethack.sh 3.4     1990/02/26
@@ -11,7 +13,7 @@
 +findbin ()
 +{
 +      for x in $UILIST; do
-+              if [ -x XXXPREFIXXXX/bin/nethack-$x ]; then
++              if [ -x @PREFIX@/bin/nethack-$x ]; then
 +                      echo $x
 +                      return
 +              fi
@@ -29,10 +31,10 @@
 +      exit 1
 +fi
 +
-+HACKDIR=XXXPREFIXXXX/share/nethackdir340
++HACKDIR=@GAMEDIR@
  export HACKDIR
 -HACK=$HACKDIR/nethack
-+HACK=XXXPREFIXXXX/bin/nethack-$TTY
++HACK=@PREFIX@/bin/nethack-$TTY
  MAXNROFPLAYERS=4
  
  # Since Nethack.ad is installed in HACKDIR, add it to XUSERFILESEARCHPATH
Index: nethack-lib/patches/patch-ae
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/patches/patch-ae,v
retrieving revision 1.5
diff -u -r1.5 patch-ae
--- nethack-lib/patches/patch-ae        20 May 2008 19:47:16 -0000      1.5
+++ nethack-lib/patches/patch-ae        31 May 2011 19:47:21 -0000
@@ -1,6 +1,8 @@
 $NetBSD: patch-ae,v 1.5 2008/05/20 19:47:16 tnn Exp $
 
---- sys/unix/Makefile.doc.orig 2003-12-08 00:39:13.000000000 +0100
+Make configurable.
+
+--- sys/unix/Makefile.doc.orig 2003-12-07 23:39:13.000000000 +0000
 +++ sys/unix/Makefile.doc
 @@ -41,7 +41,7 @@ Guidebook.dvi:       Guidebook.tex
  
@@ -11,3 +13,20 @@
  MANEXT        = 6
  
  # manual installation for most BSD-style systems
+@@ -58,11 +58,11 @@ DLBMANCREATE = cp dlb.6
+ # DLBMANCREATE = nroff -man dlb.6 >
+ 
+ manpages:
+-      -$(GAMEMANCREATE) $(MANDIR)/$(GAME).$(MANEXT)
+-      -$(LEVMANCREATE) $(MANDIR)/lev_comp.$(MANEXT)
+-      -$(DGNMANCREATE) $(MANDIR)/dgn_comp.$(MANEXT)
+-      -$(RCVRMANCREATE) $(MANDIR)/recover.$(MANEXT)
+-      -$(DLBMANCREATE) $(MANDIR)/dlb.$(MANEXT)
++      -$(GAMEMANCREATE) $(DESTDIR)$(MANDIR)/$(GAME).$(MANEXT)
++      -$(LEVMANCREATE) $(DESTDIR)$(MANDIR)/lev_comp.$(MANEXT)
++      -$(DGNMANCREATE) $(DESTDIR)$(MANDIR)/dgn_comp.$(MANEXT)
++      -$(RCVRMANCREATE) $(DESTDIR)$(MANDIR)/recover.$(MANEXT)
++      -$(DLBMANCREATE) $(DESTDIR)$(MANDIR)/dlb.$(MANEXT)
+ 
+ # manual creation for distribution
+ DISTRIB = Guidebook.txt nethack.txt lev_comp.txt dgn_comp.txt recover.txt 
dlb.txt
Index: nethack-lib/patches/patch-af
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/patches/patch-af,v
retrieving revision 1.6
diff -u -r1.6 patch-af
--- nethack-lib/patches/patch-af        9 Oct 2006 02:06:58 -0000       1.6
+++ nethack-lib/patches/patch-af        31 May 2011 19:47:21 -0000
@@ -1,6 +1,9 @@
 $NetBSD: patch-af,v 1.6 2006/10/09 02:06:58 ben Exp $
 
---- include/unixconf.h.orig    2003-12-07 18:39:13.000000000 -0500
+Make configurable.
+Fix for BSD.
+
+--- include/unixconf.h.orig    2003-12-07 23:39:13.000000000 +0000
 +++ include/unixconf.h
 @@ -19,20 +19,21 @@
   */
@@ -36,7 +39,15 @@
                        /* Should be defined for most SYSV, SVR4 (including
                         * Solaris 2+), HPUX, and Linux systems.  In
                         * particular, it should NOT be defined for the UNIXPC
-@@ -171,7 +172,7 @@
+@@ -103,6 +104,7 @@
+  * system, define VAR_PLAYGROUND to be where the variable parts are kept.
+  */
+ /* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
++#define VAR_PLAYGROUND "/var/games/nethack340"
+ 
+ 
+ /*
+@@ -171,7 +173,7 @@
  #  ifdef AMS
  #define AMS_MAILBOX   "/Mailbox"
  #  else
@@ -45,3 +56,12 @@
  #define DEF_MAILREADER        "/usr/bin/mail"
  #   else
  #define DEF_MAILREADER        "/usr/ucb/Mail"
+@@ -284,7 +286,7 @@
+ #endif
+ 
+ #if defined(BSD) || defined(ULTRIX)
+-# if !defined(DGUX) && !defined(SUNOS4)
++# if !defined(DGUX) && !defined(SUNOS4) && !defined(BSD)
+ #define memcpy(d, s, n)               bcopy(s, d, n)
+ #define memcmp(s1, s2, n)     bcmp(s2, s1, n)
+ # endif
Index: nethack-lib/patches/patch-ag
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-lib/patches/patch-ag,v
retrieving revision 1.2
diff -u -r1.2 patch-ag
--- nethack-lib/patches/patch-ag        10 Aug 2000 17:50:07 -0000      1.2
+++ nethack-lib/patches/patch-ag        31 May 2011 19:47:21 -0000
@@ -1,5 +1,7 @@
 $NetBSD: patch-ag,v 1.2 2000/08/10 17:50:07 pooka Exp $
 
+Fix for NetBSD.
+
 --- src/mail.c.orig    Wed Aug  9 21:02:04 2000
 +++ src/mail.c Thu Aug 10 18:32:30 2000
 @@ -71,7 +71,7 @@

Index: nethack-qt/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-qt/Makefile,v
retrieving revision 1.58
diff -u -r1.58 Makefile
--- nethack-qt/Makefile 13 Jan 2011 13:37:48 -0000      1.58
+++ nethack-qt/Makefile 31 May 2011 19:28:14 -0000
@@ -4,24 +4,31 @@
 .include "../../games/nethack-lib/Makefile.common"
 
 PKGNAME=               nethack-qt-${NETHACK_VERSION}
-PKGREVISION=           10
+PKGREVISION=           11
 CATEGORIES+=           x11
 
 MAKE_JOBS_SAFE=                no
 
-COMMENT=               The QT-Enhanced X11 version of NetHack
+COMMENT=               The QT-Enhanced X11+tty version of NetHack
 
 DEPENDS+=              
nethack-lib-${NETHACK_VERSION}{,nb*}:../../games/nethack-lib
 
 USE_LANGUAGES=         c c++
-BUILD_TARGET=          x11tiles nethack
+BUILD_TARGET=          nethack x11tiles
 INSTALL_TARGET=                binfiles
 MAKE_ENV+=             GTYPE=-qt
-CFLAGS+=               -DPREFIX="\"${PREFIX}\""
 
+DISTINFO_FILE?=                ${.CURDIR}/../nethack-lib/distinfo
+PATCHDIR=              ${.CURDIR}/../nethack-lib/patches
+
+SPECIAL_PERMS+=                ${PREFIX}/bin/nethack-qt                        
\
+                           ${GAMEPERM}
 post-install:
-       @${CP} -f ${WRKSRC}/dat/x11tiles ${WRKSRC}/dat/tiles.xpm
-       @${INSTALL_DATA} ${WRKSRC}/dat/tiles.xpm 
${DESTDIR}${PREFIX}/share/${NETHACK_DIR}
+       ${CP} -f ${WRKSRC}/dat/x11tiles ${WRKSRC}/dat/tiles.xpm
+       ${INSTALL_DATA} ${WRKSRC}/dat/tiles.xpm ${DESTDIR}${GAMEDIR}
+       ${INSTALL_DATA} ${WRKSRC}/win/Qt/nhsplash.xpm ${DESTDIR}${GAMEDIR}
+       ${INSTALL_DATA} ${WRKSRC}/win/Qt/knh-mini.xpm ${DESTDIR}${GAMEDIR}
+       ${INSTALL_DATA} ${WRKSRC}/win/Qt/knh.xpm ${DESTDIR}${GAMEDIR}
 
 .include "../../x11/libXpm/buildlink3.mk"
 .include "../../x11/qt3-libs/buildlink3.mk"
Index: nethack-qt/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-qt/PLIST,v
retrieving revision 1.2
diff -u -r1.2 PLIST
--- nethack-qt/PLIST    25 Mar 2002 20:32:27 -0000      1.2
+++ nethack-qt/PLIST    31 May 2011 19:28:14 -0000
@@ -1,3 +1,6 @@
 @comment $NetBSD: PLIST,v 1.2 2002/03/25 20:32:27 pooka Exp $
 bin/nethack-qt
 share/nethackdir340/tiles.xpm
+share/nethackdir340/nhsplash.xpm
+share/nethackdir340/knh.xpm
+share/nethackdir340/knh-mini.xpm
Index: nethack-tty/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-tty/Makefile,v
retrieving revision 1.19
diff -u -r1.19 Makefile
--- nethack-tty/Makefile        30 Jun 2009 00:07:16 -0000      1.19
+++ nethack-tty/Makefile        31 May 2011 19:24:47 -0000
@@ -4,7 +4,7 @@
 .include "../../games/nethack-lib/Makefile.common"
 
 PKGNAME=               nethack-tty-${NETHACK_VERSION}
-PKGREVISION=           1
+PKGREVISION=           2
 
 COMMENT=               The tty/console based version of NetHack
 
@@ -19,4 +19,7 @@
 DISTINFO_FILE?=                ${.CURDIR}/../nethack-lib/distinfo
 PATCHDIR=              ${.CURDIR}/../nethack-lib/patches
 
+SPECIAL_PERMS+=                ${PREFIX}/bin/nethack-tty                       
\
+                           ${GAMEPERM}
+
 .include "../../mk/bsd.pkg.mk"
Index: nethack-x11/MESSAGE
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-x11/MESSAGE,v
retrieving revision 1.4
diff -u -r1.4 MESSAGE
--- nethack-x11/MESSAGE 28 Sep 2005 12:41:40 -0000      1.4
+++ nethack-x11/MESSAGE 31 May 2011 19:26:22 -0000
@@ -3,10 +3,11 @@
 
 You can run the X11 NetHack by typing "nethack x11".
 
-A custom NetHack font was installed.  You must add
-${PREFIX}/lib/X11/fonts/misc to fontpath and set
+Two fonts were installed for NetHack.  You must add
+${PREFIX}/lib/X11/fonts/misc to fontpath and set one of
 
 NetHack*map*font: nh10
+NetHack*map*font: -misc-fixed-medium-r-normal-ibmpc-14-120-75-75-c-80-iso8859-1
 
 in ${PREFIX}/lib/X11/app-defaults/NetHack to use it.
 Tiled mode is enabled by:
@@ -15,4 +16,12 @@
 
 Also see ${PREFIX}/share/nethackdir340/nethack.x11.rc
 
+You may also want to set this environment variable, so NetHack can
+find its app-defaults file:
+
+XFILESEARCHPATH=%D:/usr/pkg/lib/X11/%T/%N%C:/usr/pkg/lib/X11/%T/%N
+
+To fall back to tty mode, use "NETHACKOPTIONS=windowtype:tty nethack"
+or set that option in your .nethackrc file.
+
 ===========================================================================
Index: nethack-x11/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-x11/Makefile,v
retrieving revision 1.37
diff -u -r1.37 Makefile
--- nethack-x11/Makefile        10 Nov 2008 17:21:35 -0000      1.37
+++ nethack-x11/Makefile        31 May 2011 19:26:22 -0000
@@ -4,15 +4,14 @@
 .include "../../games/nethack-lib/Makefile.common"
 
 PKGNAME=               nethack-x11-${NETHACK_VERSION}
-PKGREVISION=           3
-COMMENT=               The X11 version of NetHack
+PKGREVISION=           4
+COMMENT=               The X11+tty version of NetHack
 
 CATEGORIES+=           x11
 
 DEPENDS+=              
nethack-lib-${NETHACK_VERSION}{,nb*}:../../games/nethack-lib
 
-
-BUILD_TARGET=          x11tiles nethack
+BUILD_TARGET=          nethack x11tiles rip.xpm
 INSTALL_TARGET=                binfiles
 MAKE_ENV+=             GTYPE=-x11
 
@@ -20,13 +19,22 @@
 
 INSTALLATION_DIRS=     lib/X11/app-defaults lib/X11/fonts/misc
 
+DISTINFO_FILE?=                ${.CURDIR}/../nethack-lib/distinfo
+PATCHDIR=              ${.CURDIR}/../nethack-lib/patches
+
+SPECIAL_PERMS+=                ${PREFIX}/bin/nethack-x11                       
\
+                           ${GAMEPERM}
 post-install:
-       @${INSTALL_DATA} ${WRKSRC}/dat/x11tiles ${PREFIX}/share/${NETHACK_DIR}
-       @${INSTALL_DATA} ${WRKSRC}/win/X11/NetHack.ad \
-           ${PREFIX}/lib/X11/app-defaults/NetHack
-       @${INSTALL_DATA} ${WRKSRC}/win/X11/nh10.bdf ${PREFIX}/lib/X11/fonts/misc
-       @${INSTALL_DATA} ${WRKSRC}/win/X11/nethack.rc \
-           ${PREFIX}/share/${NETHACK_DIR}/nethack.x11.rc
+       ${INSTALL_DATA} ${WRKSRC}/dat/x11tiles \
+           ${DESTDIR}${GAMEDIR}
+       ${INSTALL_DATA} ${WRKSRC}/win/X11/NetHack.ad \
+           ${DESTDIR}${PREFIX}/lib/X11/app-defaults/NetHack
+       ${INSTALL_DATA} ${WRKSRC}/win/X11/nh10.bdf \
+           ${DESTDIR}${PREFIX}/lib/X11/fonts/misc
+       ${INSTALL_DATA} ${WRKSRC}/win/X11/ibm.bdf \
+           ${DESTDIR}${PREFIX}/lib/X11/fonts/misc
+       ${INSTALL_DATA} ${WRKSRC}/win/X11/nethack.rc \
+           ${DESTDIR}${GAMEDIR}/nethack.x11.rc
 
 .include "../../x11/libXaw/buildlink3.mk"
 .include "../../x11/libXpm/buildlink3.mk"
Index: nethack-x11/PLIST
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack-x11/PLIST,v
retrieving revision 1.3
diff -u -r1.3 PLIST
--- nethack-x11/PLIST   8 May 2005 10:17:30 -0000       1.3
+++ nethack-x11/PLIST   31 May 2011 19:26:22 -0000
@@ -1,6 +1,7 @@
 @comment $NetBSD: PLIST,v 1.3 2005/05/08 10:17:30 pooka Exp $
 bin/nethack-x11
-share/nethackdir340/x11tiles
-share/nethackdir340/nethack.x11.rc
 lib/X11/app-defaults/NetHack
+lib/X11/fonts/misc/ibm.bdf
 lib/X11/fonts/misc/nh10.bdf
+share/nethackdir340/nethack.x11.rc
+share/nethackdir340/x11tiles
Index: nethack/Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/games/nethack/Makefile,v
retrieving revision 1.25
diff -u -r1.25 Makefile
--- nethack/Makefile    8 Apr 2009 23:02:27 -0000       1.25
+++ nethack/Makefile    31 May 2011 19:15:57 -0000
@@ -1,6 +1,6 @@
 # $NetBSD: Makefile,v 1.25 2009/04/08 23:02:27 joerg Exp $
 
-META_PACKAGE=  # empty
+META_PACKAGE=  yes
 
 .include "../../games/nethack-lib/Makefile.common"
 

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#       nethack-lib/DESCR
#       nethack-lib/Makefile
#       nethack-lib/Makefile.common
#       nethack-lib/PLIST
#       nethack-lib/distinfo
#       nethack-lib/patches/patch-aa
#       nethack-lib/patches/patch-ab
#       nethack-lib/patches/patch-ac
#       nethack-lib/patches/patch-ad
#       nethack-lib/patches/patch-ae
#       nethack-lib/patches/patch-af
#       nethack-lib/patches/patch-ag
#       nethack-lib/patches/patch-ai
#       nethack-lib/patches/patch-sys_unix_Makefile.src
#       nethack-lib/patches/patch-sys_unix_Makefile.utl
#       nethack-qt/DESCR
#       nethack-qt/MESSAGE
#       nethack-qt/Makefile
#       nethack-qt/PLIST
#       nethack-tty/DESCR
#       nethack-tty/MESSAGE
#       nethack-tty/Makefile
#       nethack-tty/PLIST
#       nethack-x11/DESCR
#       nethack-x11/MESSAGE
#       nethack-x11/Makefile
#       nethack-x11/PLIST
#       nethack/DESCR
#       nethack/MESSAGE
#       nethack/Makefile
#
echo x - nethack-lib/DESCR
sed 's/^X//' >nethack-lib/DESCR << 'END-of-nethack-lib/DESCR'
XNethack is a single player, ASCII graphics-based adventure game, similar
Xto the lines of Dungeons & Dragons and similar fantasy games. It is
Xcommonly classified in the larger group of Rogue-like Games, which
Xgenerally are all text-based, solo adventures.
X
XWithin the game, your character is after the infamous Wizard of Yendor,
Xwho has stolen the Amulet of Yendor and plans to use it for his evil
Xpurposes. You, a young member of your chosen class, have been blessed by
Xyour people and your god to retrieve the Amulet, and to save the world
Xfrom the Wizard's evil plans.
END-of-nethack-lib/DESCR
echo x - nethack-lib/Makefile
sed 's/^X//' >nethack-lib/Makefile << 'END-of-nethack-lib/Makefile'
X# $NetBSD: Makefile,v 1.26 2008/09/25 14:02:09 wiz Exp $
X#
X
X.include               "../../games/nethack-lib/Makefile.common"
X
XPKGNAME=               nethack-lib-${NETHACK_VERSION}
XPKGREVISION=           3
X
XCOMMENT=               Data files for Nethack
X
XHAS_CONFIGURE=         yes
XCONFIGURE_SCRIPT=      ./sys/unix/setup.sh
XBUILD_TARGET=          datastuff
XINSTALL_TARGET=                manpages install-dat
XINSTALLATION_DIRS=     ${PKGMANDIR}/man6
X
X# Special handling for the scorefiles: we do not want to delete
X# them between package installations and deinstallations.
X#
X# These should eventually migrate to a better location, but keep them
X# here for now until we lose backward compatibility because of changes
X# to the fileformat.
XCONF_FILES_PERMS+=     /dev/null ${VARDIR}/logfile \
X                       ${NETHACK_USER} ${NETHACK_GROUP} 664
XCONF_FILES_PERMS+=     /dev/null ${VARDIR}/perm \
X                       ${NETHACK_USER} ${NETHACK_GROUP} 664
XCONF_FILES_PERMS+=     /dev/null ${VARDIR}/record \
X                       ${NETHACK_USER} ${NETHACK_GROUP} 664
X
XREQD_DIRS_PERMS+=      ${VARDIR}                                       \
X                       ${NETHACK_USER} ${NETHACK_GROUP} 775
XREQD_DIRS_PERMS+=      ${VARDIR}/save                                  \
X                       ${NETHACK_USER} ${NETHACK_GROUP} 770
X
XCHECK_FILES_SKIP+=     ${VARDIR}/logfile                               \
X                       ${VARDIR}/perm                                  \
X                       ${VARDIR}/record
X
X.include "../../mk/bsd.pkg.mk"
END-of-nethack-lib/Makefile
echo x - nethack-lib/Makefile.common
sed 's/^X//' >nethack-lib/Makefile.common << 
'END-of-nethack-lib/Makefile.common'
X# $NetBSD: Makefile.common,v 1.26 2009/08/04 13:58:57 joerg Exp $
X#
X# used by games/nethack/Makefile
X# used by games/nethack-lib/Makefile
X# used by games/nethack-x11/Makefile
X# used by games/nethack-tty/Makefile
X# used by games/nethack-qt/Makefile
X
XNETHACK_BASEVER=       3.4.3
XNETHACK_VERSION=       ${NETHACK_BASEVER}
XNETHACK_DISTVER=       ${NETHACK_BASEVER:S/.//g}
XNETHACK_DIR=           nethackdir340
X
XDISTNAME=              nethack-${NETHACK_DISTVER}-src
XCATEGORIES=            games
XMASTER_SITES=          ftp://ftp.sourceforge.net/pub/sourceforge/n/ne/nethack/
XEXTRACT_SUFX=          .tgz
X
XMAINTAINER=            pooka%NetBSD.org@localhost
XHOMEPAGE=              http://www.nethack.org/
XLICENSE=               nethack-license
X
XMAKE_JOBS_SAFE=                no
XPKG_DESTDIR_SUPPORT=   user-destdir
X
X.if !defined(META_PACKAGE)
X
XWRKSRC=                        ${WRKDIR}/nethack-${NETHACK_BASEVER}
XHAS_CONFIGURE=         yes
XCONFIGURE_SCRIPT=      ./sys/unix/setup.sh
XUSE_TOOLS+=            gzip yacc lex awk
X
X.include "../../mk/bsd.prefs.mk"
X
X.if ${OPSYS} == "Darwin" || ${OPSYS} == "Linux"
XSUBST_CLASSES+=                ttylib
XSUBST_MESSAGE.ttylib=  Configuring to use ncurses
XSUBST_STAGE.ttylib=    post-patch
XSUBST_FILES.ttylib=    sys/unix/Makefile.src
XSUBST_SED.ttylib=      -e 's,^WINTTYLIB = -ltermlib,WINTTYLIB = -lncurses,'
X.endif
X.include "../../mk/curses.buildlink3.mk"
X
X.if ${OPSYS} == "Linux"
XNETHACK_OS=            SYSV
X.endif
XNETHACK_OS?=           BSD
X
XSUBST_CLASSES+=                os
XSUBST_MESSAGE.os=      Configuring for ${NETHACK_OS}
XSUBST_STAGE.os=                post-patch
XSUBST_FILES.os=                include/unixconf.h
XSUBST_SED.os=          -e 's,__NETHACK_OS__,${NETHACK_OS},'
X
XUSE_GAMESGROUP=                yes
XNETHACK_USER=          ${GAMES_USER}
XNETHACK_GROUP=         ${GAMES_GROUP}
XBUILD_DEFS+=           GAMES_USER GAMES_GROUP
XGAMEPERM=              ${NETHACK_USER} ${NETHACK_GROUP} 2555
X
XGAMEDIR=               ${PREFIX}/share/${NETHACK_DIR}
XVARDIR=                        /var/games/nethack340
XMAKE_ENV+=             GAMEDIR=${GAMEDIR:Q}
XMAKE_ENV+=             VARDIR=${VARDIR:Q}
X
Xpre-configure:
X       @${CHMOD} 755 ${WRKSRC}/sys/unix/setup.sh
X
Xpost-patch:
X       @${MV} ${WRKSRC}/include/config.h ${WRKSRC}/config.h-pre
X       @${SED} -e 's|@PREFIX@|${PREFIX}|g'                             \
X               -e 's|@GZIP_PROGRAM@|'`${ECHO} ${GZIP_CMD}              \
X               | ${AWK} '{ print $$1 }'`'|g'                           \
X               < ${WRKSRC}/config.h-pre > ${WRKSRC}/include/config.h
X       @${RM} -f ${WRKSRC}/config.h-pre
X
X.endif # !NO_BUILD
END-of-nethack-lib/Makefile.common
echo x - nethack-lib/PLIST
sed 's/^X//' >nethack-lib/PLIST << 'END-of-nethack-lib/PLIST'
X@comment $NetBSD: PLIST,v 1.7 2009/06/14 17:56:52 joerg Exp $
Xbin/nethack
Xbin/recover
Xman/man6/dgn_comp.6
Xman/man6/dlb.6
Xman/man6/lev_comp.6
Xman/man6/nethack.6
Xman/man6/recover.6
Xshare/doc/nethack/Guidebook
Xshare/nethackdir340/Arc-fila.lev
Xshare/nethackdir340/Arc-filb.lev
Xshare/nethackdir340/Arc-goal.lev
Xshare/nethackdir340/Arc-loca.lev
Xshare/nethackdir340/Arc-strt.lev
Xshare/nethackdir340/Bar-fila.lev
Xshare/nethackdir340/Bar-filb.lev
Xshare/nethackdir340/Bar-goal.lev
Xshare/nethackdir340/Bar-loca.lev
Xshare/nethackdir340/Bar-strt.lev
Xshare/nethackdir340/Cav-fila.lev
Xshare/nethackdir340/Cav-filb.lev
Xshare/nethackdir340/Cav-goal.lev
Xshare/nethackdir340/Cav-loca.lev
Xshare/nethackdir340/Cav-strt.lev
Xshare/nethackdir340/Hea-fila.lev
Xshare/nethackdir340/Hea-filb.lev
Xshare/nethackdir340/Hea-goal.lev
Xshare/nethackdir340/Hea-loca.lev
Xshare/nethackdir340/Hea-strt.lev
Xshare/nethackdir340/Kni-fila.lev
Xshare/nethackdir340/Kni-filb.lev
Xshare/nethackdir340/Kni-goal.lev
Xshare/nethackdir340/Kni-loca.lev
Xshare/nethackdir340/Kni-strt.lev
Xshare/nethackdir340/Mon-fila.lev
Xshare/nethackdir340/Mon-filb.lev
Xshare/nethackdir340/Mon-goal.lev
Xshare/nethackdir340/Mon-loca.lev
Xshare/nethackdir340/Mon-strt.lev
Xshare/nethackdir340/Pri-fila.lev
Xshare/nethackdir340/Pri-filb.lev
Xshare/nethackdir340/Pri-goal.lev
Xshare/nethackdir340/Pri-loca.lev
Xshare/nethackdir340/Pri-strt.lev
Xshare/nethackdir340/Ran-fila.lev
Xshare/nethackdir340/Ran-filb.lev
Xshare/nethackdir340/Ran-goal.lev
Xshare/nethackdir340/Ran-loca.lev
Xshare/nethackdir340/Ran-strt.lev
Xshare/nethackdir340/Rog-fila.lev
Xshare/nethackdir340/Rog-filb.lev
Xshare/nethackdir340/Rog-goal.lev
Xshare/nethackdir340/Rog-loca.lev
Xshare/nethackdir340/Rog-strt.lev
Xshare/nethackdir340/Sam-fila.lev
Xshare/nethackdir340/Sam-filb.lev
Xshare/nethackdir340/Sam-goal.lev
Xshare/nethackdir340/Sam-loca.lev
Xshare/nethackdir340/Sam-strt.lev
Xshare/nethackdir340/Tou-fila.lev
Xshare/nethackdir340/Tou-filb.lev
Xshare/nethackdir340/Tou-goal.lev
Xshare/nethackdir340/Tou-loca.lev
Xshare/nethackdir340/Tou-strt.lev
Xshare/nethackdir340/Val-fila.lev
Xshare/nethackdir340/Val-filb.lev
Xshare/nethackdir340/Val-goal.lev
Xshare/nethackdir340/Val-loca.lev
Xshare/nethackdir340/Val-strt.lev
Xshare/nethackdir340/Wiz-fila.lev
Xshare/nethackdir340/Wiz-filb.lev
Xshare/nethackdir340/Wiz-goal.lev
Xshare/nethackdir340/Wiz-loca.lev
Xshare/nethackdir340/Wiz-strt.lev
Xshare/nethackdir340/air.lev
Xshare/nethackdir340/asmodeus.lev
Xshare/nethackdir340/astral.lev
Xshare/nethackdir340/baalz.lev
Xshare/nethackdir340/bigrm-1.lev
Xshare/nethackdir340/bigrm-2.lev
Xshare/nethackdir340/bigrm-3.lev
Xshare/nethackdir340/bigrm-4.lev
Xshare/nethackdir340/bigrm-5.lev
Xshare/nethackdir340/castle.lev
Xshare/nethackdir340/cmdhelp
Xshare/nethackdir340/data
Xshare/nethackdir340/dungeon
Xshare/nethackdir340/earth.lev
Xshare/nethackdir340/fakewiz1.lev
Xshare/nethackdir340/fakewiz2.lev
Xshare/nethackdir340/fire.lev
Xshare/nethackdir340/help
Xshare/nethackdir340/hh
Xshare/nethackdir340/history
Xshare/nethackdir340/juiblex.lev
Xshare/nethackdir340/knox.lev
Xshare/nethackdir340/license
Xshare/nethackdir340/medusa-1.lev
Xshare/nethackdir340/medusa-2.lev
Xshare/nethackdir340/minefill.lev
Xshare/nethackdir340/minend-1.lev
Xshare/nethackdir340/minend-2.lev
Xshare/nethackdir340/minend-3.lev
Xshare/nethackdir340/minetn-1.lev
Xshare/nethackdir340/minetn-2.lev
Xshare/nethackdir340/minetn-3.lev
Xshare/nethackdir340/minetn-4.lev
Xshare/nethackdir340/minetn-5.lev
Xshare/nethackdir340/minetn-6.lev
Xshare/nethackdir340/minetn-7.lev
Xshare/nethackdir340/opthelp
Xshare/nethackdir340/options
Xshare/nethackdir340/oracle.lev
Xshare/nethackdir340/oracles
Xshare/nethackdir340/orcus.lev
Xshare/nethackdir340/pet_mark.xbm
Xshare/nethackdir340/quest.dat
Xshare/nethackdir340/rip.xpm
Xshare/nethackdir340/rumors
Xshare/nethackdir340/sanctum.lev
Xshare/nethackdir340/soko1-1.lev
Xshare/nethackdir340/soko1-2.lev
Xshare/nethackdir340/soko2-1.lev
Xshare/nethackdir340/soko2-2.lev
Xshare/nethackdir340/soko3-1.lev
Xshare/nethackdir340/soko3-2.lev
Xshare/nethackdir340/soko4-1.lev
Xshare/nethackdir340/soko4-2.lev
Xshare/nethackdir340/tower1.lev
Xshare/nethackdir340/tower2.lev
Xshare/nethackdir340/tower3.lev
Xshare/nethackdir340/valley.lev
Xshare/nethackdir340/water.lev
Xshare/nethackdir340/wizard1.lev
Xshare/nethackdir340/wizard2.lev
Xshare/nethackdir340/wizard3.lev
Xshare/nethackdir340/wizhelp
END-of-nethack-lib/PLIST
echo x - nethack-lib/distinfo
sed 's/^X//' >nethack-lib/distinfo << 'END-of-nethack-lib/distinfo'
X$NetBSD: distinfo,v 1.16 2008/05/20 19:47:16 tnn Exp $
X
XSHA1 (nethack-343-src.tgz) = c26537093c38152bc0fbcec20468d975b35f59fd
XRMD160 (nethack-343-src.tgz) = 42f600d24715a0b7e631b357c135761410b3ca95
XSize (nethack-343-src.tgz) = 3497458 bytes
XSHA1 (patch-aa) = e3e420b901a91e773384a995912e0ecc6bd6e87f
XSHA1 (patch-ab) = 49947b960f2b7871fc798398d1c1ceab8d462ec9
XSHA1 (patch-ac) = 50cac811281c629edf2a72e523b62b51f8c3c840
XSHA1 (patch-ad) = be56ef8459f3273a0b316bb94e0ae7397a53c37f
XSHA1 (patch-ae) = 8530c1e033f2522e05b699db36d84f77ecf886be
XSHA1 (patch-af) = a567c4c664f135ad24f3f0069ddc29bf5b950b21
XSHA1 (patch-ag) = 5bf322fb92a3cd9df9559e56265f0477d9e92487
XSHA1 (patch-ai) = 73c5b2ea1227531089474705f2f18bc411366365
XSHA1 (patch-sys_unix_Makefile.src) = 003f16fba997ac61efc92adecc13b883135a86bc
XSHA1 (patch-sys_unix_Makefile.utl) = 409e1f8b58c7e2709d224f42c19fdfd162d9cea7
END-of-nethack-lib/distinfo
echo x - nethack-lib/patches/patch-aa
sed 's/^X//' >nethack-lib/patches/patch-aa << 
'END-of-nethack-lib/patches/patch-aa'
X$NetBSD: patch-aa,v 1.9 2004/03/05 15:21:01 pooka Exp $
X
XMake configurable.
X
X--- include/config.h.orig      2003-12-07 23:39:13.000000000 +0000
X+++ include/config.h
X@@ -42,6 +42,16 @@
X  * Define all of those you want supported in your binary.
X  * Some combinations make no sense.  See the installation document.
X  */
X+#if   defined(GTYPE_TTY)
X+#  define DEFAULT_WINDOW_SYS "tty"
X+#elif defined(GTYPE_X11)
X+#  define X11_GRAPHICS
X+#  define DEFAULT_WINDOW_SYS "x11"
X+#elif defined(GTYPE_QT)
X+#  define QT_GRAPHICS
X+#  define DEFAULT_WINDOW_SYS "Qt"
X+#endif
X+
X #define TTY_GRAPHICS  /* good old tty based graphics */
X /* #define X11_GRAPHICS */    /* X11 interface */
X /* #define QT_GRAPHICS */     /* Qt interface */
X@@ -86,7 +96,7 @@
X # define DEFAULT_WC_TILED_MAP   /* Default to tiles if users doesn't say 
wc_ascii_map */
X # define USER_SOUNDS          /* Use sounds */
X # ifndef __APPLE__
X-#  define USER_SOUNDS_REGEX
X+/*#  define USER_SOUNDS_REGEX */
X # endif
X # define USE_XPM              /* Use XPM format for images (required) */
X # define GRAPHIC_TOMBSTONE    /* Use graphical tombstone (rip.ppm) */
X@@ -126,7 +136,7 @@
X  * would allow:
X  *  xpmtoppm <x11tiles.xpm | pnmscale 1.25 | ppmquant 90 >x11tiles_big.xpm
X  */
X-/* # define USE_XPM */                /* Disable if you do not have the XPM 
library */
X+# define USE_XPM              /* Disable if you do not have the XPM library */
X # ifdef USE_XPM
X #  define GRAPHIC_TOMBSTONE   /* Use graphical tombstone (rip.xpm) */
X # endif
X@@ -169,11 +179,11 @@
X 
X #ifdef UNIX
X /* path and file name extension for compression program */
X-#define COMPRESS "/usr/bin/compress"  /* Lempel-Ziv compression */
X-#define COMPRESS_EXTENSION ".Z"               /* compress's extension */
X+/* #define COMPRESS "/usr/bin/compress"*/     /* Lempel-Ziv compression */
X+/* #define COMPRESS_EXTENSION ".Z"*/          /* compress's extension */
X /* An example of one alternative you might want to use: */
X-/* #define COMPRESS "/usr/local/bin/gzip" */  /* FSF gzip compression */
X-/* #define COMPRESS_EXTENSION ".gz" */                /* normal gzip 
extension */
X+#define COMPRESS "/usr/bin/gzip"              /* FSF gzip compression */
X+#define COMPRESS_EXTENSION ".gz"              /* normal gzip extension */
X #endif
X 
X #ifndef COMPRESS
X@@ -204,7 +214,7 @@
X  * otherwise it will be the current directory.
X  */
X # ifndef HACKDIR
X-#  define HACKDIR "/usr/games/lib/nethackdir"
X+#  define HACKDIR "/usr/pkg/share/nethackdir340"
X # endif
X 
X /*
X@@ -300,7 +310,7 @@ typedef unsigned char      uchar;
X  * functions that have been macroized.
X  */
X 
X-/* #define VISION_TABLES */ /* use vision tables generated at compile time */
X+#define VISION_TABLES /* use vision tables generated at compile time */
X #ifndef VISION_TABLES
X # ifndef NO_MACRO_CPATH
X #  define MACRO_CPATH /* use clear_path macros instead of functions */
END-of-nethack-lib/patches/patch-aa
echo x - nethack-lib/patches/patch-ab
sed 's/^X//' >nethack-lib/patches/patch-ab << 
'END-of-nethack-lib/patches/patch-ab'
X$NetBSD: patch-ab,v 1.11 2004/03/05 15:21:01 pooka Exp $
X
XMake configurable.
X
X--- sys/unix/Makefile.top.orig 2003-12-07 23:39:13.000000000 +0000
X+++ sys/unix/Makefile.top
X@@ -14,18 +14,18 @@
X # MAKE = make
X 
X # make NetHack
X-PREFIX         = /usr
X GAME     = nethack
X # GAME     = nethack.prg
X-GAMEUID  = games
X-GAMEGRP  = bin
X+GAMEUID  = root
X+GAMEGRP  = games
X 
X # Permissions - some places use setgid instead of setuid, for instance
X # See also the option "SECURE" in include/config.h
X-GAMEPERM = 04755
X+GAMEPERM = 2755
X FILEPERM = 0644
X+VARFILEPERM = 0664
X EXEPERM  = 0755
X-DIRPERM  = 0755
X+DIRPERM  = 0775
X 
X # GAMEDIR also appears in config.h as "HACKDIR".
X # VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else GAMEDIR
X@@ -35,12 +35,12 @@ DIRPERM  = 0755
X # therefore there should not be anything in GAMEDIR that you want to keep
X # (if there is, you'll have to do the installation by hand or modify the
X # instructions)
X-GAMEDIR  = $(PREFIX)/games/lib/$(GAME)dir
X-VARDIR  = $(GAMEDIR)
X-SHELLDIR = $(PREFIX)/games
X+GAMEDIR  ?= $(PREFIX)/share/$(GAME)dir340
X+VARDIR  ?= /var/games/nethack340
X+SHELLDIR = $(PREFIX)/bin
X 
X # per discussion in Install.X11 and Install.Qt
X-VARDATND = 
X+VARDATND =  pet_mark.xbm rip.xpm
X # VARDATND = x11tiles NetHack.ad pet_mark.xbm
X # VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm
X # for Atari/Gem
X@@ -64,8 +64,8 @@ VARDAT = $(VARDATD) $(VARDATND)
X # other permission-related reasons.  If that happens, you may want to set the
X # command to "true", which is a no-op. Note that disabling chown or chgrp
X # will only work if setuid (or setgid) behavior is not desired or required.
X-CHOWN = chown
X-CHGRP = chgrp
X+CHOWN = : # chown
X+CHGRP = : # chgrp
X 
X #
X # end of configuration
X@@ -87,9 +87,12 @@ DAT = $(DATNODLB) $(DATDLB)
X $(GAME):
X       ( cd src ; $(MAKE) )
X 
X-all:  $(GAME) recover Guidebook $(VARDAT) dungeon spec_levs check-dlb
X+all:  $(GAME) datastuff
X       @echo "Done."
X 
X+datastuff: recover Guidebook $(VARDAT) dungeon spec_levs check-dlb
X+      @echo "Data Sets Built."
X+
X # Note: many of the dependencies below are here to allow parallel make
X # to generate valid output
X 
X@@ -99,20 +102,20 @@ Guidebook:
X manpages:
X       ( cd doc ; $(MAKE) manpages )
X 
X-data: $(GAME)
X+data: # $(GAME)
X       ( cd dat ; $(MAKE) data )
X 
X-rumors: $(GAME)
X+rumors: # $(GAME)
X       ( cd dat ; $(MAKE) rumors )
X 
X-oracles: $(GAME)
X+oracles: # $(GAME)
X       ( cd dat ; $(MAKE) oracles )
X 
X #     Note: options should have already been made with make, but...
X-options: $(GAME)
X+options: # $(GAME)
X       ( cd dat ; $(MAKE) options )
X 
X-quest.dat: $(GAME)
X+quest.dat: # $(GAME)
X       ( cd dat ; $(MAKE) quest.dat )
X 
X spec_levs: dungeon
X@@ -120,22 +123,22 @@ spec_levs: dungeon
X       ( cd dat ; $(MAKE) spec_levs )
X       ( cd dat ; $(MAKE) quest_levs )
X 
X-dungeon: $(GAME)
X+dungeon: # $(GAME)
X       ( cd util ; $(MAKE) dgn_comp )
X       ( cd dat ; $(MAKE) dungeon )
X 
X-nhtiles.bmp: $(GAME)
X+nhtiles.bmp: # $(GAME)
X       ( cd dat ; $(MAKE) nhtiles.bmp )
X 
X-x11tiles: $(GAME)
X+x11tiles: # $(GAME)
X       ( cd util ; $(MAKE) tile2x11 )
X       ( cd dat ; $(MAKE) x11tiles )
X 
X-beostiles: $(GAME)
X+beostiles: # $(GAME)
X       ( cd util ; $(MAKE) tile2beos )
X       ( cd dat ; $(MAKE) beostiles )
X 
X-NetHack.ad: $(GAME)
X+NetHack.ad: # $(GAME)
X       ( cd dat ; $(MAKE) NetHack.ad )
X 
X pet_mark.xbm:
X@@ -150,7 +153,7 @@ mapbg.xpm:
X nhsplash.xpm:
X       ( cd dat ; $(MAKE) nhsplash.xpm )
X 
X-nh16.img: $(GAME)
X+nh16.img: # $(GAME)
X       ( cd util ; $(MAKE) tile2img.ttp )
X       ( cd dat ; $(MAKE) nh16.img )
X 
X@@ -172,7 +175,7 @@ dlb:
X 
X # recover can be used when INSURANCE is defined in include/config.h
X # and the checkpoint option is true
X-recover: $(GAME)
X+recover: # $(GAME)
X       ( cd util ; $(MAKE) recover )
X 
X dofiles:
X@@ -183,34 +186,31 @@ dofiles:
X               -e '}'                                  \
X               -e '$$s/.*/nodlb/p' < dat/options` ;    \
X       $(MAKE) dofiles-$${target-nodlb}
X-      cp src/$(GAME) $(GAMEDIR)
X-      cp util/recover $(GAMEDIR)
X-      -rm -f $(SHELLDIR)/$(GAME)
X-      sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \
X+      cp util/recover $(DESTDIR)$(PREFIX)/bin
X+      -rm -f $(DESTDIR)$(SHELLDIR)/$(GAME)
X+      sed -e 's;@GAMEDIR@;$(GAMEDIR);' \
X               -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \
X+              -e 's;@PREFIX@;$(PREFIX);' \
X               < sys/unix/nethack.sh \
X-              > $(SHELLDIR)/$(GAME)
X+              > $(DESTDIR)$(SHELLDIR)/$(GAME)
X # set up their permissions
X-      -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \
X-                      $(CHGRP) $(GAMEGRP) $(GAME) recover )
X-      chmod $(GAMEPERM) $(GAMEDIR)/$(GAME)
X-      chmod $(EXEPERM) $(GAMEDIR)/recover
X-      -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME)
X-      $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME)
X-      chmod $(EXEPERM) $(SHELLDIR)/$(GAME)
X+      chmod $(EXEPERM) $(DESTDIR)$(PREFIX)/bin/recover
X+      -$(CHOWN) $(GAMEUID) $(DESTDIR)$(SHELLDIR)/$(GAME)
X+      $(CHGRP) $(GAMEGRP) $(DESTDIR)$(SHELLDIR)/$(GAME)
X+      chmod $(EXEPERM) $(DESTDIR)$(SHELLDIR)/$(GAME)
X 
X dofiles-dlb: check-dlb
X-      ( cd dat ; cp nhdat $(DATNODLB) $(GAMEDIR) )
X+      ( cd dat ; cp nhdat $(DATNODLB) $(DESTDIR)$(GAMEDIR) )
X # set up their permissions
X-      -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \
X+      -( cd $(DESTDIR)$(GAMEDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \
X                       $(CHGRP) $(GAMEGRP) nhdat $(DATNODLB) ; \
X                       chmod $(FILEPERM) nhdat $(DATNODLB) )
X 
X dofiles-nodlb:
X # copy over the game files
X-      ( cd dat ; cp $(DAT) $(GAMEDIR) )
X+      ( cd dat ; cp $(DAT) $(DESTDIR)$(GAMEDIR) )
X # set up their permissions
X-      -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \
X+      -( cd $(DESTDIR)$(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \
X                       $(CHGRP) $(GAMEGRP) $(DAT) ; \
X                       chmod $(FILEPERM) $(DAT) )
X 
X@@ -230,26 +230,39 @@ update: $(GAME) recover $(VARDAT) dungeo
X # and a reminder
X       @echo You may also want to install the man pages via the doc Makefile.
X 
X-install: $(GAME) recover $(VARDAT) dungeon spec_levs
X+install-dat: recover $(VARDAT) dungeon spec_levs
X # set up the directories
X # not all mkdirs have -p; those that don't will create a -p directory
X-      -mkdir -p $(SHELLDIR)
X-      -rm -rf $(GAMEDIR) $(VARDIR)
X-      -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save
X+      -mkdir -p $(DESTDIR)$(SHELLDIR)
X+      -mkdir -p $(DESTDIR)$(GAMEDIR) $(DESTDIR)$(VARDIR) 
$(DESTDIR)$(VARDIR)/save
X       -rmdir ./-p
X-      -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
X-      $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
X-      chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save
X+      -$(CHOWN) $(GAMEUID) $(DESTDIR)$(GAMEDIR) $(DESTDIR)$(VARDIR) 
$(DESTDIR)$(VARDIR)/save
X+      $(CHGRP) $(DESTDIR)$(GAMEGRP) $(DESTDIR)$(GAMEDIR) $(DESTDIR)$(VARDIR) 
$(DESTDIR)$(VARDIR)/save
X+      chmod $(DIRPERM) $(DESTDIR)$(GAMEDIR) $(DESTDIR)$(VARDIR)
X+      chmod 770 $(DESTDIR)$(VARDIR)/save
X # set up the game files
X       ( $(MAKE) dofiles )
X # set up some additional files
X-      touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile
X-      -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
X+      touch $(DESTDIR)$(VARDIR)/perm $(DESTDIR)$(VARDIR)/record 
$(DESTDIR)$(VARDIR)/logfile
X+      -( cd $(DESTDIR)$(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
X                       $(CHGRP) $(GAMEGRP) perm record logfile ; \
X-                      chmod $(FILEPERM) perm record logfile )
X+                      chmod $(VARFILEPERM) perm record logfile )
X+      -touch -c $(DESTDIR)$(VARDIR)/bones* $(DESTDIR)$(VARDIR)/?lock* 
$(DESTDIR)$(VARDIR)/wizard*
X+      -touch -c $(DESTDIR)$(VARDIR)/save/*
X+      -mkdir -p $(DESTDIR)$(PREFIX)/share/doc/nethack
X+      cp doc/Guidebook $(DESTDIR)$(PREFIX)/share/doc/nethack
X+      $(CHOWN) $(GAMEUID):$(GAMEGRP) 
$(DESTDIR)$(PREFIX)/share/doc/nethack/Guidebook
X+      chmod $(FILEPERM) $(DESTDIR)$(PREFIX)/share/doc/nethack/Guidebook
X # and a reminder
X       @echo You may also want to reinstall the man pages via the doc Makefile.
X 
X+binfiles: $(GAME)
X+      mkdir -p $(DESTDIR)$(SHELLDIR)
X+      mkdir -p $(DESTDIR)$(GAMEDIR)
X+      cp src/$(GAME) $(DESTDIR)$(SHELLDIR)/$(GAME)$(GTYPE)
X+      -( cd $(DESTDIR)$(GAMEDIR) ; $(CHOWN) $(GAMEUID) 
$(DESTDIR)$(SHELLDIR)/$(GAME)$(GTYPE) ; \
X+              $(CHGRP) $(GAMEGRP) $(DESTDIR)$(SHELLDIR)/$(GAME)$(GTYPE) )
X+       #chmod $(GAMEPERM) $(DESTDIR)$(SHELLDIR)/$(GAME)$(GTYPE)
X 
X # 'make clean' removes all the .o files, but leaves around all the executables
X # and compiled data files
END-of-nethack-lib/patches/patch-ab
echo x - nethack-lib/patches/patch-ac
sed 's/^X//' >nethack-lib/patches/patch-ac << 
'END-of-nethack-lib/patches/patch-ac'
X$NetBSD: patch-ac,v 1.9 2006/06/19 17:07:45 minskim Exp $
X
XFix for NetBSD.
X
X--- include/system.h.orig      2003-12-07 15:39:13.000000000 -0800
X+++ include/system.h
X@@ -79,10 +79,10 @@ typedef long       off_t;
X # if !defined(__SC__) && !defined(LINUX)
X E  long NDECL(random);
X # endif
X-# if (!defined(SUNOS4) && !defined(bsdi) && !defined(__FreeBSD__)) || 
defined(RANDOM)
X+# if (!defined(SUNOS4) && !defined(bsdi) && !defined(__NetBSD__) && 
!defined(__FreeBSD__) && !defined(__DragonFly__) && !defined(__APPLE__)) || 
defined(RANDOM)
X E void FDECL(srandom, (unsigned int));
X # else
X-#  if !defined(bsdi) && !defined(__FreeBSD__)
X+#  if !defined(bsdi) && !defined(__NetBSD__) && !defined(__FreeBSD__) && 
!defined(__DragonFly__) && !defined(__APPLE__)
X E int FDECL(srandom, (unsigned int));
X #  endif
X # endif
X@@ -132,7 +132,7 @@ E void FDECL(perror, (const char *));
X E void FDECL(qsort, (genericptr_t,size_t,size_t,
X                    int(*)(const genericptr,const genericptr)));
X #else
X-# if defined(BSD) || defined(ULTRIX)
X+# if defined(BSD) || defined(ULTRIX) && !defined(__NetBSD__)
X E  int qsort();
X # else
X #  if !defined(LATTICE) && !defined(AZTEC_50)
X@@ -421,7 +421,7 @@ E size_t FDECL(strlen, (const char *));
X # ifdef HPUX
X E unsigned int        FDECL(strlen, (char *));
X #  else
X-#   if !(defined(ULTRIX_PROTO) && defined(__GNUC__))
X+#   if !(defined(ULTRIX_PROTO) && defined(__GNUC__)) && !defined(__NetBSD__)
X E int FDECL(strlen, (const char *));
X #   endif
X #  endif /* HPUX */
X@@ -521,7 +521,7 @@ E struct tm *FDECL(localtime, (const tim
X #  endif
X # endif
X 
X-# if defined(ULTRIX) || (defined(BSD) && defined(POSIX_TYPES)) || 
defined(SYSV) || defined(MICRO) || defined(VMS) || defined(MAC) || 
(defined(HPUX) && defined(_POSIX_SOURCE))
X+# if defined(ULTRIX) || (defined(BSD) && defined(POSIX_TYPES)) || 
defined(SYSV) || defined(MICRO) || defined(VMS) || defined(MAC) || 
(defined(HPUX) && defined(_POSIX_SOURCE)) || defined(__NetBSD__)
X E time_t FDECL(time, (time_t *));
X # else
X E long FDECL(time, (time_t *));
END-of-nethack-lib/patches/patch-ac
echo x - nethack-lib/patches/patch-ad
sed 's/^X//' >nethack-lib/patches/patch-ad << 
'END-of-nethack-lib/patches/patch-ad'
X$NetBSD: patch-ad,v 1.7 2007/10/27 18:26:34 pooka Exp $
X
XMake configurable.
X
X--- sys/unix/nethack.sh.orig   2003-12-07 23:39:13.000000000 +0000
X+++ sys/unix/nethack.sh
X@@ -1,9 +1,31 @@
X #!/bin/sh
X #     SCCS Id: @(#)nethack.sh 3.4     1990/02/26
X 
X-HACKDIR=/usr/games/lib/nethackdir
X+UILIST="tty x11 qt" 
X+findbin ()
X+{
X+      for x in $UILIST; do
X+              if [ -x @PREFIX@/bin/nethack-$x ]; then
X+                      echo $x
X+                      return
X+              fi
X+      done
X+}
X+
X+if [ -z "$1" -o -z "${1%%-*}" ]; then
X+      TTY=`findbin`
X+else
X+      TTY=$1
X+fi
X+
X+if [ -z "$TTY" ]; then
X+      echo "No UI ($UILIST) found"
X+      exit 1
X+fi
X+
X+HACKDIR=@GAMEDIR@
X export HACKDIR
X-HACK=$HACKDIR/nethack
X+HACK=@PREFIX@/bin/nethack-$TTY
X MAXNROFPLAYERS=4
X 
X # Since Nethack.ad is installed in HACKDIR, add it to XUSERFILESEARCHPATH
END-of-nethack-lib/patches/patch-ad
echo x - nethack-lib/patches/patch-ae
sed 's/^X//' >nethack-lib/patches/patch-ae << 
'END-of-nethack-lib/patches/patch-ae'
X$NetBSD: patch-ae,v 1.5 2008/05/20 19:47:16 tnn Exp $
X
XMake configurable.
X
X--- sys/unix/Makefile.doc.orig 2003-12-07 23:39:13.000000000 +0000
X+++ sys/unix/Makefile.doc
X@@ -41,7 +41,7 @@ Guidebook.dvi:       Guidebook.tex
X 
X 
X GAME  = nethack
X-MANDIR        = /usr/man/man6
X+MANDIR        = $(PREFIX)/$(PKGMANDIR)/man6
X MANEXT        = 6
X 
X # manual installation for most BSD-style systems
X@@ -58,11 +58,11 @@ DLBMANCREATE = cp dlb.6
X # DLBMANCREATE = nroff -man dlb.6 >
X 
X manpages:
X-      -$(GAMEMANCREATE) $(MANDIR)/$(GAME).$(MANEXT)
X-      -$(LEVMANCREATE) $(MANDIR)/lev_comp.$(MANEXT)
X-      -$(DGNMANCREATE) $(MANDIR)/dgn_comp.$(MANEXT)
X-      -$(RCVRMANCREATE) $(MANDIR)/recover.$(MANEXT)
X-      -$(DLBMANCREATE) $(MANDIR)/dlb.$(MANEXT)
X+      -$(GAMEMANCREATE) $(DESTDIR)$(MANDIR)/$(GAME).$(MANEXT)
X+      -$(LEVMANCREATE) $(DESTDIR)$(MANDIR)/lev_comp.$(MANEXT)
X+      -$(DGNMANCREATE) $(DESTDIR)$(MANDIR)/dgn_comp.$(MANEXT)
X+      -$(RCVRMANCREATE) $(DESTDIR)$(MANDIR)/recover.$(MANEXT)
X+      -$(DLBMANCREATE) $(DESTDIR)$(MANDIR)/dlb.$(MANEXT)
X 
X # manual creation for distribution
X DISTRIB = Guidebook.txt nethack.txt lev_comp.txt dgn_comp.txt recover.txt 
dlb.txt
END-of-nethack-lib/patches/patch-ae
echo x - nethack-lib/patches/patch-af
sed 's/^X//' >nethack-lib/patches/patch-af << 
'END-of-nethack-lib/patches/patch-af'
X$NetBSD: patch-af,v 1.6 2006/10/09 02:06:58 ben Exp $
X
XMake configurable.
XFix for BSD.
X
X--- include/unixconf.h.orig    2003-12-07 23:39:13.000000000 +0000
X+++ include/unixconf.h
X@@ -19,20 +19,21 @@
X  */
X 
X /* define exactly one of the following four choices */
X-/* #define BSD 1 */   /* define for 4.n/Free/Open/Net BSD  */
X+#define __NETHACK_OS__ 1
X+/* #define BSD */     /* define for 4.n/Free/Open/Net BSD  */
X                       /* also for relatives like SunOS 4.x, DG/UX, and */
X                       /* older versions of Linux */
X /* #define ULTRIX */  /* define for Ultrix v3.0 or higher (but not lower) */
X                       /* Use BSD for < v3.0 */
X                       /* "ULTRIX" not to be confused with "ultrix" */
X-#define SYSV          /* define for System V, Solaris 2.x, newer versions */
X+/* #define SYSV       */      /* define for System V, Solaris 2.x, newer 
versions */
X                       /* of Linux */
X /* #define HPUX */    /* Hewlett-Packard's Unix, version 6.5 or higher */
X                       /* use SYSV for < v6.5 */
X 
X 
X /* define any of the following that are appropriate */
X-#define SVR4          /* use in addition to SYSV for System V Release 4 */
X+/* #define SVR4       */      /* use in addition to SYSV for System V Release 
4 */
X                       /* including Solaris 2+ */
X #define NETWORK               /* if running on a networked system */
X                       /* e.g. Suns sharing a playground through NFS */
X@@ -47,7 +48,7 @@
X                        * job control (note that AIX is SYSV otherwise)
X                        * Also define this for AIX 3.2 */
X 
X-#define TERMINFO      /* uses terminfo rather than termcap */
X+/* #define TERMINFO   /* uses terminfo rather than termcap */
X                       /* Should be defined for most SYSV, SVR4 (including
X                        * Solaris 2+), HPUX, and Linux systems.  In
X                        * particular, it should NOT be defined for the UNIXPC
X@@ -103,6 +104,7 @@
X  * system, define VAR_PLAYGROUND to be where the variable parts are kept.
X  */
X /* #define VAR_PLAYGROUND "/var/lib/games/nethack" */
X+#define VAR_PLAYGROUND "/var/games/nethack340"
X 
X 
X /*
X@@ -171,7 +173,7 @@
X #  ifdef AMS
X #define AMS_MAILBOX   "/Mailbox"
X #  else
X-#   if defined(__FreeBSD__) || defined(__OpenBSD__)
X+#   if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
X #define DEF_MAILREADER        "/usr/bin/mail"
X #   else
X #define DEF_MAILREADER        "/usr/ucb/Mail"
X@@ -284,7 +286,7 @@
X #endif
X 
X #if defined(BSD) || defined(ULTRIX)
X-# if !defined(DGUX) && !defined(SUNOS4)
X+# if !defined(DGUX) && !defined(SUNOS4) && !defined(BSD)
X #define memcpy(d, s, n)               bcopy(s, d, n)
X #define memcmp(s1, s2, n)     bcmp(s2, s1, n)
X # endif
END-of-nethack-lib/patches/patch-af
echo x - nethack-lib/patches/patch-ag
sed 's/^X//' >nethack-lib/patches/patch-ag << 
'END-of-nethack-lib/patches/patch-ag'
X$NetBSD: patch-ag,v 1.2 2000/08/10 17:50:07 pooka Exp $
X
XFix for NetBSD.
X
X--- src/mail.c.orig    Wed Aug  9 21:02:04 2000
X+++ src/mail.c Thu Aug 10 18:32:30 2000
X@@ -71,7 +71,7 @@
X # if !defined(MAILPATH) && (defined(LINUX) || defined(__osf__))
X #  define MAILPATH "/var/spool/mail/"
X # endif
X-# if !defined(MAILPATH) && defined(__FreeBSD__)
X+# if !defined(MAILPATH) && (defined(__FreeBSD__) || defined(__NetBSD__))
X #  define MAILPATH "/var/mail/"
X # endif
X # if !defined(MAILPATH) && (defined(BSD) || defined(ULTRIX))
END-of-nethack-lib/patches/patch-ag
echo x - nethack-lib/patches/patch-ai
sed 's/^X//' >nethack-lib/patches/patch-ai << 
'END-of-nethack-lib/patches/patch-ai'
X$NetBSD: patch-ai,v 1.3 2007/08/08 20:30:27 joerg Exp $
X
XFix header file and image file.
X
X--- win/Qt/qt_win.cpp.orig     2003-12-07 23:39:13.000000000 +0000
X+++ win/Qt/qt_win.cpp
X@@ -102,11 +102,7 @@ extern "C" {
X #include "qt_xpms.h"
X 
X #include <dirent.h>
X-#ifdef Q_WS_MACX
X-#  include <sys/malloc.h>
X-#else
X-#  include <malloc.h>
X-#endif
X+#include <stdlib.h>
X 
X #ifdef _WS_X11_
X // For userid control
X@@ -4278,7 +4274,7 @@ void NetHackQtYnDialog::done(int i)
X 
X NetHackQtGlyphs::NetHackQtGlyphs()
X {
X-    const char* tile_file = "nhtiles.bmp";
X+    const char* tile_file = "tiles.xpm";
X     if ( iflags.wc_tile_file )
X       tile_file = iflags.wc_tile_file;
X 
END-of-nethack-lib/patches/patch-ai
echo x - nethack-lib/patches/patch-sys_unix_Makefile.src
sed 's/^X//' >nethack-lib/patches/patch-sys_unix_Makefile.src << 
'END-of-nethack-lib/patches/patch-sys_unix_Makefile.src'
X$NetBSD$
X
XMake configurable.
X
X--- sys/unix/Makefile.src.orig 2003-12-07 23:39:13.000000000 +0000
X+++ sys/unix/Makefile.src
X@@ -36,7 +36,11 @@ SHELL=/bin/sh
X # SHELL=E:/GEMINI2/MUPFEL.TTP
X 
X # Normally, the C compiler driver is used for linking:
X+.if "${GTYPE}" == "-qt"
X+LINK=$(CXX)
X+.else
X LINK=$(CC)
X+.endif
X 
X # Pick the SYSSRC and SYSOBJ lines corresponding to your desired operating
X # system.
X@@ -154,12 +158,24 @@ GNOMEINC=-I/usr/lib/glib/include -I/usr/
X CFLAGS = -O -I../include
X LFLAGS = 
X 
X+.if "${GTYPE}" == "-x11" || "${GTYPE}" == "-qt"
X+CFLAGS += -I${X11BASE}/include
X+LFLAGS += ${LDFLAGS}
X+.endif
X+
X+.if "${GTYPE}" == "-tty"
X+CFLAGS += -DGTYPE_TTY
X+.elif "${GTYPE}" == "-x11"
X+CFLAGS += -DGTYPE_X11
X+.elif "${GTYPE}" == "-qt"
X+CFLAGS += -DGTYPE_QT
X+.endif
X+
X # The Qt and Be window systems are written in C++, while the rest of
X # NetHack is standard C.  If using Qt, uncomment the LINK line here to get
X # the C++ libraries linked in.
X CXXFLAGS = $(CFLAGS) -I. -I$(QTDIR)/include
X-CXX=g++
X-#LINK=g++
X+#CXX=g++
X #     For cross-compiling, eg. with gcc on Linux (see also CC further up):
X #CXX=arm-linux-g++
X #LINK=arm-linux-gcc
X@@ -217,6 +233,15 @@ WINBEOBJ =
X WINSRC = $(WINTTYSRC)
X WINOBJ = $(WINTTYOBJ)
X 
X+.if "${GTYPE}" == "-tty"
X+.elif "${GTYPE}" == "-x11"
X+WINSRC += $(WINX11SRC)
X+WINOBJ += $(WINX11OBJ)
X+.elif "${GTYPE}" == "-qt"
X+WINSRC += $(WINQTSRC)
X+WINOBJ += $(WINQTOBJ)
X+.endif
X+
X # on some systems the termcap library is in -ltermcap or -lcurses
X # on 386 Xenix, the -ltermlib tputs() seems not to work; use -lcurses instead
X # Sysatt uses shared library in lieu of this option
X@@ -235,13 +260,13 @@ WINTTYLIB = -ltermlib
X #
X # libraries for X11
X # If USE_XPM is defined in config.h, you will also need -lXpm here.
X-WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11
X+WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 -lXpm
X # WINX11LIB = -lXaw -lXmu -lXt -lX11
X # WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11 -lm
X # WINX11LIB = -lXaw -lXmu -lXpm -lXext -lXt -lX11 -lSM -lICE -lm # BSD/OS 2.0
X #
X # libraries for Qt
X-WINQTLIB = -L$(QTDIR)/lib -lqt
X+WINQTLIB = -L$(QTDIR)/lib -lqt-mt -lXpm -lX11 -lICE -lSM -lz -lpng -lXext 
${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}
X #
X # libraries for KDE (with Qt)
X WINKDELIB = -lkdecore -lkdeui -lXext
X@@ -257,6 +282,13 @@ WINBELIB = -lbe
X 
X WINLIB = $(WINTTYLIB)
X 
X+.if "${GTYPE}" == "-tty"
X+.elif "${GTYPE}" == "-x11"
X+WINLIB += $(WINX11LIB)
X+.elif "${GTYPE}" == "-qt"
X+WINLIB += $(WINQTLIB)
X+.endif
X+
X # any other strange libraries your system needs (for Sysunix only -- the more
X # specialized targets should already be right)
X #
END-of-nethack-lib/patches/patch-sys_unix_Makefile.src
echo x - nethack-lib/patches/patch-sys_unix_Makefile.utl
sed 's/^X//' >nethack-lib/patches/patch-sys_unix_Makefile.utl << 
'END-of-nethack-lib/patches/patch-sys_unix_Makefile.utl'
X$NetBSD$
X
XMake configurable.
X
X--- sys/unix/Makefile.utl.orig 2011-05-27 15:13:59.000000000 +0000
X+++ sys/unix/Makefile.utl
X@@ -94,6 +94,14 @@ LFLAGS =
X 
X LIBS =
X  
X+.if "${GTYPE}" == "-tty"
X+CFLAGS += -DGTYPE_TTY
X+.elif "${GTYPE}" == "-x11"
X+CFLAGS += -DGTYPE_X11
X+.elif "${GTYPE}" == "-qt"
X+CFLAGS += -DGTYPE_QT
X+.endif
X+
X # If you are cross-compiling, you must use this:
X #OBJDIR = .
X # otherwise, you can save a little bit of disk space with this:
END-of-nethack-lib/patches/patch-sys_unix_Makefile.utl
echo x - nethack-qt/DESCR
sed 's/^X//' >nethack-qt/DESCR << 'END-of-nethack-qt/DESCR'
XNethack is a single player, ASCII graphics-based adventure game, similar
Xto the lines of Dungeons & Dragons and similar fantasy games. It is
Xcommonly classified in the larger group of Rogue-like Games, which
Xgenerally are all text-based, solo adventures.
X
XWithin the game, your character is after the infamous Wizard of Yendor,
Xwho has stolen the Amulet of Yendor and plans to use it for his evil
Xpurposes. You, a young member of your chosen class, have been blessed by
Xyour people and your god to retrieve the Amulet, and to save the world
Xfrom the Wizard's evil plans.
END-of-nethack-qt/DESCR
echo x - nethack-qt/MESSAGE
sed 's/^X//' >nethack-qt/MESSAGE << 'END-of-nethack-qt/MESSAGE'
X===========================================================================
X$NetBSD: MESSAGE,v 1.3 2002/09/24 12:30:00 wiz Exp $
X
XYou can run the QT NetHack by typing "nethack qt"
X
XTo fall back to tty mode, use "NETHACKOPTIONS=windowtype:tty nethack"
Xor set that option in your .nethackrc file.
X
X===========================================================================
END-of-nethack-qt/MESSAGE
echo x - nethack-qt/Makefile
sed 's/^X//' >nethack-qt/Makefile << 'END-of-nethack-qt/Makefile'
X# $NetBSD: Makefile,v 1.58 2011/01/13 13:37:48 wiz Exp $
X#
X
X.include "../../games/nethack-lib/Makefile.common"
X
XPKGNAME=               nethack-qt-${NETHACK_VERSION}
XPKGREVISION=           11
XCATEGORIES+=           x11
X
XMAKE_JOBS_SAFE=                no
X
XCOMMENT=               The QT-Enhanced X11+tty version of NetHack
X
XDEPENDS+=              
nethack-lib-${NETHACK_VERSION}{,nb*}:../../games/nethack-lib
X
XUSE_LANGUAGES=         c c++
XBUILD_TARGET=          nethack x11tiles
XINSTALL_TARGET=                binfiles
XMAKE_ENV+=             GTYPE=-qt
X
XDISTINFO_FILE?=                ${.CURDIR}/../nethack-lib/distinfo
XPATCHDIR=              ${.CURDIR}/../nethack-lib/patches
X
XSPECIAL_PERMS+=                ${PREFIX}/bin/nethack-qt                        
\
X                           ${GAMEPERM}
Xpost-install:
X       ${CP} -f ${WRKSRC}/dat/x11tiles ${WRKSRC}/dat/tiles.xpm
X       ${INSTALL_DATA} ${WRKSRC}/dat/tiles.xpm ${DESTDIR}${GAMEDIR}
X       ${INSTALL_DATA} ${WRKSRC}/win/Qt/nhsplash.xpm ${DESTDIR}${GAMEDIR}
X       ${INSTALL_DATA} ${WRKSRC}/win/Qt/knh-mini.xpm ${DESTDIR}${GAMEDIR}
X       ${INSTALL_DATA} ${WRKSRC}/win/Qt/knh.xpm ${DESTDIR}${GAMEDIR}
X
X.include "../../x11/libXpm/buildlink3.mk"
X.include "../../x11/qt3-libs/buildlink3.mk"
X
X.include "../../mk/bsd.pkg.mk"
END-of-nethack-qt/Makefile
echo x - nethack-qt/PLIST
sed 's/^X//' >nethack-qt/PLIST << 'END-of-nethack-qt/PLIST'
X@comment $NetBSD: PLIST,v 1.2 2002/03/25 20:32:27 pooka Exp $
Xbin/nethack-qt
Xshare/nethackdir340/tiles.xpm
Xshare/nethackdir340/nhsplash.xpm
Xshare/nethackdir340/knh.xpm
Xshare/nethackdir340/knh-mini.xpm
END-of-nethack-qt/PLIST
echo x - nethack-tty/DESCR
sed 's/^X//' >nethack-tty/DESCR << 'END-of-nethack-tty/DESCR'
XNethack is a single player, ASCII graphics-based adventure game, similar
Xto the lines of Dungeons & Dragons and similar fantasy games. It is
Xcommonly classified in the larger group of Rogue-like Games, which
Xgenerally are all text-based, solo adventures.
X
XWithin the game, your character is after the infamous Wizard of Yendor,
Xwho has stolen the Amulet of Yendor and plans to use it for his evil
Xpurposes. You, a young member of your chosen class, have been blessed by
Xyour people and your god to retrieve the Amulet, and to save the world
Xfrom the Wizard's evil plans.
END-of-nethack-tty/DESCR
echo x - nethack-tty/MESSAGE
sed 's/^X//' >nethack-tty/MESSAGE << 'END-of-nethack-tty/MESSAGE'
X===========================================================================
X$NetBSD: MESSAGE,v 1.2 2002/09/24 12:30:01 wiz Exp $
X
XYou can run the tty NetHack by simply typing: "nethack"
Xor with "nethack tty"
X
X===========================================================================
END-of-nethack-tty/MESSAGE
echo x - nethack-tty/Makefile
sed 's/^X//' >nethack-tty/Makefile << 'END-of-nethack-tty/Makefile'
X# $NetBSD: Makefile,v 1.19 2009/06/30 00:07:16 joerg Exp $
X#
X
X.include "../../games/nethack-lib/Makefile.common"
X
XPKGNAME=               nethack-tty-${NETHACK_VERSION}
XPKGREVISION=           2
X
XCOMMENT=               The tty/console based version of NetHack
X
XMAKE_JOBS_SAFE=                no
X
XDEPENDS+=              
nethack-lib-${NETHACK_VERSION}{,nb*}:../../games/nethack-lib
X
XBUILD_TARGET=          nethack
XINSTALL_TARGET=                binfiles
XMAKE_ENV+=             GTYPE=-tty
X
XDISTINFO_FILE?=                ${.CURDIR}/../nethack-lib/distinfo
XPATCHDIR=              ${.CURDIR}/../nethack-lib/patches
X
XSPECIAL_PERMS+=                ${PREFIX}/bin/nethack-tty                       
\
X                           ${GAMEPERM}
X
X.include "../../mk/bsd.pkg.mk"
END-of-nethack-tty/Makefile
echo x - nethack-tty/PLIST
sed 's/^X//' >nethack-tty/PLIST << 'END-of-nethack-tty/PLIST'
X@comment $NetBSD: PLIST,v 1.1 2001/11/01 00:54:28 zuntum Exp $
Xbin/nethack-tty
END-of-nethack-tty/PLIST
echo x - nethack-x11/DESCR
sed 's/^X//' >nethack-x11/DESCR << 'END-of-nethack-x11/DESCR'
XNethack is a single player, ASCII graphics-based adventure game, similar
Xto the lines of Dungeons & Dragons and similar fantasy games. It is
Xcommonly classified in the larger group of Rogue-like Games, which
Xgenerally are all text-based, solo adventures.
X
XWithin the game, your character is after the infamous Wizard of Yendor,
Xwho has stolen the Amulet of Yendor and plans to use it for his evil
Xpurposes. You, a young member of your chosen class, have been blessed by
Xyour people and your god to retrieve the Amulet, and to save the world
Xfrom the Wizard's evil plans.
END-of-nethack-x11/DESCR
echo x - nethack-x11/MESSAGE
sed 's/^X//' >nethack-x11/MESSAGE << 'END-of-nethack-x11/MESSAGE'
X===========================================================================
X$NetBSD: MESSAGE,v 1.4 2005/09/28 12:41:40 rillig Exp $
X
XYou can run the X11 NetHack by typing "nethack x11".
X
XTwo fonts were installed for NetHack.  You must add
X${PREFIX}/lib/X11/fonts/misc to fontpath and set one of
X
XNetHack*map*font: nh10
XNetHack*map*font: -misc-fixed-medium-r-normal-ibmpc-14-120-75-75-c-80-iso8859-1
X
Xin ${PREFIX}/lib/X11/app-defaults/NetHack to use it.
XTiled mode is enabled by:
X
XNetHack.tile_file: x11tiles
X
XAlso see ${PREFIX}/share/nethackdir340/nethack.x11.rc
X
XYou may also want to set this environment variable, so NetHack can
Xfind its app-defaults file:
X
XXFILESEARCHPATH=%D:/usr/pkg/lib/X11/%T/%N%C:/usr/pkg/lib/X11/%T/%N
X
XTo fall back to tty mode, use "NETHACKOPTIONS=windowtype:tty nethack"
Xor set that option in your .nethackrc file.
X
X===========================================================================
END-of-nethack-x11/MESSAGE
echo x - nethack-x11/Makefile
sed 's/^X//' >nethack-x11/Makefile << 'END-of-nethack-x11/Makefile'
X# $NetBSD: Makefile,v 1.37 2008/11/10 17:21:35 wiz Exp $
X#
X
X.include "../../games/nethack-lib/Makefile.common"
X
XPKGNAME=               nethack-x11-${NETHACK_VERSION}
XPKGREVISION=           4
XCOMMENT=               The X11+tty version of NetHack
X
XCATEGORIES+=           x11
X
XDEPENDS+=              
nethack-lib-${NETHACK_VERSION}{,nb*}:../../games/nethack-lib
X
XBUILD_TARGET=          nethack x11tiles rip.xpm
XINSTALL_TARGET=                binfiles
XMAKE_ENV+=             GTYPE=-x11
X
XFONTS_DIRS.x11+=       ${PREFIX}/lib/X11/fonts/misc
X
XINSTALLATION_DIRS=     lib/X11/app-defaults lib/X11/fonts/misc
X
XDISTINFO_FILE?=                ${.CURDIR}/../nethack-lib/distinfo
XPATCHDIR=              ${.CURDIR}/../nethack-lib/patches
X
XSPECIAL_PERMS+=                ${PREFIX}/bin/nethack-x11                       
\
X                           ${GAMEPERM}
Xpost-install:
X       ${INSTALL_DATA} ${WRKSRC}/dat/x11tiles \
X           ${DESTDIR}${GAMEDIR}
X       ${INSTALL_DATA} ${WRKSRC}/win/X11/NetHack.ad \
X           ${DESTDIR}${PREFIX}/lib/X11/app-defaults/NetHack
X       ${INSTALL_DATA} ${WRKSRC}/win/X11/nh10.bdf \
X           ${DESTDIR}${PREFIX}/lib/X11/fonts/misc
X       ${INSTALL_DATA} ${WRKSRC}/win/X11/ibm.bdf \
X           ${DESTDIR}${PREFIX}/lib/X11/fonts/misc
X       ${INSTALL_DATA} ${WRKSRC}/win/X11/nethack.rc \
X           ${DESTDIR}${GAMEDIR}/nethack.x11.rc
X
X.include "../../x11/libXaw/buildlink3.mk"
X.include "../../x11/libXpm/buildlink3.mk"
X.include "../../x11/libXt/buildlink3.mk"
X.include "../../mk/bsd.pkg.mk"
END-of-nethack-x11/Makefile
echo x - nethack-x11/PLIST
sed 's/^X//' >nethack-x11/PLIST << 'END-of-nethack-x11/PLIST'
X@comment $NetBSD: PLIST,v 1.3 2005/05/08 10:17:30 pooka Exp $
Xbin/nethack-x11
Xlib/X11/app-defaults/NetHack
Xlib/X11/fonts/misc/ibm.bdf
Xlib/X11/fonts/misc/nh10.bdf
Xshare/nethackdir340/nethack.x11.rc
Xshare/nethackdir340/x11tiles
END-of-nethack-x11/PLIST
echo x - nethack/DESCR
sed 's/^X//' >nethack/DESCR << 'END-of-nethack/DESCR'
XNethack is a single player, ASCII graphics-based adventure game, similar
Xto the lines of Dungeons & Dragons and similar fantasy games. It is
Xcommonly classified in the larger group of Rogue-like Games, which
Xgenerally are all text-based, solo adventures.
X
XWithin the game, your character is after the infamous Wizard of Yendor,
Xwho has stolen the Amulet of Yendor and plans to use it for his evil
Xpurposes. You, a young member of your chosen class, have been blessed by
Xyour people and your god to retrieve the Amulet, and to save the world
Xfrom the Wizard's evil plans.
X
XThis pkg installs the X11, QT and tty based versions of the game. You may
Xalso choose to install just one or more by themselves.
END-of-nethack/DESCR
echo x - nethack/MESSAGE
sed 's/^X//' >nethack/MESSAGE << 'END-of-nethack/MESSAGE'
X===========================================================================
X$NetBSD: MESSAGE,v 1.2 2002/09/24 12:30:00 wiz Exp $
X
XYou can run the tty version of nethack by executing:
X"nethack"  or "nethack tty"
XThe X11 version:  "nethack x11"
XThe QT version:   "nethack qt"
X
XHappy Hacking!
X
X===========================================================================
END-of-nethack/MESSAGE
echo x - nethack/Makefile
sed 's/^X//' >nethack/Makefile << 'END-of-nethack/Makefile'
X# $NetBSD: Makefile,v 1.25 2009/04/08 23:02:27 joerg Exp $
X
XMETA_PACKAGE=  yes
X
X.include "../../games/nethack-lib/Makefile.common"
X
XDISTNAME=      nethack-all-${NETHACK_VERSION}
XPKGREVISION=   3
XCATEGORIES+=   x11
X
XCOMMENT=       Meta-package for NetHack with x11, qt and tty versions
X
XDEPENDS+=      nethack-tty-${NETHACK_VERSION}{,nb*}:../../games/nethack-tty
XDEPENDS+=      nethack-x11-${NETHACK_VERSION}{,nb*}:../../games/nethack-x11
XDEPENDS+=      nethack-qt-${NETHACK_VERSION}{,nb*}:../../games/nethack-qt
X
X.include "../../mk/bsd.pkg.mk"
END-of-nethack/Makefile
exit


-Olaf.
-- 
___ Olaf 'Rhialto' Seibert  -- There's no point being grown-up if you 
\X/ rhialto/at/xs4all.nl    -- can't be childish sometimes. -The 4th Doctor

>Unformatted:
        
        


Home | Main Index | Thread Index | Old Index