summaryrefslogtreecommitdiff
path: root/games/nethack-lib
diff options
context:
space:
mode:
Diffstat (limited to 'games/nethack-lib')
-rw-r--r--games/nethack-lib/Makefile31
-rw-r--r--games/nethack-lib/Makefile.common27
-rw-r--r--games/nethack-lib/PLIST3
-rw-r--r--games/nethack-lib/distinfo19
-rw-r--r--games/nethack-lib/patches/patch-aa51
-rw-r--r--games/nethack-lib/patches/patch-ab201
-rw-r--r--games/nethack-lib/patches/patch-ac4
-rw-r--r--games/nethack-lib/patches/patch-ad14
-rw-r--r--games/nethack-lib/patches/patch-ae23
-rw-r--r--games/nethack-lib/patches/patch-af26
-rw-r--r--games/nethack-lib/patches/patch-ag4
-rw-r--r--games/nethack-lib/patches/patch-ai28
-rw-r--r--games/nethack-lib/patches/patch-sys_unix_Makefile.src91
-rw-r--r--games/nethack-lib/patches/patch-sys_unix_Makefile.utl21
14 files changed, 453 insertions, 90 deletions
diff --git a/games/nethack-lib/Makefile b/games/nethack-lib/Makefile
index 9dd55430aed..622aeb27c88 100644
--- a/games/nethack-lib/Makefile
+++ b/games/nethack-lib/Makefile
@@ -1,10 +1,10 @@
-# $NetBSD: Makefile,v 1.26 2008/09/25 14:02:09 wiz Exp $
+# $NetBSD: Makefile,v 1.27 2011/06/01 11:20:29 wiz Exp $
#
.include "../../games/nethack-lib/Makefile.common"
PKGNAME= nethack-lib-${NETHACK_VERSION}
-PKGREVISION= 2
+PKGREVISION= 3
COMMENT= Data files for Nethack
@@ -20,17 +20,20 @@ INSTALLATION_DIRS= ${PKGMANDIR}/man6
# 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"
diff --git a/games/nethack-lib/Makefile.common b/games/nethack-lib/Makefile.common
index 5a2f7ba57cd..59a38e96ab3 100644
--- a/games/nethack-lib/Makefile.common
+++ b/games/nethack-lib/Makefile.common
@@ -1,5 +1,10 @@
-# $NetBSD: Makefile.common,v 1.26 2009/08/04 13:58:57 joerg Exp $
+# $NetBSD: Makefile.common,v 1.27 2011/06/01 11:20:29 wiz 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 @@ EXTRACT_SUFX= .tgz
MAINTAINER= pooka@NetBSD.org
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= SYSV
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
diff --git a/games/nethack-lib/PLIST b/games/nethack-lib/PLIST
index f99e7b446b0..4a84728ac6f 100644
--- a/games/nethack-lib/PLIST
+++ b/games/nethack-lib/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.7 2009/06/14 17:56:52 joerg Exp $
+@comment $NetBSD: PLIST,v 1.8 2011/06/01 11:20:29 wiz Exp $
bin/nethack
bin/recover
man/man6/dgn_comp.6
@@ -113,7 +113,6 @@ share/nethackdir340/options
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
diff --git a/games/nethack-lib/distinfo b/games/nethack-lib/distinfo
index 65ffa09729d..fd1f97b2eb2 100644
--- a/games/nethack-lib/distinfo
+++ b/games/nethack-lib/distinfo
@@ -1,12 +1,15 @@
-$NetBSD: distinfo,v 1.16 2008/05/20 19:47:16 tnn Exp $
+$NetBSD: distinfo,v 1.17 2011/06/01 11:20:29 wiz Exp $
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) = 31d89b27e52189de9a51fbb04f1ed390c5377b2b
+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
diff --git a/games/nethack-lib/patches/patch-aa b/games/nethack-lib/patches/patch-aa
index da8d8abf4a1..782f697f093 100644
--- a/games/nethack-lib/patches/patch-aa
+++ b/games/nethack-lib/patches/patch-aa
@@ -1,8 +1,45 @@
-$NetBSD: patch-aa,v 1.9 2004/03/05 15:21:01 pooka Exp $
+$NetBSD: patch-aa,v 1.10 2011/06/01 11:20:29 wiz 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 */
@@ -18,16 +55,16 @@ $NetBSD: patch-aa,v 1.9 2004/03/05 15:21:01 pooka Exp $
#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 "@PREFIX@/share/nethackdir340"
# endif
/*
-@@ -300,7 +300,7 @@
+@@ -300,7 +310,7 @@ typedef unsigned char uchar;
* functions that have been macroized.
*/
diff --git a/games/nethack-lib/patches/patch-ab b/games/nethack-lib/patches/patch-ab
index c2aa0916c81..39e76428a1c 100644
--- a/games/nethack-lib/patches/patch-ab
+++ b/games/nethack-lib/patches/patch-ab
@@ -1,8 +1,10 @@
-$NetBSD: patch-ab,v 1.11 2004/03/05 15:21:01 pooka Exp $
+$NetBSD: patch-ab,v 1.12 2011/06/01 11:20:29 wiz 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 @@ $NetBSD: patch-ab,v 1.11 2004/03/05 15:21:01 pooka Exp $
# 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 @@ $NetBSD: patch-ab,v 1.11 2004/03/05 15:21:01 pooka Exp $
# 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 @@ $NetBSD: patch-ab,v 1.11 2004/03/05 15:21:01 pooka Exp $
# 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 @@ $NetBSD: patch-ab,v 1.11 2004/03/05 15:21:01 pooka Exp $
+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
diff --git a/games/nethack-lib/patches/patch-ac b/games/nethack-lib/patches/patch-ac
index 2500ed72317..58a5d8f7a94 100644
--- a/games/nethack-lib/patches/patch-ac
+++ b/games/nethack-lib/patches/patch-ac
@@ -1,4 +1,6 @@
-$NetBSD: patch-ac,v 1.9 2006/06/19 17:07:45 minskim Exp $
+$NetBSD: patch-ac,v 1.10 2011/06/01 11:20:29 wiz Exp $
+
+Fix for NetBSD.
--- include/system.h.orig 2003-12-07 15:39:13.000000000 -0800
+++ include/system.h
diff --git a/games/nethack-lib/patches/patch-ad b/games/nethack-lib/patches/patch-ad
index fcbca1083dd..048e8e202f1 100644
--- a/games/nethack-lib/patches/patch-ad
+++ b/games/nethack-lib/patches/patch-ad
@@ -1,7 +1,9 @@
-$NetBSD: patch-ad,v 1.7 2007/10/27 18:26:34 pooka Exp $
+$NetBSD: patch-ad,v 1.8 2011/06/01 11:20:29 wiz 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 @@ $NetBSD: patch-ad,v 1.7 2007/10/27 18:26:34 pooka Exp $
+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 @@ $NetBSD: patch-ad,v 1.7 2007/10/27 18:26:34 pooka Exp $
+ 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
diff --git a/games/nethack-lib/patches/patch-ae b/games/nethack-lib/patches/patch-ae
index 82f8b75674d..172a7b37ca7 100644
--- a/games/nethack-lib/patches/patch-ae
+++ b/games/nethack-lib/patches/patch-ae
@@ -1,6 +1,8 @@
-$NetBSD: patch-ae,v 1.5 2008/05/20 19:47:16 tnn Exp $
+$NetBSD: patch-ae,v 1.6 2011/06/01 11:20:29 wiz 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 @@ $NetBSD: patch-ae,v 1.5 2008/05/20 19:47:16 tnn Exp $
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
diff --git a/games/nethack-lib/patches/patch-af b/games/nethack-lib/patches/patch-af
index f115607979b..c009e80eccd 100644
--- a/games/nethack-lib/patches/patch-af
+++ b/games/nethack-lib/patches/patch-af
@@ -1,6 +1,9 @@
-$NetBSD: patch-af,v 1.6 2006/10/09 02:06:58 ben Exp $
+$NetBSD: patch-af,v 1.7 2011/06/01 11:20:29 wiz 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 @@ $NetBSD: patch-af,v 1.6 2006/10/09 02:06:58 ben Exp $
/* 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 @@ $NetBSD: patch-af,v 1.6 2006/10/09 02:06:58 ben Exp $
#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
diff --git a/games/nethack-lib/patches/patch-ag b/games/nethack-lib/patches/patch-ag
index 88fe200433e..24b50be53f7 100644
--- a/games/nethack-lib/patches/patch-ag
+++ b/games/nethack-lib/patches/patch-ag
@@ -1,4 +1,6 @@
-$NetBSD: patch-ag,v 1.2 2000/08/10 17:50:07 pooka Exp $
+$NetBSD: patch-ag,v 1.3 2011/06/01 11:20:29 wiz 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
diff --git a/games/nethack-lib/patches/patch-ai b/games/nethack-lib/patches/patch-ai
new file mode 100644
index 00000000000..517405d2aa7
--- /dev/null
+++ b/games/nethack-lib/patches/patch-ai
@@ -0,0 +1,28 @@
+$NetBSD: patch-ai,v 1.1 2011/06/01 11:20:29 wiz Exp $
+
+Fix header file and image file.
+
+--- win/Qt/qt_win.cpp.orig 2003-12-07 23:39:13.000000000 +0000
++++ win/Qt/qt_win.cpp
+@@ -102,11 +102,7 @@ extern "C" {
+ #include "qt_xpms.h"
+
+ #include <dirent.h>
+-#ifdef Q_WS_MACX
+-# include <sys/malloc.h>
+-#else
+-# include <malloc.h>
+-#endif
++#include <stdlib.h>
+
+ #ifdef _WS_X11_
+ // For userid control
+@@ -4278,7 +4274,7 @@ void NetHackQtYnDialog::done(int i)
+
+ NetHackQtGlyphs::NetHackQtGlyphs()
+ {
+- const char* tile_file = "nhtiles.bmp";
++ const char* tile_file = "tiles.xpm";
+ if ( iflags.wc_tile_file )
+ tile_file = iflags.wc_tile_file;
+
diff --git a/games/nethack-lib/patches/patch-sys_unix_Makefile.src b/games/nethack-lib/patches/patch-sys_unix_Makefile.src
new file mode 100644
index 00000000000..c5b41f2ad64
--- /dev/null
+++ b/games/nethack-lib/patches/patch-sys_unix_Makefile.src
@@ -0,0 +1,91 @@
+$NetBSD: patch-sys_unix_Makefile.src,v 1.1 2011/06/01 11:20:29 wiz Exp $
+
+Make configurable.
+
+--- sys/unix/Makefile.src.orig 2003-12-07 23:39:13.000000000 +0000
++++ sys/unix/Makefile.src
+@@ -36,7 +36,11 @@ SHELL=/bin/sh
+ # SHELL=E:/GEMINI2/MUPFEL.TTP
+
+ # Normally, the C compiler driver is used for linking:
++.if "${GTYPE}" == "-qt"
++LINK=$(CXX)
++.else
+ LINK=$(CC)
++.endif
+
+ # Pick the SYSSRC and SYSOBJ lines corresponding to your desired operating
+ # system.
+@@ -154,12 +158,24 @@ GNOMEINC=-I/usr/lib/glib/include -I/usr/
+ CFLAGS = -O -I../include
+ LFLAGS =
+
++.if "${GTYPE}" == "-x11" || "${GTYPE}" == "-qt"
++CFLAGS += -I${X11BASE}/include
++LFLAGS += ${LDFLAGS}
++.endif
++
++.if "${GTYPE}" == "-tty"
++CFLAGS += -DGTYPE_TTY
++.elif "${GTYPE}" == "-x11"
++CFLAGS += -DGTYPE_X11
++.elif "${GTYPE}" == "-qt"
++CFLAGS += -DGTYPE_QT
++.endif
++
+ # 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
+-CXX=g++
+-#LINK=g++
++#CXX=g++
+ # For cross-compiling, eg. with gcc on Linux (see also CC further up):
+ #CXX=arm-linux-g++
+ #LINK=arm-linux-gcc
+@@ -217,6 +233,15 @@ WINBEOBJ =
+ WINSRC = $(WINTTYSRC)
+ WINOBJ = $(WINTTYOBJ)
+
++.if "${GTYPE}" == "-tty"
++.elif "${GTYPE}" == "-x11"
++WINSRC += $(WINX11SRC)
++WINOBJ += $(WINX11OBJ)
++.elif "${GTYPE}" == "-qt"
++WINSRC += $(WINQTSRC)
++WINOBJ += $(WINQTOBJ)
++.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
+ # Sysatt uses shared library in lieu of this option
+@@ -235,13 +260,13 @@ 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 -lX11 -lXpm
+ # 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 -lXpm -lX11 -lICE -lSM -lz -lpng -lXext ${PTHREAD_LDFLAGS} ${PTHREAD_LIBS}
+ #
+ # libraries for KDE (with Qt)
+ WINKDELIB = -lkdecore -lkdeui -lXext
+@@ -257,6 +282,13 @@ WINBELIB = -lbe
+
+ WINLIB = $(WINTTYLIB)
+
++.if "${GTYPE}" == "-tty"
++.elif "${GTYPE}" == "-x11"
++WINLIB += $(WINX11LIB)
++.elif "${GTYPE}" == "-qt"
++WINLIB += $(WINQTLIB)
++.endif
++
+ # any other strange libraries your system needs (for Sysunix only -- the more
+ # specialized targets should already be right)
+ #
diff --git a/games/nethack-lib/patches/patch-sys_unix_Makefile.utl b/games/nethack-lib/patches/patch-sys_unix_Makefile.utl
new file mode 100644
index 00000000000..9344a55a173
--- /dev/null
+++ b/games/nethack-lib/patches/patch-sys_unix_Makefile.utl
@@ -0,0 +1,21 @@
+$NetBSD: patch-sys_unix_Makefile.utl,v 1.1 2011/06/01 11:20:29 wiz Exp $
+
+Make configurable.
+
+--- sys/unix/Makefile.utl.orig 2011-05-27 15:13:59.000000000 +0000
++++ sys/unix/Makefile.utl
+@@ -94,6 +94,14 @@ LFLAGS =
+
+ LIBS =
+
++.if "${GTYPE}" == "-tty"
++CFLAGS += -DGTYPE_TTY
++.elif "${GTYPE}" == "-x11"
++CFLAGS += -DGTYPE_X11
++.elif "${GTYPE}" == "-qt"
++CFLAGS += -DGTYPE_QT
++.endif
++
+ # If you are cross-compiling, you must use this:
+ #OBJDIR = .
+ # otherwise, you can save a little bit of disk space with this: