chiark / gitweb /
preload-hacks: Some patches to make it work.
[termux-packages] / packages / moria / unix-Makefile.patch
1 diff --git a/unix/Makefile b/unix/Makefile
2 index e65338f..e169edf 100644
3 --- a/unix/Makefile
4 +++ b/unix/Makefile
5 @@ -1,5 +1,5 @@
6  # Edited for Debian GNU/Linux.
7 -DESTDIR =
8 +DESTDIR = @TERMUX_PREFIX@
9  
10  # DEBIAN NOTE: This file diverges significantly from the original Makefile
11  #   for obvious reasons.  The original Makefile is Makefile.unix and should
12 @@ -16,9 +16,9 @@ DESTDIR =
13  # Edited for Debian GNU/Linux: LIBVARDIR is where the score file is kept
14  # OWNER is who you want the game to be chown to.
15  # GROUP is who you wnat the game to be chgrp to.
16 -BINDIR = $(DESTDIR)/usr/games
17 +BINDIR = $(DESTDIR)/bin
18  ETCDIR = $(DESTDIR)/etc
19 -LIBSTATICDIR = $(DESTDIR)/usr/lib/games/moria
20 +LIBSTATICDIR = $(DESTDIR)/lib/games/moria
21  LIBVARDIR = $(DESTDIR)/var/games/moria
22  OWNER = root
23  GROUP = games
24 @@ -26,7 +26,7 @@ GROUP = games
25  # For testing and debugging the program, it is best to use this line.
26  # CFLAGS = -g
27  # For playing the game, you may want to use this line
28 -CFLAGS = -O2
29 +CFLAGS += -O2
30  
31  # Debian GNU/Linux addition
32  ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
33 @@ -36,7 +36,7 @@ endif
34  # For BSD Systems
35  # CURSES = -lcurses -ltermcap
36  # For SYS V Systems
37 -CURSES = -lcurses
38 +CURSES = -lncurses 
39  # For XENIX, some XENIX systems may need -ltinfo
40  # CURSES = -ltcap -ltermcap -lx
41  
42 @@ -44,9 +44,9 @@ CURSES = -lcurses
43  # config.h if you use this.
44  #LFLAGS = -lbsd
45  # Normal systems don't require anything here.
46 -LFLAGS = 
47 +LFLAGS ?= 
48  
49 -CC = cc
50 +CC ?= cc
51  
52  SRCS = main.c misc1.c misc2.c misc3.c misc4.c store1.c files.c io.c \
53         create.c desc.c generate.c sets.c dungeon.c creature.c death.c \
54 @@ -66,7 +66,7 @@ LIBSTATICFILES = news origcmds.hlp owizcmds.hlp roglcmds.hlp rwizcmds.hlp \
55         version.hlp welcome.hlp
56  
57  moria : $(OBJS)
58 -       $(CC) -o moria $(CFLAGS) $(OBJS) $(CURSES) $(LFLAGS)
59 +       $(CC) -o moria $(CFLAGS) $(LDFLAGS) $(OBJS) $(CURSES) $(LFLAGS)
60  
61  lintout : $(SRCS)
62         lint $(SRCS) $(CURSES) > lintout
63 @@ -80,21 +80,16 @@ TAGS : $(SRCS)
64  # you must define BINDIR and LIBDIR before installing
65  # assumes that BINDIR and LIBDIR exist
66  install:
67 -       chmod 755 $(BINDIR)
68         cp moria $(BINDIR)
69 -       chown $(OWNER) $(BINDIR)/moria
70 -       chgrp $(GROUP) $(BINDIR)/moria
71         chmod 2755 $(BINDIR)/moria
72 +       mkdir -p $(LIBSTATICDIR)
73         chmod 755 $(LIBSTATICDIR)
74         # No longer chmod 755 $(LIBVARDIR)
75         (cd files; cp $(LIBSTATICFILES) $(LIBSTATICDIR))
76 -       (cd $(LIBSTATICDIR); chmod 444 $(LIBSTATICFILES))
77         # No longer (cd $(LIBVARDIR); touch scores; chmod 664 scores)
78         # No longer (cd $(LIBVARDIR); chown $(OWNER) . scores; chgrp $(GROUP) . scores)
79         (cd files; cp hours $(ETCDIR)/moria-hours)
80         chmod 644 $(ETCDIR)/moria-hours
81 -       (cd $(LIBSTATICDIR); chown $(OWNER) $(LIBSTATICFILES))
82 -       (cd $(LIBSTATICDIR); chgrp $(GROUP) $(LIBSTATICFILES))
83  # If you are short on disk space, or aren't interested in debugging moria.
84         # This is handled by dh_strip, so let's not override its' decision.
85         # strip $(BINDIR)/moria