[Lunar-commits] <moonbase-other> nethack: cleanup

v4hn me at v4hn.de
Tue Oct 22 17:00:10 CEST 2013


commit c8ece857551e84d5e7d5b029459fde0aa07d423a
Author: v4hn <me at v4hn.de>
Date: Tue, 22 Oct 2013 07:29:42 -0700
URL: https://github.com/lunar-linux/moonbase-other/commit/c8ece857551e84d5e7d5b029459fde0aa07d423a

nethack: cleanup

Split /usr/games/lib/nethackdir into
/usr/lib/games/nethack and /var/games/nethack
This change was overdue. Also fix a couple some
permission problems and Xpm support.
---
  games/nethack/BUILD     | +4/-1     
  games/nethack/DEPENDS   | +1/-1     
  games/nethack/DETAILS   | +1/-1     
  games/nethack/PRE_BUILD | +32/-25   
  4 files changed, 38 insertions(+), 28 deletions(-)

--- a/games/nethack/BUILD
+++ b/games/nethack/BUILD
@@ -1,4 +1,7 @@
 sh sys/unix/setup.sh &&
 
 default_make &&
-chmod 0775 /usr/games/lib/nethackdir
+
+chmod 0775 /var/games/nethack{,/save} &&
+
+install -Dm0644 {doc,/usr/man/man6}/nethack.6
--- a/games/nethack/DEPENDS
+++ b/games/nethack/DEPENDS
@@ -3,4 +3,4 @@ depends bison
 depends gzip
 
 optional_depends libX11 "" " " "for X11 frontend"
-optional_depends libXpm "" " " "for XPM file support"
+optional_depends libXpm "" " " "for XPM image support(only if X11 enabled)"
--- a/games/nethack/DETAILS
+++ b/games/nethack/DETAILS
@@ -6,7 +6,7 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/$MODULE-$VERSION/
        SOURCE_VFY=21479c95990eefe7650df582426457f9
         WEB_SITE=http://www.nethack.org
          ENTERED=20070526
-         UPDATED=20070526
+         UPDATED=20131022
            SHORT="single player dungeon exploration game"
 
 cat << EOF
--- a/games/nethack/PRE_BUILD
+++ b/games/nethack/PRE_BUILD
@@ -1,36 +1,43 @@
 default_pre_build &&
 
 if in_depends $MODULE libX11; then
-  sedit 's:/\* #define X11_GRAPHICS \*/:#define X11_GRAPHICS:' include/config.h &&
-  sedit 's:^WINX11LIB = -lXaw -lXmu -lXext -lXt -lX11:WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11:' sys/unix/Makefile.src &&
-  sedit 's:^# WINSRC = $(WINTTYSRC):WINSRC = $(WINTTYSRC) $(WINX11SRC):' sys/unix/Makefile.src &&
-  sedit 's:^WINOBJ = $(WINTTYOBJ):WINOBJ = $(WINTTYOBJ) $(WINX11OBJ):' sys/unix/Makefile.src &&
-  sedit 's:^# LFLAGS = -L/usr/X11R6/lib:LFLAGS = -L/usr/X11R6/lib:' sys/unix/Makefile.src &&
-  sedit 's:^WINLIB = $(WINTTYLIB):WINLIB = $(WINTTYLIB) $(WINX11LIB):' sys/unix/Makefile.src
+  sedit '/#define X11_GRAPHICS/ c #define X11_GRAPHICS' include/config.h &&
+
+  # add X11 makefile targets - no joke, this has to be done by hand
+  sedit '/^WINSRC = $(WINTTYSRC)/ c WINSRC = $(WINTTYSRC) $(WINX11SRC)
+         /^WINOBJ = $(WINTTYOBJ)/ c WINOBJ = $(WINTTYOBJ) $(WINX11OBJ)
+         /^WINLIB = $(WINTTYLIB)/ c WINLIB = $(WINTTYLIB) $(WINX11LIB)' sys/unix/Makefile.src &&
+
+  # modern xrdb complains about ' characters
+  sedit "s:':\`:g" win/X11/NetHack.ad
 fi &&
 
 if in_depends $MODULE libXpm; then
