Lines 1-105
Link Here
|
1 |
--- sys/unix/Makefile.top.orig 2003-12-07 15:39:13.000000000 -0800 |
1 |
--- sys/unix/Makefile.top.orig 2015-11-18 20:54:59 UTC |
2 |
+++ sys/unix/Makefile.top 2014-06-28 23:20:31.000000000 -0700 |
2 |
+++ sys/unix/Makefile.top |
3 |
@@ -14,18 +14,17 @@ |
3 |
@@ -21,15 +21,15 @@ NHSROOT=. |
4 |
# MAKE = make |
4 |
GAME = nethack |
5 |
|
|
|
6 |
# make NetHack |
7 |
-PREFIX = /usr |
8 |
-GAME = nethack |
9 |
+GAME = %%HACKNAME%% |
10 |
# GAME = nethack.prg |
5 |
# GAME = nethack.prg |
11 |
GAMEUID = games |
6 |
#GAMEUID = games |
12 |
-GAMEGRP = bin |
7 |
-#GAMEGRP = bin |
13 |
+GAMEGRP = games |
8 |
+GAMEGRP = games |
14 |
|
9 |
|
15 |
# Permissions - some places use setgid instead of setuid, for instance |
10 |
# Permissions - some places use setgid instead of setuid, for instance |
16 |
# See also the option "SECURE" in include/config.h |
11 |
# See also the option "SECURE" in include/config.h |
17 |
-GAMEPERM = 04755 |
12 |
-#GAMEPERM = 04755 |
18 |
-FILEPERM = 0644 |
13 |
-FILEPERM = 0644 |
19 |
+GAMEPERM = 02755 |
14 |
+GAMEPERM = 02755 |
20 |
+FILEPERM = 0664 |
15 |
+FILEPERM = 0664 |
|
|
16 |
# VARFILEPERM = 0644 |
21 |
EXEPERM = 0755 |
17 |
EXEPERM = 0755 |
22 |
-DIRPERM = 0755 |
18 |
-DIRPERM = 0755 |
23 |
+DIRPERM = 0775 |
19 |
+DIRPERM = 0775 |
|
|
20 |
# VARDIRPERM = 0755 |
24 |
|
21 |
|
25 |
# GAMEDIR also appears in config.h as "HACKDIR". |
22 |
# VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else HACKDIR |
26 |
# VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else GAMEDIR |
23 |
@@ -39,10 +39,11 @@ DIRPERM = 0755 |
27 |
@@ -35,12 +34,12 @@ |
24 |
# therefore there should not be anything in HACKDIR that you want to keep |
28 |
# therefore there should not be anything in GAMEDIR that you want to keep |
|
|
29 |
# (if there is, you'll have to do the installation by hand or modify the |
25 |
# (if there is, you'll have to do the installation by hand or modify the |
30 |
# instructions) |
26 |
# instructions) |
31 |
-GAMEDIR = $(PREFIX)/games/lib/$(GAME)dir |
27 |
-#HACKDIR = $(PREFIX)/games/lib/$(GAME)dir |
32 |
+GAMEDIR = ${PREFIX}/share/%%HACKNAME%% |
28 |
-#VARDIR = $(HACKDIR) |
33 |
VARDIR = $(GAMEDIR) |
29 |
+HACKDIR = ${PREFIX}/share/nethack |
34 |
-SHELLDIR = $(PREFIX)/games |
30 |
+VARDIR = $(HACKDIR) |
|
|
31 |
+INSTDIR = $(HACKDIR) |
32 |
# Where nethack.sh in installed. If this is not defined, the wrapper is not used. |
33 |
-#SHELLDIR = $(PREFIX)/games |
35 |
+SHELLDIR = ${PREFIX}/bin |
34 |
+SHELLDIR = ${PREFIX}/bin |
36 |
|
35 |
|
37 |
# per discussion in Install.X11 and Install.Qt |
36 |
# per discussion in Install.X11 and Install.Qt |
38 |
-VARDATND = |
37 |
#VARDATND = |
39 |
+# VARDATND = |
38 |
@@ -53,7 +54,7 @@ DIRPERM = 0755 |
40 |
# VARDATND = x11tiles NetHack.ad pet_mark.xbm |
|
|
41 |
# VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm |
42 |
# for Atari/Gem |
43 |
@@ -48,7 +47,7 @@ |
44 |
# for BeOS |
39 |
# for BeOS |
45 |
# VARDATND = beostiles |
40 |
# VARDATND = beostiles |
46 |
# for Gnome |
41 |
# for Gnome |
47 |
-# VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm |
42 |
-# VARDATND = x11tiles pet_mark.xbm pilemark.xpm rip.xpm mapbg.xpm |
48 |
+VARDATND = x11tiles pet_mark.xbm rip.xpm mapbg.xpm |
43 |
+VARDATND = x11tiles pet_mark.xbm pilemark.xbm rip.xpm mapbg.xpm |
49 |
|
44 |
|
50 |
VARDATD = data oracles options quest.dat rumors |
45 |
VARDATD = bogusmon data engrave epitaph oracles options quest.dat rumors |
51 |
VARDAT = $(VARDATD) $(VARDATND) |
46 |
VARDAT = $(VARDATD) $(VARDATND) |
52 |
@@ -183,49 +182,32 @@ |
47 |
@@ -201,56 +202,34 @@ dofiles: |
53 |
-e '}' \ |
48 |
-e '}' \ |
54 |
-e '$$s/.*/nodlb/p' < dat/options` ; \ |
49 |
-e '$$s/.*/nodlb/p' < dat/options` ; \ |
55 |
$(MAKE) dofiles-$${target-nodlb} |
50 |
$(MAKE) dofiles-$${target-nodlb} |
56 |
- cp src/$(GAME) $(GAMEDIR) |
51 |
- (cd dat ; cp symbols $(INSTDIR) ) |
57 |
- cp util/recover $(GAMEDIR) |
52 |
- cp src/$(GAME) $(INSTDIR) |
58 |
- -rm -f $(SHELLDIR)/$(GAME) |
53 |
- cp util/recover $(INSTDIR) |
59 |
+ cp src/$(GAME) ${DESTDIR}$(GAMEDIR)/$(GAME) |
54 |
- -if test -n '$(SHELLDIR)'; then rm -f $(SHELLDIR)/$(GAME); fi |
60 |
+ cp util/recover ${DESTDIR}$(GAMEDIR) |
55 |
+ (cd dat ; cp symbols ${DESTDIR}$(INSTDIR) ) |
61 |
+ -rm -f ${DESTDIR}$(SHELLDIR)/$(GAME) |
56 |
+ cp src/nethack ${DESTDIR}$(INSTDIR)/$(GAME) |
62 |
sed -e 's;/usr/games/lib/nethackdir;$(GAMEDIR);' \ |
57 |
+ cp util/recover ${DESTDIR}$(INSTDIR) |
|
|
58 |
+ -if test -n '${DESTDIR}$(SHELLDIR)'; then rm -f ${DESTDIR}$(SHELLDIR)/$(GAME); fi |
59 |
if test -n '$(SHELLDIR)'; then \ |
60 |
sed -e 's;/usr/games/lib/nethackdir;$(HACKDIR);' \ |
63 |
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \ |
61 |
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \ |
64 |
< sys/unix/nethack.sh \ |
62 |
< sys/unix/nethack.sh \ |
65 |
- > $(SHELLDIR)/$(GAME) |
63 |
- > $(SHELLDIR)/$(GAME) ; fi |
66 |
-# set up their permissions |
64 |
-# set up their permissions |
67 |
- -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \ |
65 |
- -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) $(GAME) recover ; \ |
68 |
- $(CHGRP) $(GAMEGRP) $(GAME) recover ) |
66 |
- $(CHGRP) $(GAMEGRP) $(GAME) recover ) |
69 |
- chmod $(GAMEPERM) $(GAMEDIR)/$(GAME) |
67 |
- chmod $(GAMEPERM) $(INSTDIR)/$(GAME) |
70 |
- chmod $(EXEPERM) $(GAMEDIR)/recover |
68 |
- chmod $(EXEPERM) $(INSTDIR)/recover |
71 |
- -$(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME) |
69 |
- -if test -n '$(SHELLDIR)'; then \ |
72 |
- $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME) |
70 |
- $(CHOWN) $(GAMEUID) $(SHELLDIR)/$(GAME); fi |
73 |
- chmod $(EXEPERM) $(SHELLDIR)/$(GAME) |
71 |
- if test -n '$(SHELLDIR)'; then \ |
74 |
+ > ${DESTDIR}$(SHELLDIR)/$(GAME) |
72 |
- $(CHGRP) $(GAMEGRP) $(SHELLDIR)/$(GAME); \ |
|
|
73 |
- chmod $(EXEPERM) $(SHELLDIR)/$(GAME); fi |
74 |
- -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) symbols ; \ |
75 |
- $(CHGRP) $(GAMEGRP) symbols ; \ |
76 |
- chmod $(FILEPERM) symbols ) |
77 |
+ > ${DESTDIR}$(SHELLDIR)/$(GAME) ; fi |
75 |
|
78 |
|
76 |
dofiles-dlb: check-dlb |
79 |
dofiles-dlb: check-dlb |
77 |
- ( cd dat ; cp nhdat $(DATNODLB) $(GAMEDIR) ) |
80 |
- ( cd dat ; cp nhdat $(DATNODLB) $(INSTDIR) ) |
78 |
-# set up their permissions |
81 |
-# set up their permissions |
79 |
- -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \ |
82 |
- -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) nhdat $(DATNODLB) ; \ |
80 |
- $(CHGRP) $(GAMEGRP) nhdat $(DATNODLB) ; \ |
83 |
- $(CHGRP) $(GAMEGRP) nhdat $(DATNODLB) ; \ |
81 |
- chmod $(FILEPERM) nhdat $(DATNODLB) ) |
84 |
- chmod $(FILEPERM) nhdat $(DATNODLB) ) |
82 |
+ ( cd dat ; cp nhdat $(DATNODLB) ${DESTDIR}$(GAMEDIR) ) |
85 |
+ ( cd dat ; cp nhdat $(DATNODLB) ${DESTDIR}$(INSTDIR) ) |
83 |
|
86 |
|
84 |
dofiles-nodlb: |
87 |
dofiles-nodlb: |
85 |
# copy over the game files |
88 |
# copy over the game files |
86 |
- ( cd dat ; cp $(DAT) $(GAMEDIR) ) |
89 |
- ( cd dat ; cp $(DAT) $(INSTDIR) ) |
87 |
-# set up their permissions |
90 |
-# set up their permissions |
88 |
- -( cd $(GAMEDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \ |
91 |
- -( cd $(INSTDIR) ; $(CHOWN) $(GAMEUID) $(DAT) ; \ |
89 |
- $(CHGRP) $(GAMEGRP) $(DAT) ; \ |
92 |
- $(CHGRP) $(GAMEGRP) $(DAT) ; \ |
90 |
- chmod $(FILEPERM) $(DAT) ) |
93 |
- chmod $(FILEPERM) $(DAT) ) |
91 |
+ ( cd dat ; cp $(DAT) ${DESTDIR}$(GAMEDIR) ) |
94 |
+ ( cd dat ; cp $(DAT) ${DESTDIR}$(INSTDIR) ) |
92 |
|
95 |
|
93 |
update: $(GAME) recover $(VARDAT) dungeon spec_levs |
96 |
update: $(GAME) recover $(VARDAT) dungeon spec_levs |
94 |
# (don't yank the old version out from under people who're playing it) |
97 |
# (don't yank the old version out from under people who're playing it) |
95 |
- -mv $(GAMEDIR)/$(GAME) $(GAMEDIR)/$(GAME).old |
98 |
- -mv $(INSTDIR)/$(GAME) $(INSTDIR)/$(GAME).old |
96 |
+ -mv ${DESTDIR}$(GAMEDIR)/$(GAME) ${DESTDIR}$(GAMEDIR)/$(GAME).old |
99 |
+ -mv ${DESTDIR}$(INSTDIR)/$(GAME) ${DESTDIR}$(INSTDIR)/$(GAME).old |
97 |
# quest.dat is also kept open and has the same problems over NFS |
100 |
# quest.dat is also kept open and has the same problems over NFS |
98 |
# (quest.dat may be inside nhdat if dlb is in use) |
101 |
# (quest.dat may be inside nhdat if dlb is in use) |
99 |
- -mv $(GAMEDIR)/quest.dat $(GAMEDIR)/quest.dat.old |
102 |
- -mv $(INSTDIR)/quest.dat $(INSTDIR)/quest.dat.old |
100 |
- -mv $(GAMEDIR)/nhdat $(GAMEDIR)/nhdat.old |
103 |
- -mv $(INSTDIR)/nhdat $(INSTDIR)/nhdat.old |
101 |
+ -mv ${DESTDIR}$(GAMEDIR)/quest.dat ${DESTDIR}$(GAMEDIR)/quest.dat.old |
104 |
+ -mv ${DESTDIR}$(INSTDIR)/quest.dat ${DESTDIR}$(INSTDIR)/quest.dat.old |
102 |
+ -mv ${DESTDIR}$(GAMEDIR)/nhdat ${DESTDIR}$(GAMEDIR)/nhdat.old |
105 |
+ -mv ${DESTDIR}$(INSTDIR)/nhdat ${DESTDIR}$(INSTDIR)/nhdat.old |
103 |
# set up new versions of the game files |
106 |
# set up new versions of the game files |
104 |
( $(MAKE) dofiles ) |
107 |
( $(MAKE) dofiles ) |
105 |
# touch time-sensitive files |
108 |
# touch time-sensitive files |
Lines 108-135
Link Here
|
108 |
touch $(VARDIR)/perm $(VARDIR)/record |
111 |
touch $(VARDIR)/perm $(VARDIR)/record |
109 |
# and a reminder |
112 |
# and a reminder |
110 |
@echo You may also want to install the man pages via the doc Makefile. |
113 |
@echo You may also want to install the man pages via the doc Makefile. |
111 |
@@ -233,20 +215,14 @@ |
114 |
@@ -262,23 +241,16 @@ install: rootcheck $(GAME) recover $(VAR |
112 |
install: $(GAME) recover $(VARDAT) dungeon spec_levs |
115 |
true; $(PREINSTALL) |
113 |
# set up the directories |
116 |
# set up the directories |
114 |
# not all mkdirs have -p; those that don't will create a -p directory |
117 |
# not all mkdirs have -p; those that don't will create a -p directory |
115 |
- -mkdir -p $(SHELLDIR) |
118 |
- -if test -n '$(SHELLDIR)'; then \ |
116 |
- -rm -rf $(GAMEDIR) $(VARDIR) |
119 |
- mkdir -p $(SHELLDIR); fi |
117 |
- -mkdir -p $(GAMEDIR) $(VARDIR) $(VARDIR)/save |
120 |
- rm -rf $(INSTDIR) $(VARDIR) |
118 |
+ -mkdir -p ${DESTDIR}$(SHELLDIR) |
121 |
- -mkdir -p $(INSTDIR) $(VARDIR) $(VARDIR)/save |
119 |
+ -rm -rf ${DESTDIR}$(GAMEDIR) ${DESTDIR}$(VARDIR) |
122 |
+ -if test -n '${DESTDIR}$(SHELLDIR)'; then \ |
120 |
+ -mkdir -p ${DESTDIR}$(GAMEDIR) ${DESTDIR}$(VARDIR) |
123 |
+ mkdir -p ${DESTDIR}$(SHELLDIR); fi |
121 |
-rmdir ./-p |
124 |
+ rm -rf ${DESTDIR}$(INSTDIR) ${DESTDIR}$(VARDIR) |
122 |
- -$(CHOWN) $(GAMEUID) $(GAMEDIR) $(VARDIR) $(VARDIR)/save |
125 |
+ -mkdir -p ${DESTDIR}$(INSTDIR) ${DESTDIR}$(VARDIR) ${DESTDIR}$(VARDIR)/save |
123 |
- $(CHGRP) $(GAMEGRP) $(GAMEDIR) $(VARDIR) $(VARDIR)/save |
126 |
if test -d ./-p; then rmdir ./-p; fi |
124 |
- chmod $(DIRPERM) $(GAMEDIR) $(VARDIR) $(VARDIR)/save |
127 |
- -$(CHOWN) $(GAMEUID) $(INSTDIR) $(VARDIR) $(VARDIR)/save |
|
|
128 |
- $(CHGRP) $(GAMEGRP) $(INSTDIR) $(VARDIR) $(VARDIR)/save |
129 |
# order counts here: |
130 |
- chmod $(DIRPERM) $(INSTDIR) |
131 |
- chmod $(VARDIRPERM) $(VARDIR) $(VARDIR)/save |
125 |
# set up the game files |
132 |
# set up the game files |
126 |
( $(MAKE) dofiles ) |
133 |
( $(MAKE) dofiles ) |
127 |
# set up some additional files |
134 |
# set up some additional files |
128 |
- touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile |
135 |
- touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile $(VARDIR)/xlogfile |
129 |
- -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile ; \ |
136 |
- -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile xlogfile ; \ |
130 |
- $(CHGRP) $(GAMEGRP) perm record logfile ; \ |
137 |
- $(CHGRP) $(GAMEGRP) perm record logfile xlogfile ; \ |
131 |
- chmod $(FILEPERM) perm record logfile ) |
138 |
- chmod $(VARFILEPERM) perm record logfile xlogfile ) |
132 |
+ touch ${DESTDIR}$(VARDIR)/perm ${DESTDIR}$(VARDIR)/record ${DESTDIR}$(VARDIR)/logfile |
139 |
+ touch ${DESTDIR}$(VARDIR)/perm ${DESTDIR}$(VARDIR)/record ${DESTDIR}$(VARDIR)/logfile ${DESTDIR}$(VARDIR)/xlogfile |
|
|
140 |
true; $(POSTINSTALL) |
133 |
# and a reminder |
141 |
# and a reminder |
134 |
@echo You may also want to reinstall the man pages via the doc Makefile. |
142 |
@echo You may also want to reinstall the man pages via the doc Makefile. |
135 |
|
|
|