summaryrefslogtreecommitdiff
path: root/games/nethack-lib/patches/patch-ab
blob: bd583b5a77be7ca4cffd9fb5b9ecd8ca6559e862 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
$NetBSD: patch-ab,v 1.5 2000/08/21 19:57:08 pooka Exp $

--- sys/unix/Makefile.top.orig	Tue Jul  4 03:42:05 2000
+++ sys/unix/Makefile.top	Mon Aug 21 22:48:26 2000
@@ -14,18 +14,17 @@
 # MAKE = make
 
 # make NetHack
-PREFIX	 = /usr
 GAME     = nethack
 # 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 = 2755
+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
@@ -35,14 +34,13 @@
 # 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 = 
 # VARDATND = x11tiles pet_mark.xbm
-# VARDATND = x11tiles pet_mark.xbm rip.xpm
+VARDATND = x11tiles pet_mark.xbm rip.xpm
 # for Atari/Gem
 # VARDATND = nh16.img title.img GEM_RSC.RSC
 # for BeOS
@@ -87,9 +85,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 )
 
@@ -99,6 +100,9 @@
 data:
 	( cd dat ; $(MAKE) data )
 
+recover:
+	( cd util ; $(MAKE) recover )
+
 rumors:
 	( cd dat ; $(MAKE) rumors )
 
@@ -156,6 +160,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					\
@@ -165,16 +174,13 @@
 		-e '}' 					\
 	  	-e '$$s/.*/nodlb/p' < dat/options` ;	\
 	$(MAKE) dofiles-$${target-nodlb}
-	cp src/$(GAME) $(GAMEDIR)
 	-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
-	-( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(GAME) ; \
-			$(CHGRP) $(GAMEGRP) $(GAME) )
-	chmod $(GAMEPERM) $(GAMEDIR)/$(GAME)
 	-$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME)
 	$(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME)
 	chmod $(EXEPERM) $(SHELLDIR)/$(GAME)
@@ -210,16 +216,16 @@
 # and a reminder
 	@echo You may also want to install the man pages via the doc Makefile.
 
-install: $(GAME) $(VARDAT) dungeon spec_levs
+install-dat: $(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)
-	-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
@@ -227,6 +233,14 @@
 	-( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \
 			$(CHGRP) $(GAMEGRP) perm record logfile ; \
 			chmod $(FILEPERM) perm record logfile )
+	-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
+	cp util/recover $(PREFIX)/bin/recover
+	chown 0:0 $(PREFIX)/bin/recover
+	chmod 755 $(PREFIX)/bin/recover
+
 # and a reminder
 	@echo You may also want to reinstall the man pages via the doc Makefile.