-  sedit 's:/\* #define USE_XPM \*/:#define USE_XPM:' include/config.h
-fi &&
+  sedit '/\/\* # define USE_XPM/ c #define USE_XPM' include/config.h &&
+  # add -lXpm
+  sedit '/^WINX11LIB =/ c WINX11LIB = -lXaw -lXmu -lXext -lXt -lXpm -lX11' sys/unix/Makefile.src
 
-sedit 's:/^#define COMPRESS.*$:#define COMPRESS "/bin/gzip":'               include/config.h &&
-sedit 's:/^#define COMPRESS_EXTENSION.*$:#define COMPRESS_EXTENSION ".gz":'  include/config.h &&
-sedit 's:/\* #define DLB \*/:#define DLB:'                                     include/config.h &&
-sedit 's:/\* #define AUTOPICKUP_EXTENSIONS \*/:#define AUTOPICKUP_EXTENSIONS:' include/config.h &&
+  sedit '/NetHack\.tile_file/       c NetHack.tile_file: x11tiles
+         /NetHack\.pet_mark_bitmap/ c NetHack.pet_mark_bitmap: pet_mark.xbm
+         /NetHack\.pet_mark_color/  c NetHack.pet_mark_color: Red
+	 /NetHack\.tombstone/       c NetHack.tombstone: rip.xpm' win/X11/NetHack.ad
+fi &&
 
-sedit 's:/\* #define LINUX \*/:#define LINUX:'             include/unixconf.h &&
-sedit 's:/\* #define TIMED_DELAY \*/:#define TIMED_DELAY:' include/unixconf.h &&
+sedit '/# *define HACKDIR "\/usr/             c #define HACKDIR  "/usr/lib/games/nethack"
+       /#define COMPRESS "\/usr\/bin\/compress"/ c #define COMPRESS "/bin/gzip"
+       /#define COMPRESS_EXTENSION.*/         c #define COMPRESS_EXTENSION ".gz"
+       /#define DLB/                          c #define DLB' include/config.h &&
 
-sedit 's:^# CC = gcc *$:CC = gcc:'  sys/unix/Makefile.src &&
-sedit 's:^WINTTYLIB = -ltermlib:WINTTYLIB = -lncurses:' sys/unix/Makefile.src &&
+sedit '/#define LINUX/          c #define LINUX
+       /#define TIMED_DELAY/    c #define TIMED_DELAY
+       /#define VAR_PLAYGROUND/ c #define VAR_PLAYGROUND "/var/games/nethack"' include/unixconf.h &&
 
-sedit 's:^# CC = gcc *$:CC = gcc:' sys/unix/Makefile.utl &&
-sedit 's:^# FLAGS = -L/sr/X11R6/lib:LFLAGS = -L/usr/X11R6/lib:' sys/unix/Makefile.utl &&
-sedit 's:^YACC *= yacc:YACC = bison -y:' sys/unix/Makefile.utl &&
-sedit 's:^LEX *= lex:LEX = flex:' sys/unix/Makefile.utl &&
+sedit '/^WINTTYLIB =/  c WINTTYLIB = -lncurses' sys/unix/Makefile.src &&
 
-sedit 's:^GAMEGRP *= bin:GAMEGRP = games:' sys/unix/Makefile.top &&
-sedit 's:^GAMEPERM = 04755:GAMEPERM = 02755:' sys/unix/Makefile.top &&
-sedit 's:^FILEPERM = 0644:FILEPERM = 0664:' sys/unix/Makefile.top &&
-sedit 's:^DIRPERM = 0755:DIRPERM = 0775:' sys/unix/Makefile.top &&
-sedit 's:^VERDATND =.*$:VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm:' sys/unix/Makefile.top
+sedit '/GAMEGRP *= bin/   c GAMEGRP = games
+       /GAMEPERM = 04755/ c GAMEPERM = 02755
+       /FILEPERM = 0644/  c FILEPERM = 0664
+       /DIRPERM = 0755/   c DIRPERM = 0775
+       /GAMEDIR *=/       c GAMEDIR = /usr/lib/games/nethack
+       /VARDIR *=/        c VARDIR = /var/games/nethack
+       /^VARDATND =/      c VARDATND = x11tiles NetHack.ad pet_mark.xbm rip.xpm' sys/unix/Makefile.top




More information about the Lunar-commits mailing list