diff options
Diffstat (limited to 'games/nethack-lib/patches/patch-ab')
-rw-r--r-- | games/nethack-lib/patches/patch-ab | 201 |
1 files changed, 161 insertions, 40 deletions
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 |