1 |
commit: 9d33d1d4b8e9578da5466ab11e9b162b80c357c4 |
2 |
Author: Luis Ressel <aranea <AT> aixah <DOT> de> |
3 |
AuthorDate: Sat Dec 26 00:18:44 2015 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 30 00:20:35 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9d33d1d4 |
7 |
|
8 |
games-roguelike/nethack: Bump to 3.6.0 |
9 |
|
10 |
Thorough ebuild rewrite. |
11 |
|
12 |
Gentoo-Bug: 567762 |
13 |
|
14 |
games-roguelike/nethack/Manifest | 1 + |
15 |
.../nethack/files/nethack-3.6.0-hint-tty | 19 +++ |
16 |
.../nethack/files/nethack-3.6.0-hint-x11 | 23 +++ |
17 |
.../nethack/files/nethack-3.6.0-recover.patch | 110 +++++++++++++ |
18 |
games-roguelike/nethack/nethack-3.6.0.ebuild | 179 +++++++++++++++++++++ |
19 |
5 files changed, 332 insertions(+) |
20 |
|
21 |
diff --git a/games-roguelike/nethack/Manifest b/games-roguelike/nethack/Manifest |
22 |
index 8776166..5808cc3 100644 |
23 |
--- a/games-roguelike/nethack/Manifest |
24 |
+++ b/games-roguelike/nethack/Manifest |
25 |
@@ -1 +1,2 @@ |
26 |
DIST nethack-343-src.tgz 3497458 SHA256 bb39c3d2a9ee2df4a0c8fdde708fbc63740853a7608d2f4c560b488124866fe4 SHA512 052342c19619219f291571d48cf7799f962eb6ec6f8a276427225c0abbd833eada18abeff9fbd647919f2a9e3bb097d7f154675e283fe48abc4752f24c192d8f WHIRLPOOL 397c787f83149d96ddbfa6a2235c20c3724ed67946889d432774901cb7ddc71b177e2cbd6c3029f4eb0b4df21c81c6a427494dad550fdbace01876a3d9c79d75 |
27 |
+DIST nethack-360-src.tgz 4261282 SHA256 1ade698d8458b8d87a4721444cb73f178c74ed1b6fde537c12000f8edf2cb18a SHA512 92370a3c60a4f6861b9c0f1e1320fc23d91cedc1615d0d09e06a0ee3e13c9c8c0cd931389bfd7a25845ed07ef966d19d9e46e77ae07084a941685dc67f49c813 WHIRLPOOL 14ff7a8bcf06b18e5192a7478f1fcd25eb55ecc149d9fa8b80def95311a498ef8d172ee4ff7e69c62e36b2a190a0f14b4a3d4f61183a48676fa77e2e7268690c |
28 |
|
29 |
diff --git a/games-roguelike/nethack/files/nethack-3.6.0-hint-tty b/games-roguelike/nethack/files/nethack-3.6.0-hint-tty |
30 |
new file mode 100644 |
31 |
index 0000000..3c250e7 |
32 |
--- /dev/null |
33 |
+++ b/games-roguelike/nethack/files/nethack-3.6.0-hint-tty |
34 |
@@ -0,0 +1,19 @@ |
35 |
+#-PRE |
36 |
+ |
37 |
+LINK=$(CC) |
38 |
+ |
39 |
+WINSRC = $(WINTTYSRC) |
40 |
+WINOBJ = $(WINTTYOBJ) |
41 |
+WINLIB = $(WINTTYLIB) |
42 |
+ |
43 |
+GAMEPERM = 02755 |
44 |
+VARDIRPERM = 0770 |
45 |
+VARFILEPERM = 0660 |
46 |
+CHOWN = true |
47 |
+CHGRP = true |
48 |
+ |
49 |
+ |
50 |
+#-POST |
51 |
+ |
52 |
+# needed for external pager, bug #57410 |
53 |
+DATNODLB = $(VARDATND) license $(DATHELP) |
54 |
|
55 |
diff --git a/games-roguelike/nethack/files/nethack-3.6.0-hint-x11 b/games-roguelike/nethack/files/nethack-3.6.0-hint-x11 |
56 |
new file mode 100644 |
57 |
index 0000000..d0d1a8d |
58 |
--- /dev/null |
59 |
+++ b/games-roguelike/nethack/files/nethack-3.6.0-hint-x11 |
60 |
@@ -0,0 +1,23 @@ |
61 |
+#-PRE |
62 |
+ |
63 |
+LINK=$(CC) |
64 |
+ |
65 |
+VARDATND = x11tiles NetHack.ad pet_mark.xbm pilemark.xbm rip.xpm |
66 |
+ |
67 |
+WINSRC = $(WINTTYSRC) $(WINX11SRC) |
68 |
+WINOBJ = $(WINTTYOBJ) $(WINX11OBJ) |
69 |
+WINLIB = $(WINTTYLIB) $(WINX11LIB) |
70 |
+ |
71 |
+GAMEPERM = 02755 |
72 |
+VARDIRPERM = 0770 |
73 |
+VARFILEPERM = 0660 |
74 |
+CHOWN = true |
75 |
+CHGRP = true |
76 |
+ |
77 |
+ |
78 |
+#-POST |
79 |
+ |
80 |
+# needed for external pager, bug #57410 |
81 |
+DATNODLB = $(VARDATND) license $(DATHELP) |
82 |
+ |
83 |
+WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11 -lXpm |
84 |
|
85 |
diff --git a/games-roguelike/nethack/files/nethack-3.6.0-recover.patch b/games-roguelike/nethack/files/nethack-3.6.0-recover.patch |
86 |
new file mode 100644 |
87 |
index 0000000..c7e8ab3 |
88 |
--- /dev/null |
89 |
+++ b/games-roguelike/nethack/files/nethack-3.6.0-recover.patch |
90 |
@@ -0,0 +1,110 @@ |
91 |
+From c15cf56e61c908ce756d698a8afa3064030761b3 Mon Sep 17 00:00:00 2001 |
92 |
+From: Luis Ressel <aranea@×××××.de> |
93 |
+Date: Fri, 18 Dec 2015 23:16:56 +0100 |
94 |
+Subject: [PATCH] doc: Rename recover to recover-nethack |
95 |
+ |
96 |
+--- |
97 |
+ doc/recover.6 | 30 +++++++++++++++--------------- |
98 |
+ 1 file changed, 15 insertions(+), 15 deletions(-) |
99 |
+ |
100 |
+diff --git a/doc/recover.6 b/doc/recover.6 |
101 |
+index 4c9f509..edd05e3 100644 |
102 |
+--- a/doc/recover.6 |
103 |
++++ b/doc/recover.6 |
104 |
+@@ -1,10 +1,10 @@ |
105 |
+-.TH RECOVER 6 "9 January 1993" |
106 |
++.TH RECOVER-NETHACK 6 "9 January 1993" |
107 |
+ .\" NetHack 3.6 recover.6 $NHDT-Date: 1432512786 2015/05/25 00:13:06 $ $NHDT-Branch: master $:$NHDT-Revision: 1.6 $ |
108 |
+ .UC 4 |
109 |
+ .SH NAME |
110 |
+-recover \- recover a NetHack game interrupted by disaster |
111 |
++recover-nethack \- recover a NetHack game interrupted by disaster |
112 |
+ .SH SYNOPSIS |
113 |
+-.B recover |
114 |
++.B recover-nethack |
115 |
+ [ |
116 |
+ .B \-d |
117 |
+ .I directory |
118 |
+@@ -22,7 +22,7 @@ so such games can be recovered at the point of the last level change. |
119 |
+ The |
120 |
+ .I base |
121 |
+ options tell |
122 |
+-.I recover |
123 |
++.I recover-nethack |
124 |
+ which files to process. |
125 |
+ Each base option specifies recovery of a separate game. |
126 |
+ .PP |
127 |
+@@ -72,47 +72,47 @@ by a user number to avoid conflicts, |
128 |
+ or "xlock" if the number of concurrent players is being limited. |
129 |
+ It may be necessary to look in the playground to find the correct |
130 |
+ base name of the interrupted game. |
131 |
+-.I recover |
132 |
++.I recover-nethack |
133 |
+ will transform these level files into a save file of the same name as |
134 |
+ .I nethack |
135 |
+ would have used. |
136 |
+ .PP |
137 |
+ Since |
138 |
+-.I recover |
139 |
++.I recover-nethack |
140 |
+ must be able to read and delete files from the playground |
141 |
+ and create files in the save directory, |
142 |
+ it has interesting interactions with game security. |
143 |
+ Giving ordinary players access to |
144 |
+-.I recover |
145 |
++.I recover-nethack |
146 |
+ through setuid or setgid is tantamount to leaving the playground |
147 |
+ world-writable, |
148 |
+ with respect to both cheating and messing up other players. |
149 |
+ For a single-user system, this of course does not change anything, |
150 |
+ so some of the microcomputer ports install |
151 |
+-.I recover |
152 |
++.I recover-nethack |
153 |
+ by default. |
154 |
+ .PP |
155 |
+ For a multi-user system, |
156 |
+ the game administrator may want to arrange for all .0 files in the |
157 |
+-playground to be fed to recover when the host machine boots, |
158 |
++playground to be fed to recover-nethack when the host machine boots, |
159 |
+ and handle game crashes individually. |
160 |
+ If the user population is sufficiently trustworthy, |
161 |
+-.I recover |
162 |
++.I recover-nethack |
163 |
+ can be installed with the same permissions the |
164 |
+ .I nethack |
165 |
+ executable has. |
166 |
+ In either case, |
167 |
+-.I recover |
168 |
++.I recover-nethack |
169 |
+ is easily compiled from the distribution utility directory. |
170 |
+ .SH NOTES |
171 |
+ .PP |
172 |
+ Like |
173 |
+ .I nethack |
174 |
+ itself, |
175 |
+-.I recover |
176 |
++.I recover-nethack |
177 |
+ will overwrite existing savefiles of the same name. |
178 |
+ Savefiles created by |
179 |
+-.I recover |
180 |
++.I recover-nethack |
181 |
+ are uncompressed; |
182 |
+ they may be compressed afterwards if desired, |
183 |
+ but even a compression-using |
184 |
+@@ -122,11 +122,11 @@ will find them in the uncompressed form. |
185 |
+ nethack(6) |
186 |
+ .SH BUGS |
187 |
+ .PP |
188 |
+-.I recover |
189 |
++.I recover-nethack |
190 |
+ makes no attempt to find out if a base name specifies a game in progress. |
191 |
+ If multiple machines share a playground, this would be impossible to |
192 |
+ determine. |
193 |
+ .PP |
194 |
+-.I recover |
195 |
++.I recover-nethack |
196 |
+ should be taught to use the nethack playground locking mechanism to |
197 |
+ avoid conflicts. |
198 |
+-- |
199 |
+2.6.4 |
200 |
+ |
201 |
|
202 |
diff --git a/games-roguelike/nethack/nethack-3.6.0.ebuild b/games-roguelike/nethack/nethack-3.6.0.ebuild |
203 |
new file mode 100644 |
204 |
index 0000000..11c43ea |
205 |
--- /dev/null |
206 |
+++ b/games-roguelike/nethack/nethack-3.6.0.ebuild |
207 |
@@ -0,0 +1,179 @@ |
208 |
+# Copyright 1999-2015 Gentoo Foundation |
209 |
+# Distributed under the terms of the GNU General Public License v2 |
210 |
+# $Id$ |
211 |
+ |
212 |
+EAPI=5 |
213 |
+inherit eutils toolchain-funcs flag-o-matic user |
214 |
+ |
215 |
+MY_PV=${PV//.} |
216 |
+DESCRIPTION="The ultimate old-school single player dungeon exploration game" |
217 |
+HOMEPAGE="http://www.nethack.org/" |
218 |
+SRC_URI="mirror://sourceforge/nethack/${PN}-${MY_PV}-src.tgz" |
219 |
+ |
220 |
+LICENSE="nethack" |
221 |
+SLOT="0" |
222 |
+KEYWORDS="~amd64 ~hppa ~ppc ~sparc ~x86 ~x86-fbsd" |
223 |
+IUSE="X" |
224 |
+ |
225 |
+RDEPEND="sys-libs/ncurses:0= |
226 |
+ X? ( |
227 |
+ x11-libs/libXaw |
228 |
+ x11-libs/libXpm |
229 |
+ x11-libs/libXt |
230 |
+ )" |
231 |
+DEPEND="${RDEPEND} |
232 |
+ virtual/pkgconfig |
233 |
+ X? ( |
234 |
+ x11-proto/xproto |
235 |
+ x11-apps/bdftopcf |
236 |
+ x11-apps/mkfontdir |
237 |
+ )" |
238 |
+ |
239 |
+BINDIR="/usr/bin" |
240 |
+STATEDIR="/var/games/${PN}" |
241 |
+ |
242 |
+NETHACK_GROUP="gamestat" |
243 |
+ |
244 |
+pkg_setup() { |
245 |
+ HACKDIR="/usr/$(get_libdir)/${PN}" |
246 |
+ |
247 |
+ enewgroup gamestat 36 |
248 |
+} |
249 |
+ |
250 |
+src_prepare() { |
251 |
+ epatch "${FILESDIR}/${P}-recover.patch" |
252 |
+ epatch_user |
253 |
+ |
254 |
+ cp "${FILESDIR}/${P}-hint-$(usex X x11 tty)" hint || die "Failed to copy hint file" |
255 |
+ sys/unix/setup.sh hint || die "Failed to run setup.sh" |
256 |
+} |
257 |
+ |
258 |
+src_compile() { |
259 |
+ append-cflags -I../include -DDLB -DSECURE -DLINUX -DTIMED_DELAY -DVISION_TABLES |
260 |
+ append-cflags '-DCOMPRESS=\"/bin/gzip\"' '-DCOMPRESS_EXTENSION=\".gz\"' |
261 |
+ append-cflags "-DHACKDIR=\\\"${HACKDIR}\\\"" "-DVAR_PLAYGROUND=\\\"${STATEDIR}\\\"" |
262 |
+ append-cflags "-DLOCKDIR=\\\"${STATEDIR}\\\"" "-DDEF_PAGER=\\\"${PAGER}\\\"" |
263 |
+ append-cflags -DSYSCF "-DSYSCF_FILE=\\\"/etc/nethack.sysconf\\\"" |
264 |
+ |
265 |
+ use X && append-cflags -DX11_GRAPHICS -DUSE_XPM |
266 |
+ |
267 |
+ emake \ |
268 |
+ CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LFLAGS="${LDFLAGS}" \ |
269 |
+ WINTTYLIB="$($(tc-getPKG_CONFIG) --libs ncurses)" \ |
270 |
+ HACKDIR="${HACKDIR}" INSTDIR="${D}/${HACKDIR}" \ |
271 |
+ SHELLDIR="${D}/${BINDIR}" VARDIR="${D}/${STATEDIR}" \ |
272 |
+ nethack recover Guidebook spec_levs |
273 |
+ |
274 |
+ # Upstream still has some parallel compilation bugs |
275 |
+ emake -j1 \ |
276 |
+ CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LFLAGS="${LDFLAGS}" \ |
277 |
+ WINTTYLIB="$($(tc-getPKG_CONFIG) --libs ncurses)" \ |
278 |
+ HACKDIR="${HACKDIR}" INSTDIR="${D}/${HACKDIR}" \ |
279 |
+ SHELLDIR="${D}/${BINDIR}" VARDIR="${D}/${STATEDIR}" \ |
280 |
+ all |
281 |
+} |
282 |
+ |
283 |
+src_install() { |
284 |
+ emake \ |
285 |
+ CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LFLAGS="${LDFLAGS}" \ |
286 |
+ WINTTYLIB="$($(tc-getPKG_CONFIG) --libs ncurses)" \ |
287 |
+ HACKDIR="${HACKDIR}" INSTDIR="${D}/${HACKDIR}" \ |
288 |
+ SHELLDIR="${D}/${BINDIR}" VARDIR="${D}/${STATEDIR}" \ |
289 |
+ install |
290 |
+ |
291 |
+ exeinto "${BINDIR}" |
292 |
+ newexe util/recover recover-nethack |
293 |
+ rm "${D}/${HACKDIR}/recover" || die "Failed to remove HACKDIR/recover" |
294 |
+ |
295 |
+ doman doc/nethack.6 |
296 |
+ newman doc/recover.6 recover-nethack.6 |
297 |
+ dodoc doc/Guidebook.txt |
298 |
+ |
299 |
+ insinto /etc |
300 |
+ newins sys/unix/sysconf nethack.sysconf |
301 |
+ |
302 |
+ insinto /etc/skel |
303 |
+ newins "${FILESDIR}/dot.nethackrc" .nethackrc |
304 |
+ |
305 |
+ local windowtypes="tty" |
306 |
+ use X && windowtypes="x11 ${windowtypes}" |
307 |
+ set -- ${windowtypes} |
308 |
+ sed -i \ |
309 |
+ -e "s:GENTOO_WINDOWTYPES:${windowtypes}:" \ |
310 |
+ -e "s:GENTOO_DEFWINDOWTYPE:$1:" \ |
311 |
+ "${D}/etc/skel/.nethackrc" \ |
312 |
+ || die "sed /etc/skel/.nethackrc failed" |
313 |
+ |
314 |
+ if use X ; then |
315 |
+ cd "${S}/win/X11" || die "Failed to enter win/X11 directory" |
316 |
+ |
317 |
+ # copy nethack x application defaults |
318 |
+ insinto /etc/X11/app-defaults |
319 |
+ newins NetHack.ad NetHack |
320 |
+ rm "${D}/${HACKDIR}/NetHack.ad" || die "Failed to remove NetHack.ad" |
321 |
+ |
322 |
+ newicon nh_icon.xpm nethack.xpm |
323 |
+ make_desktop_entry ${PN} Nethack |
324 |
+ |
325 |
+ # install nethack fonts |
326 |
+ bdftopcf -o nh10.pcf nh10.bdf || die "Converting fonts failed" |
327 |
+ bdftopcf -o ibm.pcf ibm.bdf || die "Converting fonts failed" |
328 |
+ insinto "${HACKDIR}/fonts" |
329 |
+ doins *.pcf |
330 |
+ cd "${D}/${HACKDIR}/fonts" || die "Failed to enter fonts directory" |
331 |
+ mkfontdir || die "The action mkfontdir ${HACKDIR}/fonts failed" |
332 |
+ fi |
333 |
+ |
334 |
+ rm -r "${D}/${STATEDIR}" || die "Failed to clean STATEDIR" |
335 |
+ keepdir "${STATEDIR}/save" |
336 |
+ |
337 |
+ fowners -R "root:${NETHACK_GROUP}" "${STATEDIR}" |
338 |
+ fperms 770 "${STATEDIR}" "${STATEDIR}/save" |
339 |
+ |
340 |
+ fowners "root:${NETHACK_GROUP}" "${HACKDIR}/nethack" |
341 |
+ fperms g+s "${HACKDIR}/nethack" |
342 |
+} |
343 |
+ |
344 |
+pkg_preinst() { |
345 |
+ if has_version "<${CATEGORY}/${PN}-3.4.3-r3" ; then |
346 |
+ migration=true |
347 |
+ |
348 |
+ # preserve STATEDIR/{logfile,record} |
349 |
+ # (previous ebuild rev mistakenly removes it) |
350 |
+ for f in "${ROOT}/${STATEDIR}/"{logfile,record} ; do |
351 |
+ if [[ -e "$f" ]] ; then |
352 |
+ cp "$f" "$T" || die "Failed to preserve ${ROOT}/${STATEDIR} files" |
353 |
+ else |
354 |
+ touch "$T/$f" || die "Failed to preserve ${ROOT}/${STATEDIR} files" |
355 |
+ fi |
356 |
+ done |
357 |
+ fi |
358 |
+} |
359 |
+ |
360 |
+pkg_postinst() { |
361 |
+ cd "${ROOT}/${STATEDIR}" || die "Failed to enter ${STATEDIR} directory" |
362 |
+ |
363 |
+ if [[ -v migration ]] ; then |
364 |
+ cp "$T/"{logfile,record} . || |
365 |
+ die "Failed to preserve ${ROOT}/${STATEDIR} files" |
366 |
+ fi |
367 |
+ |
368 |
+ touch logfile perm record xlogfile || die "Failed to create log files" |
369 |
+ |
370 |
+ chown -R root:"${NETHACK_GROUP}" . && |
371 |
+ chmod -R 660 . && |
372 |
+ chmod 770 . save || |
373 |
+ die "Adjustment of file permissions in ${ROOT}/${STATEDIR} failed" |
374 |
+ |
375 |
+ touch -c bones* save/* # non-critical |
376 |
+ |
377 |
+ elog "A minimal default .nethackrc has been placed in /etc/skel/" |
378 |
+ elog "The sysconf file is at /etc/nethack.sysconf" |
379 |
+ |
380 |
+ if has_version "<${CATEGORY}/${PN}-3.6.0" ; then |
381 |
+ elog |
382 |
+ elog "Nethack 3.6 includes many new features." |
383 |
+ elog "You might want to review your options and local patchset." |
384 |
+ elog "Have a look at http://www.nethack.org/v360/release.html" |
385 |
+ fi |
386 |
+} |