Lines 1-96
Link Here
|
1 |
--- sys/unix/Makefile.top.orig 2021-03-22 22:28:14 UTC |
1 |
--- sys/unix/Makefile.top.orig 2022-03-07 23:57:15 UTC |
2 |
+++ sys/unix/Makefile.top |
2 |
+++ sys/unix/Makefile.top |
3 |
@@ -20,18 +20,18 @@ NHSROOT=. |
3 |
@@ -25,15 +25,15 @@ NHSROOT=. |
4 |
|
4 |
GAME = xnethack |
5 |
# make NetHack |
|
|
6 |
#PREFIX = /usr |
7 |
-GAME = xnethack |
8 |
+GAME = xnethack |
9 |
# GAME = nethack.prg |
5 |
# GAME = nethack.prg |
10 |
#GAMEUID = games |
6 |
#GAMEUID = games |
11 |
-#GAMEGRP = bin |
7 |
-#GAMEGRP = bin |
12 |
+GAMEGRP = games |
8 |
+GAMEGRP = games |
13 |
|
9 |
|
14 |
# Permissions - some places use setgid instead of setuid, for instance |
10 |
# Permissions - some places use setgid instead of setuid, for instance. |
15 |
# See also the option "SECURE" in include/config.h |
11 |
# See also the option "SECURE" in include/config.h. |
16 |
-#GAMEPERM = 04755 |
12 |
-#GAMEPERM = 04755 |
17 |
-FILEPERM = 0644 |
|
|
18 |
+GAMEPERM = 02755 |
13 |
+GAMEPERM = 02755 |
19 |
+FILEPERM = 0664 |
14 |
FILEPERM = 0644 |
20 |
# VARFILEPERM = 0644 |
15 |
# VARFILEPERM = 0644 |
21 |
EXEPERM = 0755 |
16 |
EXEPERM = 0755 |
22 |
-DIRPERM = 0755 |
17 |
-DIRPERM = 0755 |
23 |
+DIRPERM = 0775 |
18 |
+DIRPERM = 0775 |
24 |
# VARDIRPERM = 0755 |
19 |
# VARDIRPERM = 0755 |
25 |
|
20 |
|
26 |
# VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else HACKDIR |
21 |
# VARDIR may also appear in unixconf.h as "VAR_PLAYGROUND" else HACKDIR |
27 |
@@ -41,14 +41,15 @@ DIRPERM = 0755 |
22 |
@@ -44,10 +44,12 @@ DIRPERM = 0755 |
28 |
# therefore there should not be anything in HACKDIR that you want to keep |
23 |
# keep (if there is, you'll have to do the installation by hand or |
29 |
# (if there is, you'll have to do the installation by hand or modify the |
24 |
# modify the install commands below). |
30 |
# instructions) |
25 |
#HACKDIR = $(PREFIX)/games/lib/$(GAME)dir |
31 |
-#HACKDIR = $(PREFIX)/games/lib/$(GAME)dir |
|
|
32 |
-#VARDIR = $(HACKDIR) |
26 |
-#VARDIR = $(HACKDIR) |
33 |
+HACKDIR = %%HACKDIR%% |
27 |
+HACKDIR = %%HACKDIR%% |
|
|
28 |
+INSTDIR = ${HACKDIR} |
34 |
+VARDIR = $(HACKDIR) |
29 |
+VARDIR = $(HACKDIR) |
35 |
+INSTDIR = $(HACKDIR) |
30 |
# Where nethack.sh is installed (as 'nethack'). |
36 |
# Where nethack.sh in installed. If this is not defined, the wrapper is not used. |
31 |
# If this is not defined, the shell wrapper script is not used. |
37 |
-#SHELLDIR = $(PREFIX)/games |
32 |
-#SHELLDIR = $(PREFIX)/games |
38 |
+SHELLDIR = ${PREFIX}/bin |
33 |
+SHELLDIR = $(PREFIX)/bin |
39 |
|
34 |
|
|
|
35 |
# Extra data files depending upon the interface(s) built into nethack. |
40 |
# per discussion in Install.X11 and Install.Qt |
36 |
# per discussion in Install.X11 and Install.Qt |
41 |
#VARDATND = |
37 |
@@ -62,7 +64,7 @@ DIRPERM = 0755 |
42 |
# VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm |
38 |
# X11 with GRAPHIC_TOMBSTONE (requires 'xpm'): |
43 |
-# VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm rip.xpm |
39 |
# VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm rip.xpm |
44 |
+VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm |
40 |
# both X11 and Qt: |
45 |
# for Atari/Gem |
41 |
-# VARDATND = x11tiles nhtiles.bmp NetHack.ad pet_mark.xbm pilemark.xbm rip.xpm |
46 |
# VARDATND = nh16.img title.img GEM_RSC.RSC rip.img |
42 |
+VARDATND = x11tiles nhtiles.bmp NetHack.ad pet_mark.xbm pilemark.xbm rip.xpm |
47 |
@@ -75,7 +76,7 @@ VARDAT = $(VARDATD) $(VARDATND) |
43 |
# Qt without X11; assumes GRAPHIC_TOMBSTONE: |
48 |
#CHGRP = chgrp |
44 |
# VARDATND = nhtiles.bmp pet_mark.xbm pilemark.xbm rip.xpm |
49 |
|
|
|
50 |
# Lua version |
51 |
-LUA_VERSION = 5.4.2 |
52 |
+LUA_VERSION = ${LUA_VER} |
53 |
|
45 |
|
54 |
# |
46 |
@@ -123,7 +125,7 @@ all: $(ALLDEP) |
55 |
# end of configuration |
|
|
56 |
@@ -108,7 +109,7 @@ all: $(ALLDEP) |
57 |
$(GAME): lua_support |
47 |
$(GAME): lua_support |
58 |
( cd src ; $(MAKE) $(GAME) ) |
48 |
( cd src ; $(MAKE) $(GAME) ) |
59 |
|
49 |
|
60 |
-lua_support: $(TOPLUALIB) include/nhlua.h |
50 |
-lua_support: $(TOPLUALIB) include/nhlua.h |
61 |
+lua_support: include/nhlua.h |
51 |
+lua_support: include/nhlua.h |
62 |
@true |
52 |
@true |
63 |
lib/lua-$(LUA_VERSION)/src/liblua.a: lib/lua-$(LUA_VERSION)/src/lua.h |
53 |
$(LUATOP)/liblua.a: $(LUAHEADERS)/lua.h |
64 |
( cd lib/lua-$(LUA_VERSION)/src \ |
54 |
( cd $(LUATOP) \ |
65 |
@@ -116,13 +117,11 @@ lib/lua-$(LUA_VERSION)/src/liblua.a: lib/lua-$(LUA_VER |
55 |
@@ -131,13 +133,11 @@ $(LUATOP)/liblua.a: $(LUAHEADERS)/lua.h |
66 |
lib/lua/liblua.a: lib/lua-$(LUA_VERSION)/src/liblua.a |
56 |
lib/lua/liblua.a: $(LUATOP)/liblua.a |
67 |
@( if [ ! -d lib/lua ] ; then mkdir -p lib/lua ; fi ) |
57 |
@( if test -d lib/lua ; then true ; else mkdir -p lib/lua ; fi ) |
68 |
cp lib/lua-$(LUA_VERSION)/src/liblua.a $@ |
58 |
cp $(LUATOP)/liblua.a $@ |
69 |
-include/nhlua.h: $(TOPLUALIB) |
59 |
-include/nhlua.h: $(TOPLUALIB) |
70 |
+include/nhlua.h: |
60 |
+include/nhlua.h: |
71 |
echo '/* nhlua.h - generated by top Makefile */' > $@ |
61 |
echo '/* nhlua.h - generated by top Makefile */' > $@ |
72 |
- @echo '#include "../lib/lua-$(LUA_VERSION)/src/lua.h"' >> $@ |
62 |
- @echo '#include "../$(LUAHEADERS)/lua.h"' >> $@ |
73 |
- @sed -e '/(lua_error)/!d' -e '/(lua_error)/s/;/ NORETURN;/1' \ |
63 |
- @sed -e '/(lua_error)/!d' -e '/(lua_error)/s/;/ NORETURN;/1' \ |
74 |
- < lib/lua-$(LUA_VERSION)/src/lua.h >> $@ |
64 |
- < $(LUAHEADERS)/lua.h >> $@ |
75 |
- @echo '#include "../lib/lua-$(LUA_VERSION)/src/lualib.h"' >> $@ |
65 |
- @echo '#include "../$(LUAHEADERS)/lualib.h"' >> $@ |
76 |
- @echo '#include "../lib/lua-$(LUA_VERSION)/src/lauxlib.h"' >> $@ |
66 |
- @echo '#include "../$(LUAHEADERS)/lauxlib.h"' >> $@ |
77 |
+ @echo '#include <lua.h>' >> $@ |
67 |
+ @echo '#include <lua.h>' >> $@ |
78 |
+ @echo '#include <lualib.h>' >> $@ |
68 |
+ @echo '#include <lualib.h>' >> $@ |
79 |
+ @echo '#include <lauxlib.h>' >> $@ |
69 |
+ @echo '#include <lauxlib.h>' >> $@ |
80 |
@echo '/*nhlua.h*/' >> $@ |
70 |
@echo '/*nhlua.h*/' >> $@ |
81 |
|
71 |
# LUATESTTARGET is this by default |
82 |
# Note: many of the dependencies below are here to allow parallel make |
72 |
lib/lua-$(LUA_VERSION)/src/lua.h: |
83 |
@@ -234,39 +233,22 @@ dofiles: |
73 |
@@ -258,39 +258,22 @@ dofiles: |
84 |
-e '}' \ |
74 |
-e '}' \ |
85 |
-e '$$s/.*/nodlb/p' < dat/options` ; \ |
75 |
-e '$$s/.*/nodlb/p' < dat/options` ; \ |
86 |
$(MAKE) dofiles-$${target-nodlb} |
76 |
$(MAKE) dofiles-$${target-nodlb} |
87 |
- cp src/$(GAME) $(INSTDIR) |
77 |
- cp src/$(GAME) $(INSTDIR) |
88 |
- cp util/recover $(INSTDIR) |
78 |
- cp util/recover $(INSTDIR) |
89 |
- -if test -n '$(SHELLDIR)'; then rm -f $(SHELLDIR)/$(GAME); fi |
79 |
- -if test -n '$(SHELLDIR)'; then rm -f $(SHELLDIR)/$(GAME); fi |
|
|
80 |
- if test -n '$(SHELLDIR)'; then \ |
90 |
+ cp src/$(GAME) ${DESTDIR}$(INSTDIR)/$(GAME) |
81 |
+ cp src/$(GAME) ${DESTDIR}$(INSTDIR)/$(GAME) |
91 |
+ cp util/recover ${DESTDIR}$(INSTDIR) |
82 |
+ cp util/recover ${DESTDIR}$(INSTDIR) |
92 |
+ -if test -n '${DESTDIR}$(SHELLDIR)'; then rm -f ${DESTDIR}$(SHELLDIR)/$(GAME); fi |
83 |
+ -if test -n '${DESTDIR}$(SHELLDIR)'; then rm -f ${DESTDIR}$(SHELLDIR)/$(GAME); fi |
93 |
if test -n '$(SHELLDIR)'; then \ |
84 |
+ if test -n '${DESTDIR}$(SHELLDIR)'; then \ |
94 |
sed -e 's;/usr/games/lib/nethackdir;$(HACKDIR);' \ |
85 |
sed -e 's;/usr/games/lib/nethackdir;$(HACKDIR);' \ |
95 |
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \ |
86 |
-e 's;HACKDIR/nethack;HACKDIR/$(GAME);' \ |
96 |
< sys/unix/nethack.sh \ |
87 |
< sys/unix/nethack.sh \ |
Lines 127-148
Link Here
|
127 |
# |
118 |
# |
128 |
# This is not part of the dependency build hierarchy. |
119 |
# This is not part of the dependency build hierarchy. |
129 |
# It requires an explicit "make fetch-Lua". |
120 |
# It requires an explicit "make fetch-Lua". |
130 |
@@ -283,13 +265,9 @@ fetch-Lua: |
121 |
@@ -327,25 +310,17 @@ install: rootcheck $(GAME) recover $(VARDAT) spec_levs |
131 |
update: $(GAME) recover $(VARDAT) spec_levs |
|
|
132 |
# (don't yank the old version out from under people who're playing it) |
133 |
-mv $(INSTDIR)/$(GAME) $(INSTDIR)/$(GAME).old |
134 |
- -mv $(INSTDIR)/nhdat $(INSTDIR)/nhdat.old |
135 |
+ -mv ${DESTDIR}$(INSTDIR)/nhdat ${DESTDIR}$(INSTDIR)/nhdat.old |
136 |
# set up new versions of the game files |
137 |
( $(MAKE) dofiles ) |
138 |
-# touch time-sensitive files |
139 |
- -touch -c $(VARDIR)/bones* $(VARDIR)/?lock* $(VARDIR)/wizard* |
140 |
- -touch -c $(VARDIR)/save/* $(VARDIR)/whereis/* |
141 |
- touch $(VARDIR)/perm $(VARDIR)/record |
142 |
# and a reminder |
143 |
@echo You may also want to install the man pages via the doc Makefile. |
144 |
|
145 |
@@ -300,25 +278,16 @@ install: rootcheck $(GAME) recover $(VARDAT) spec_levs |
146 |
true; $(PREINSTALL) |
122 |
true; $(PREINSTALL) |
147 |
# set up the directories |
123 |
# set up the directories |
148 |
# not all mkdirs have -p; those that don't will create a -p directory |
124 |
# not all mkdirs have -p; those that don't will create a -p directory |
Lines 153-159
Link Here
|
153 |
+ -if test -n '${DESTDIR}$(SHELLDIR)'; then \ |
129 |
+ -if test -n '${DESTDIR}$(SHELLDIR)'; then \ |
154 |
+ mkdir -p ${DESTDIR}$(SHELLDIR); fi |
130 |
+ mkdir -p ${DESTDIR}$(SHELLDIR); fi |
155 |
+ rm -rf ${DESTDIR}$(INSTDIR) ${DESTDIR}$(VARDIR) |
131 |
+ rm -rf ${DESTDIR}$(INSTDIR) ${DESTDIR}$(VARDIR) |
156 |
+ -mkdir -p ${DESTDIR}$(INSTDIR) ${DESTDIR}$(VARDIR) ${DESTDIR}$(VARDIR)/save ${DESTDIR}$(VARDIR)/whereis |
132 |
+ -mkdir -p ${DESTDIR}$(INSTDIR) ${DESTDIR}$(VARDIR)/save ${DESTDIR}$(VARDIR)/whereis |
157 |
if test -d ./-p; then rmdir ./-p; fi |
133 |
if test -d ./-p; then rmdir ./-p; fi |
158 |
- -$(CHOWN) $(GAMEUID) $(INSTDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/whereis |
134 |
- -$(CHOWN) $(GAMEUID) $(INSTDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/whereis |
159 |
- $(CHGRP) $(GAMEGRP) $(INSTDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/whereis |
135 |
- $(CHGRP) $(GAMEGRP) $(INSTDIR) $(VARDIR) $(VARDIR)/save $(VARDIR)/whereis |
Lines 163-175
Link Here
|
163 |
# set up the game files |
139 |
# set up the game files |
164 |
( $(MAKE) dofiles ) |
140 |
( $(MAKE) dofiles ) |
165 |
# set up some additional files |
141 |
# set up some additional files |
166 |
- touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile \ |
142 |
- touch $(VARDIR)/perm $(VARDIR)/record $(VARDIR)/logfile $(VARDIR)/xlogfile \ |
167 |
- $(VARDIR)/xlogfile $(VARDIR)/livelog |
143 |
- $(VARDIR)/livelog |
168 |
- -( cd $(VARDIR) ; \ |
144 |
- -( cd $(VARDIR) ; $(CHOWN) $(GAMEUID) perm record logfile xlogfile livelog ; \ |
169 |
- $(CHOWN) $(GAMEUID) perm record logfile xlogfile livelog ; \ |
145 |
- $(CHGRP) $(GAMEGRP) perm record logfile xlogfile livelog ; \ |
170 |
- $(CHGRP) $(GAMEGRP) perm record logfile xlogfile livelog ; \ |
146 |
- chmod $(VARFILEPERM) perm record logfile xlogfile livelog ) |
171 |
- chmod $(VARFILEPERM) perm record logfile xlogfile livelog ) |
147 |
- true; $(POSTINSTALL) |
172 |
+ touch ${DESTDIR}$(VARDIR)/perm ${DESTDIR}$(VARDIR)/record ${DESTDIR}$(VARDIR)/logfile ${DESTDIR}$(VARDIR)/xlogfile |
148 |
+ touch ${DESTDIR}$(VARDIR)/perm ${DESTDIR}$(VARDIR)/record \ |
173 |
true; $(POSTINSTALL) |
149 |
+ ${DESTDIR}$(VARDIR)/logfile ${DESTDIR}$(VARDIR)/xlogfile ${DESTDIR}$(VARDIR)/livelog |
174 |
# and a reminder |
150 |
# and a reminder |
175 |
@echo You may also want to reinstall the man pages via the doc Makefile. |
151 |
@echo You may also want to reinstall the man pages via the doc Makefile. |
|
|
152 |
|