$NetBSD: patch-ab,v 1.1.1.1 2002/01/21 11:56:17 pooka Exp $ --- sys/unix/Makefile.top.orig Sun Jun 24 18:57:24 2001 +++ sys/unix/Makefile.top @@ -14,19 +14,17 @@ # MAKE = make # make NetHack -#PREFIX = /usr -PREFIX = $(shell pwd)/compiled -GAME = nethack +GAME = falcons-eye # GAME = nethack.prg -GAMEUID = games -GAMEGRP = bin +GAMEUID = root +GAMEGRP = games # Permissions - some places use setgid instead of setuid, for instance # See also the option "SECURE" in include/config.h -GAMEPERM = 04755 -FILEPERM = 0644 +GAMEPERM = 02755 +FILEPERM = 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 @@ -36,9 +34,9 @@ # 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)-dir VARDIR = $(GAMEDIR) -SHELLDIR = $(PREFIX)/games +SHELLDIR = $(PREFIX)/bin # per discussion in Install.X11 and Install.Qt VARDATND = @@ -65,10 +63,8 @@ # 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 = true -CHGRP = true +CHOWN = chown +CHGRP = chgrp # ---------------------------------------------- # Extra configuration for NetHack - Falcon's Eye @@ -119,9 +115,12 @@ $(GAME): ( cd src ; $(MAKE) ) -all: $(GAME) Guidebook $(VARDAT) dungeon spec_levs check-dlb +all: $(GAME) datastuff @echo "Done." +datastuff: Guidebook $(VARDAT) dungeon spec_levs check-dlb recover + @echo "Data Sets Built." + Guidebook: ( cd doc ; $(MAKE) Guidebook ) @@ -131,6 +130,9 @@ data: ( cd dat ; $(MAKE) data ) +recover: + ( cd util ; $(MAKE) recover ) + rumors: ( cd dat ; $(MAKE) rumors ) @@ -188,6 +190,11 @@ ( cd util ; $(MAKE) dlb ) ( cd dat ; ../util/dlb cf nhdat $(DATDLB) ) +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) dofiles: target=`sed -n \ @@ -203,6 +210,7 @@ -rm -f $(SHELLDIR)/$(GAME) sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \ -e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \ + -e 's;XXXPREFIXXXX;$(PREFIX);' \ < sys/unix/nethack.sh \ > $(SHELLDIR)/$(GAME) # set up their permissions @@ -280,12 +288,12 @@ # set up the directories # not all mkdirs have -p; those that don't will create a -p directory -mkdir -p $(SHELLDIR) - -rm -rf $(GAMEDIR) $(VARDIR) -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save -rmdir ./-p -$(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 # set up the game files ( $(MAKE) dofiles ) # set up some additional files @@ -293,6 +301,14 @@ -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \ $(CHGRP) $(GAMEGRP) perm record logfile ; \ chmod $(FILEPERM) perm record logfile ) + -mkdir -p $(PREFIX)/share/doc/$(GAME) + cp doc/Guidebook.txt $(PREFIX)/share/doc/$(GAME) + chown $(GAMEUID):$(GAMEGRP) $(PREFIX)/share/doc/$(GAME)/Guidebook.txt + chmod $(FILEPERM) $(PREFIX)/share/doc/$(GAME)/Guidebook.txt + cp util/recover $(PREFIX)/bin/recover-$(GAME) + chown 0:0 $(PREFIX)/bin/recover-$(GAME) + chmod 755 $(PREFIX)/bin/recover-$(GAME) + # and a reminder @echo You may also want to reinstall the man pages via the doc Makefile.