From 23454acb66be2a88647262d98d50e0f115519ea0 Mon Sep 17 00:00:00 2001 From: Cameron Katri Date: Sun, 28 Mar 2021 14:39:02 -0400 Subject: Use PREFIX now --- Makefile | 19 +++- adventure/Makefile | 4 +- arithmetic/Makefile | 4 +- atc/Makefile | 16 ++-- atc/pathnames.h | 6 +- backgammon/backgammon/Makefile | 4 +- backgammon/teachgammon/Makefile | 2 +- banner/Makefile | 4 +- battlestar/Makefile | 6 +- battlestar/pathnames.h | 4 +- bcd/Makefile | 8 +- boggle/Makefile | 4 +- boggle/boggle/Makefile | 6 +- boggle/boggle/bog.h | 8 +- boggle/mkdict/Makefile | 2 +- boggle/mkindex/Makefile | 2 +- caesar/Makefile | 8 +- canfield/canfield/Makefile | 6 +- canfield/canfield/pathnames.h | 4 +- canfield/cfscores/Makefile | 4 +- cgram/Makefile | 6 +- cgram/pathnames.h | 4 +- ching/castching/Makefile | 4 +- ching/ching/Makefile | 6 +- ching/printching/Makefile | 4 +- ching/printching/pathnames.h | 4 +- colorbars/Makefile | 4 +- countmail/Makefile | 5 +- cribbage/Makefile | 8 +- cribbage/pathnames.h | 8 +- dab/Makefile | 4 +- dm/Makefile | 8 +- dm/pathnames.h | 10 +- factor/Makefile | 4 +- fish/Makefile | 8 +- fish/pathnames.h | 6 +- gomoku/Makefile | 4 +- hack/Makefile | 8 +- hack/config.h | 201 ---------------------------------------- hack/def.objects.h | 2 +- hack/hack-config.h | 201 ++++++++++++++++++++++++++++++++++++++++ hack/hack.h | 2 +- hack/pathnames.h | 8 +- hals_end/Makefile | 4 +- hangman/Makefile | 6 +- hangman/pathnames.h | 4 +- hunt/hunt/Makefile | 6 +- hunt/huntd/Makefile | 6 +- hunt/include/pathnames.h | 4 +- larn/Makefile | 10 +- larn/pathnames.h | 12 ++- mille/Makefile | 4 +- monop/Makefile | 4 +- morse/Makefile | 2 +- number/Makefile | 4 +- phantasia/Makefile | 10 +- phantasia/pathnames.h | 20 ++-- pig/Makefile | 4 +- pom/Makefile | 4 +- ppt/Makefile | 2 +- primes/Makefile | 4 +- quiz/Makefile | 8 +- quiz/pathnames.h | 6 +- rain/Makefile | 4 +- random/Makefile | 4 +- robots/Makefile | 8 +- robots/pathnames.h | 4 +- rogue/Makefile | 8 +- rogue/pathnames.h | 4 +- sail/Makefile | 8 +- sail/pathnames.h | 6 +- snake/snake/Makefile | 8 +- snake/snake/pathnames.h | 6 +- snake/snscore/Makefile | 4 +- testpat/Makefile | 4 +- tetris/Makefile | 8 +- tetris/pathnames.h | 4 +- trek/Makefile | 4 +- wargames/Makefile | 4 +- warp/Makefile | 10 +- warp/config.h | 116 ----------------------- warp/sm.c | 2 +- warp/warp-config.h | 118 +++++++++++++++++++++++ warp/warp.h | 9 +- worm/Makefile | 4 +- worms/Makefile | 4 +- wtf/Makefile | 4 +- wump/Makefile | 8 +- wump/pathnames.h | 6 +- 89 files changed, 596 insertions(+), 537 deletions(-) delete mode 100644 hack/config.h create mode 100644 hack/hack-config.h delete mode 100644 warp/config.h create mode 100644 warp/warp-config.h diff --git a/Makefile b/Makefile index 668faf48..b3c9d43e 100644 --- a/Makefile +++ b/Makefile @@ -11,9 +11,24 @@ SUBDIR= adventure arithmetic atc \ wargames warp worm worms wtf wump TOPTARGETS= all clean install +PREFIX ?= /usr +LOCALSTATEDIR ?= /var +SYSCONFDIR ?= /etc +ROOT := $(shell pwd) + +export ROOT PREFIX LOCALSTATEDIR SYSCONFDIR + $(TOPTARGETS): $(SUBDIR) -$(SUBDIR): - $(MAKE) -C $@ $(MAKECMDGOALS) +$(SUBDIR): config.h + +$(MAKE) -C $@ $(MAKECMDGOALS) + +config.h: + @echo "#define PREFIX \"$(PREFIX)\"" > config.h + @echo "#define LOCALSTATEDIR \"$(LOCALSTATEDIR)\"" >> config.h + @echo "#define SYSCONFDIR \"$(SYSCONFDIR)\"" >> config.h + +clean: + rm -f config.h .PHONY: $(TOPTARGETS) $(SUBDIR) diff --git a/adventure/Makefile b/adventure/Makefile index 83bc8dd7..b656970b 100644 --- a/adventure/Makefile +++ b/adventure/Makefile @@ -19,8 +19,8 @@ mkdata: setup.c clang -o mkdata setup.c install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/arithmetic/Makefile b/arithmetic/Makefile index 133c1850..0dfaea85 100644 --- a/arithmetic/Makefile +++ b/arithmetic/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/atc/Makefile b/atc/Makefile index 22216a34..437fdc54 100644 --- a/atc/Makefile +++ b/atc/Makefile @@ -6,7 +6,7 @@ SRCS= extern.c graphics.c input.c list.c log.c \ main.c tunable.c update.c MAN= atc.6 FILES=${GAMES:S@^@${.CURDIR}/games/@g} -FILESDIR=/usr/share/games/atc +FILESDIR=$(PREFIX)/share/games/atc FILESMODE=644 all: $(PROG) @@ -14,16 +14,16 @@ all: $(PROG) $(PROG): $(SRCS) grammar.y lex.l yacc -d grammar.y -o grammar.c lex lex.l - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) grammar.c lex.yy.c -lncursesw $(LIBFLA) + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) grammar.c lex.yy.c -lncursesw $(LIBFLA) -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - mkdir -p $(DESTDIR)/usr/share/games - cp -r games $(DESTDIR)/usr/share/games/atc - chmod -R 644 $(DESTDIR)/usr/share/games/atc/* - mkdir -p $(DESTDIR)/var/games/ + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + mkdir -p $(DESTDIR)/$(PREFIX)/share/games + cp -r games $(DESTDIR)/$(PREFIX)/share/games/atc + chmod -R 644 $(DESTDIR)/$(PREFIX)/share/games/atc/* + mkdir -p $(DESTDIR)/$(LOCALSTATEDIR)/games/ clean: diff --git a/atc/pathnames.h b/atc/pathnames.h index 742b8fd7..d73f6ff6 100644 --- a/atc/pathnames.h +++ b/atc/pathnames.h @@ -33,5 +33,7 @@ #include -#define _PATH_GAMES "/usr/share/games/atc/" -#define _PATH_SCORE "/var/games/atc_score" +#include "config.h" + +#define _PATH_GAMES PREFIX"/share/games/atc/" +#define _PATH_SCORE LOCALSTATEDIR"/games/atc_score" diff --git a/backgammon/backgammon/Makefile b/backgammon/backgammon/Makefile index 7e0336f7..b9a4c10f 100644 --- a/backgammon/backgammon/Makefile +++ b/backgammon/backgammon/Makefile @@ -22,8 +22,8 @@ $(PROG): $(SRCS) $(COMMONOBJS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/backgammon/teachgammon/Makefile b/backgammon/teachgammon/Makefile index c8666a1d..69c23965 100644 --- a/backgammon/teachgammon/Makefile +++ b/backgammon/teachgammon/Makefile @@ -21,7 +21,7 @@ $(PROG): $(SRCS) $(COMMONOBJS) $(STRIP) $(PROG) install: $(PROG) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/banner/Makefile b/banner/Makefile index 14d4c8b3..fb16d3ab 100644 --- a/banner/Makefile +++ b/banner/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/battlestar/Makefile b/battlestar/Makefile index 639f21a2..ebd76187 100644 --- a/battlestar/Makefile +++ b/battlestar/Makefile @@ -11,12 +11,12 @@ MAN= battlestar.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/battlestar/pathnames.h b/battlestar/pathnames.h index 0b2ed225..a099711a 100644 --- a/battlestar/pathnames.h +++ b/battlestar/pathnames.h @@ -31,4 +31,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCORE "/var/games/battlestar.log" +#include "config.h" + +#define _PATH_SCORE LOCALSTATEDIR"/games/battlestar.log" diff --git a/bcd/Makefile b/bcd/Makefile index 8fe6400c..768a9b02 100644 --- a/bcd/Makefile +++ b/bcd/Makefile @@ -13,10 +13,10 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(LN) -sf $(MAN).zst $(DESTDIR)/usr/share/man/man6/morse.6 - $(LN) -sf $(MAN).zst $(DESTDIR)/usr/share/man/man6/ppt.6 + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(LN) -sf $(MAN).zst $(DESTDIR)/$(PREFIX)/share/man/man6/morse.6 + $(LN) -sf $(MAN).zst $(DESTDIR)/$(PREFIX)/share/man/man6/ppt.6 clean: rm -f $(CLEANFILES) $(PROG) diff --git a/boggle/Makefile b/boggle/Makefile index 4d5b869a..fba54e28 100644 --- a/boggle/Makefile +++ b/boggle/Makefile @@ -22,8 +22,8 @@ dictindex: mkindex dictionary ./mkindex/mkindex < dictionary > dictindex install: dictindex dictionary boggle - $(GINSTALL) -Dm644 dictionary $(DESTDIR)/usr/share/games/boggle/dictionary - $(GINSTALL) -Dm644 dictindex $(DESTDIR)/usr/share/games/boggle/dictindex + $(GINSTALL) -Dm644 dictionary $(DESTDIR)/$(PREFIX)/share/games/boggle/dictionary + $(GINSTALL) -Dm644 dictindex $(DESTDIR)/$(PREFIX)/share/games/boggle/dictindex $(MAKE) -C boggle install .PHONY: all clean install mkdict mkindex boggle diff --git a/boggle/boggle/Makefile b/boggle/boggle/Makefile index 770ef171..b00489ba 100644 --- a/boggle/boggle/Makefile +++ b/boggle/boggle/Makefile @@ -5,14 +5,14 @@ MAN= boggle.6 all: boggle $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) $(SRCS) -o $(PROG) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) $(SRCS) -o $(PROG) -lncursesw -I$(ROOT) $(STRIP) boggle clean: rm -f boggle install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) .PHONY: all clean install diff --git a/boggle/boggle/bog.h b/boggle/boggle/bog.h index 7a0ae060..44cf1b7d 100644 --- a/boggle/boggle/bog.h +++ b/boggle/boggle/bog.h @@ -34,15 +34,17 @@ * @(#)bog.h 8.1 (Berkeley) 6/11/93 */ +#include "config.h" + #define LOADDICT 1 /* Load the dictionary for speed */ /* * Locations for the dictionary (generated by mkdict), * index (generated by mkindex), and helpfile */ -#define DICT "/usr/share/games/boggle/dictionary" -#define DICTINDEX "/usr/share/games/boggle/dictindex" -#define HELPFILE "/usr/share/games/boggle/helpfile" +#define DICT PREFIX"/share/games/boggle/dictionary" +#define DICTINDEX PREFIX"/share/games/boggle/dictindex" +#define HELPFILE PREFIX"/share/games/boggle/helpfile" /* * The theoretical maximum for MAXWORDLEN is ('a' - 1) == 96 diff --git a/boggle/mkdict/Makefile b/boggle/mkdict/Makefile index 5370f497..065c8e29 100644 --- a/boggle/mkdict/Makefile +++ b/boggle/mkdict/Makefile @@ -1,5 +1,5 @@ mkdict: mkdict.c - clang -o mkdict mkdict.c -I../boggle + clang -o mkdict mkdict.c -I../boggle -I$(ROOT) clean: rm -f mkdict diff --git a/boggle/mkindex/Makefile b/boggle/mkindex/Makefile index a28736f4..03a4e637 100644 --- a/boggle/mkindex/Makefile +++ b/boggle/mkindex/Makefile @@ -1,5 +1,5 @@ mkindex: mkindex.c - clang -o mkindex mkindex.c -I../boggle + clang -o mkindex mkindex.c -I../boggle -I$(ROOT) clean: rm -f mkindex diff --git a/caesar/Makefile b/caesar/Makefile index 236d2633..98651c4a 100644 --- a/caesar/Makefile +++ b/caesar/Makefile @@ -13,10 +13,10 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(basename $(SCRIPTS)) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(LN) -sf $(MAN).zst $(DESTDIR)/usr/share/man/man6/rot13.6 + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(basename $(SCRIPTS)) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(LN) -sf $(MAN).zst $(DESTDIR)/$(PREFIX)/share/man/man6/rot13.6 clean: rm -f $(CLEANFILES) $(PROG) diff --git a/canfield/canfield/Makefile b/canfield/canfield/Makefile index 847dc040..212710a4 100644 --- a/canfield/canfield/Makefile +++ b/canfield/canfield/Makefile @@ -8,12 +8,12 @@ SRCS= canfield.c all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/canfield/canfield/pathnames.h b/canfield/canfield/pathnames.h index 88c1bb36..eecae026 100644 --- a/canfield/canfield/pathnames.h +++ b/canfield/canfield/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCORE "/var/games/cfscores" +#include "config.h" + +#define _PATH_SCORE LOCALSTATEDIR"/games/cfscores" diff --git a/canfield/cfscores/Makefile b/canfield/cfscores/Makefile index f8c9518e..4e32a5d2 100644 --- a/canfield/cfscores/Makefile +++ b/canfield/cfscores/Makefile @@ -7,11 +7,11 @@ SRCS= cfscores.c all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../canfield + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../canfield -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/cgram/Makefile b/cgram/Makefile index e99ceed2..7992ad40 100644 --- a/cgram/Makefile +++ b/cgram/Makefile @@ -7,12 +7,12 @@ MAN=cgram.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/cgram/pathnames.h b/cgram/pathnames.h index 51da95c9..e93a72df 100644 --- a/cgram/pathnames.h +++ b/cgram/pathnames.h @@ -27,4 +27,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#define _PATH_FORTUNE "/usr/games/fortune" +#include "config.h" + +#define _PATH_FORTUNE PREFIX"/games/fortune" diff --git a/ching/castching/Makefile b/ching/castching/Makefile index 905a9e32..6bdfcf94 100644 --- a/ching/castching/Makefile +++ b/ching/castching/Makefile @@ -2,7 +2,7 @@ PROG= castching SRCS= castching.c -BINDIR= /usr/libexec/ching +BINDIR= $(PREFIX)/libexec/ching all: $(PROG) @@ -11,7 +11,7 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/libexec/ching/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(BINDIR)/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/ching/ching/Makefile b/ching/ching/Makefile index cd5d7eff..e5d4d263 100644 --- a/ching/ching/Makefile +++ b/ching/ching/Makefile @@ -4,13 +4,13 @@ SCRIPTS=ching.sh MAN= ching.6 FILES= hexagrams macros -FILESDIR=/usr/share/games/ching +FILESDIR=$(PREFIX)/share/games/ching all: install: $(PROG) $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(basename $(SCRIPTS)) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(basename $(SCRIPTS)) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -d $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR) diff --git a/ching/printching/Makefile b/ching/printching/Makefile index 4adbc181..e8e6634f 100644 --- a/ching/printching/Makefile +++ b/ching/printching/Makefile @@ -6,11 +6,11 @@ SRCS= printching.c all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../include + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../include -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/libexec/ching/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/libexec/ching/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/ching/printching/pathnames.h b/ching/printching/pathnames.h index d9962663..93cbb95e 100644 --- a/ching/printching/pathnames.h +++ b/ching/printching/pathnames.h @@ -35,4 +35,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_HEX "/usr/share/games/ching/hexagrams" +#include "config.h" + +#define _PATH_HEX PREFIX"/share/games/ching/hexagrams" diff --git a/colorbars/Makefile b/colorbars/Makefile index dcc271cc..86e6e073 100644 --- a/colorbars/Makefile +++ b/colorbars/Makefile @@ -11,8 +11,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/countmail/Makefile b/countmail/Makefile index 80a9d9b9..e418eac1 100644 --- a/countmail/Makefile +++ b/countmail/Makefile @@ -1,13 +1,12 @@ # $NetBSD: Makefile,v 1.3 1999/02/13 23:53:57 lukem Exp $ SCRIPTS= countmail -SCRIPTSDIR= /usr/games MAN= countmail.6 all: install: $(PROG) $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(SCRIPTS) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(SCRIPTS) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) .PHONY: all install clean diff --git a/cribbage/Makefile b/cribbage/Makefile index 19c2a387..45f9c718 100644 --- a/cribbage/Makefile +++ b/cribbage/Makefile @@ -10,13 +10,13 @@ FILESNAME=cribbage.instr all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/usr/share/games/$(FILESNAME) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/$(PREFIX)/share/games/$(FILESNAME) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/cribbage/pathnames.h b/cribbage/pathnames.h index e16ecda9..eaf9d1bd 100644 --- a/cribbage/pathnames.h +++ b/cribbage/pathnames.h @@ -31,6 +31,8 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_INSTR "/usr/share/games/cribbage.instr" -#define _PATH_LOG "/var/games/criblog" -#define _PATH_MORE "/usr/bin/more" +#include "config.h" + +#define _PATH_INSTR PREFIX"/share/games/cribbage.instr" +#define _PATH_LOG LOCALSTATEDIR"/games/criblog" +#define _PATH_MORE PREFIX"/bin/more" diff --git a/dab/Makefile b/dab/Makefile index b3e940ad..8525f907 100644 --- a/dab/Makefile +++ b/dab/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/dm/Makefile b/dm/Makefile index 2b77c370..ea7c949e 100644 --- a/dm/Makefile +++ b/dm/Makefile @@ -9,13 +9,13 @@ MAN5= dm.conf.5 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -DSUPPORT_UTMPX + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -DSUPPORT_UTMPX -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN8) $(DESTDIR)/usr/share/man/man8/$(MAN8) - $(GINSTALL) -Dm644 $(MAN5) $(DESTDIR)/usr/share/man/man5/$(MAN5) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN8) $(DESTDIR)/$(PREFIX)/share/man/man8/$(MAN8) + $(GINSTALL) -Dm644 $(MAN5) $(DESTDIR)/$(PREFIX)/share/man/man5/$(MAN5) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/dm/pathnames.h b/dm/pathnames.h index 9acdc5cd..3c768c36 100644 --- a/dm/pathnames.h +++ b/dm/pathnames.h @@ -31,7 +31,9 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_CONFIG "/etc/dm.conf" -#define _PATH_HIDE "/usr/games/hide/" -#define _PATH_LOG "/var/log/games.log" -#define _PATH_NOGAMES "/etc/nogames" +#include "config.h" + +#define _PATH_CONFIG SYSCONFDIR"/dm.conf" +#define _PATH_HIDE PREFIX"/games/hide/" +#define _PATH_LOG LOCALSTATEDIR"/log/games.log" +#define _PATH_NOGAMES SYSCONFDIR"/nogames" diff --git a/factor/Makefile b/factor/Makefile index b84802d3..1fea0f68 100644 --- a/factor/Makefile +++ b/factor/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/fish/Makefile b/fish/Makefile index b6d2ac36..392b744f 100644 --- a/fish/Makefile +++ b/fish/Makefile @@ -9,13 +9,13 @@ FILES=fish.instr all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/bsd-$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/bsd-$(MAN) - $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/usr/share/games/bsd-$(FILES) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/bsd-$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/bsd-$(MAN) + $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/$(PREFIX)/share/games/bsd-$(FILES) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/fish/pathnames.h b/fish/pathnames.h index 3dced4a8..9b40d1f4 100644 --- a/fish/pathnames.h +++ b/fish/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_INSTR "/usr/share/games/fish.instr" -#define _PATH_MORE "/usr/bin/more" +#include "config.h" + +#define _PATH_INSTR PREFIX"/share/games/fish.instr" +#define _PATH_MORE PREFIX"/bin/more" diff --git a/gomoku/Makefile b/gomoku/Makefile index 50895f7f..7c1479f6 100644 --- a/gomoku/Makefile +++ b/gomoku/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hack/Makefile b/hack/Makefile index 318f3034..c4aed9cb 100644 --- a/hack/Makefile +++ b/hack/Makefile @@ -16,7 +16,7 @@ SRCS+= alloc.c hack.Decl.c hack.apply.c hack.bones.c hack.c hack.cmd.c \ MAN= hack.6 CLEANFILES+=makedefs FILES=help hh data -FILESDIR=/var/games/hackdir +FILESDIR=$(LOCALSTATEDIR)/games/hackdir CLEANFILES+=hack.onames.h all: $(PROG) @@ -30,12 +30,12 @@ makedefs: makedefs.c hack.h: hack.onames.h $(PROG): $(SRCS) hack.h - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) mkdir -p $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm660 $(FILES) $(DESTDIR)$(FILESDIR) diff --git a/hack/config.h b/hack/config.h deleted file mode 100644 index 7f51a842..00000000 --- a/hack/config.h +++ /dev/null @@ -1,201 +0,0 @@ -/* $NetBSD: config.h,v 1.10 2011/08/06 19:53:24 dholland Exp $ */ - -/* - * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, - * Amsterdam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of the Stichting Centrum voor Wiskunde en - * Informatica, nor the names of its contributors may be used to endorse or - * promote products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER - * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Copyright (c) 1982 Jay Fenlason - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "pathnames.h" - -#ifndef CONFIG /* make sure the compiler doesnt see the typedefs twice */ - -#define CONFIG -#define UNIX /* delete if no fork(), exec() available */ -#define CHDIR /* delete if no chdir() available */ - -/* - * Some include files are in a different place under SYSV - * BSD SYSV - * - * - * - * - * Also, the code for suspend and various ioctls is only given for BSD4.2 - * (I do not have access to a SYSV system.) - */ -#define BSD /* delete this line on System V */ - -/* #define STUPID */ /* avoid some complicated expressions if - your C compiler chokes on them */ - -#define WIZARD "bruno" /* the person allowed to use the -D option */ -#define RECORD "record"/* the file containing the list of topscorers */ -#define NEWS "news" /* the file containing the latest hack news */ -#define HELP "help" /* the file containing a description of the commands */ -#define SHELP "hh" /* abbreviated form of the same */ -#define RUMORFILE "rumors" /* a file with fortune cookies */ -#define DATAFILE "data" /* a file giving the meaning of symbols used */ -#define FMASK 0660 /* file creation mask */ -#define HLOCK "perm" /* an empty file used for locking purposes */ -#define LLOCK "safelock" /* link to previous */ - -#ifdef UNIX -/* - * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" - * If defined, it can be overridden by the environment variable PAGER. - * Hack will use its internal pager if DEF_PAGER is not defined. - * (This might be preferable for security reasons.) - * #define DEF_PAGER ".../mydir/mypager" - */ - -/* - * If you define MAIL, then the player will be notified of new mail - * when it arrives. If you also define DEF_MAILREADER then this will - * be the default mail reader, and can be overridden by the environment - * variable MAILREADER; otherwise an internal pager will be used. - * A stat system call is done on the mailbox every MAILCKFREQ moves. - */ -/* #define MAIL */ -#define DEF_MAILREADER _PATH_MAIL /* or e.g. /bin/mail */ -#define MAILCKFREQ 100 - - -#define SHELL /* do not delete the '!' command */ - -#ifdef BSD -#define SUSPEND /* let ^Z suspend the game */ -#endif /* BSD */ -#endif /* UNIX */ - -#ifdef CHDIR -/* - * If you define HACKDIR, then this will be the default playground; - * otherwise it will be the current directory. - */ -#ifdef QUEST -#define HACKDIR _PATH_QUEST -#else /* QUEST */ -#define HACKDIR _PATH_HACK -#endif /* QUEST */ - -/* - * Some system administrators are stupid enough to make Hack suid root - * or suid daemon, where daemon has other powers besides that of reading or - * writing Hack files. In such cases one should be careful with chdir's - * since the user might create files in a directory of his choice. - * Of course SECURE is meaningful only if HACKDIR is defined. - */ -#define SECURE /* do setuid(getuid()) after chdir() */ - -/* - * If it is desirable to limit the number of people that can play Hack - * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. - * #define MAX_NR_OF_PLAYERS 100 - */ -#endif /* CHDIR */ - -/* size of terminal screen is (at least) (ROWNO+2) by COLNO */ -#define COLNO 80 -#define ROWNO 22 - -/* - * small signed integers (8 bits suffice) - * typedef char schar; - * will do when you have signed characters; otherwise use - * typedef short int schar; - * - * Use short chars anyway to avoid warnings. - */ -#if 1 -typedef short int schar; -#else -typedef char schar; -#endif - -/* - * small unsigned integers (8 bits suffice - but 7 bits do not) - * - these are usually object types; be careful with inequalities! - - * typedef unsigned char uchar; - * will be satisfactory if you have an "unsigned char" type; otherwise use - * typedef unsigned short int uchar; - */ -typedef unsigned char uchar; - -/* - * small integers in the range 0 - 127, usually coordinates - * although they are nonnegative they must not be declared unsigned - * since otherwise comparisons with signed quantities are done incorrectly - */ -typedef schar xchar; -typedef xchar boolean; /* 0 or 1 */ -#define TRUE 1 -#define FALSE 0 - -/* - * Declaration of bitfields in various structs; if your C compiler - * doesnt handle bitfields well, e.g., if it is unable to initialize - * structs containing bitfields, then you might use - * #define Bitfield(x,n) uchar x - * since the bitfields used never have more than 7 bits. (Most have 1 bit.) - */ -#define Bitfield(x,n) unsigned x:n - -#define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) - -#endif /* CONFIG */ diff --git a/hack/def.objects.h b/hack/def.objects.h index e9b34d17..3bed8c35 100644 --- a/hack/def.objects.h +++ b/hack/def.objects.h @@ -64,7 +64,7 @@ #ifndef _DEF_OBJECTS_H_ #define _DEF_OBJECTS_H_ /* objects have letter " % ) ( 0 _ ` [ ! ? / = * */ -#include "config.h" +#include "hack-config.h" #include "def.objclass.h" struct objclass objects[] = { diff --git a/hack/hack-config.h b/hack/hack-config.h new file mode 100644 index 00000000..7f51a842 --- /dev/null +++ b/hack/hack-config.h @@ -0,0 +1,201 @@ +/* $NetBSD: config.h,v 1.10 2011/08/06 19:53:24 dholland Exp $ */ + +/* + * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, + * Amsterdam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * - Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of the Stichting Centrum voor Wiskunde en + * Informatica, nor the names of its contributors may be used to endorse or + * promote products derived from this software without specific prior + * written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER + * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * Copyright (c) 1982 Jay Fenlason + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "pathnames.h" + +#ifndef CONFIG /* make sure the compiler doesnt see the typedefs twice */ + +#define CONFIG +#define UNIX /* delete if no fork(), exec() available */ +#define CHDIR /* delete if no chdir() available */ + +/* + * Some include files are in a different place under SYSV + * BSD SYSV + * + * + * + * + * Also, the code for suspend and various ioctls is only given for BSD4.2 + * (I do not have access to a SYSV system.) + */ +#define BSD /* delete this line on System V */ + +/* #define STUPID */ /* avoid some complicated expressions if + your C compiler chokes on them */ + +#define WIZARD "bruno" /* the person allowed to use the -D option */ +#define RECORD "record"/* the file containing the list of topscorers */ +#define NEWS "news" /* the file containing the latest hack news */ +#define HELP "help" /* the file containing a description of the commands */ +#define SHELP "hh" /* abbreviated form of the same */ +#define RUMORFILE "rumors" /* a file with fortune cookies */ +#define DATAFILE "data" /* a file giving the meaning of symbols used */ +#define FMASK 0660 /* file creation mask */ +#define HLOCK "perm" /* an empty file used for locking purposes */ +#define LLOCK "safelock" /* link to previous */ + +#ifdef UNIX +/* + * Define DEF_PAGER as your default pager, e.g. "/bin/cat" or "/usr/ucb/more" + * If defined, it can be overridden by the environment variable PAGER. + * Hack will use its internal pager if DEF_PAGER is not defined. + * (This might be preferable for security reasons.) + * #define DEF_PAGER ".../mydir/mypager" + */ + +/* + * If you define MAIL, then the player will be notified of new mail + * when it arrives. If you also define DEF_MAILREADER then this will + * be the default mail reader, and can be overridden by the environment + * variable MAILREADER; otherwise an internal pager will be used. + * A stat system call is done on the mailbox every MAILCKFREQ moves. + */ +/* #define MAIL */ +#define DEF_MAILREADER _PATH_MAIL /* or e.g. /bin/mail */ +#define MAILCKFREQ 100 + + +#define SHELL /* do not delete the '!' command */ + +#ifdef BSD +#define SUSPEND /* let ^Z suspend the game */ +#endif /* BSD */ +#endif /* UNIX */ + +#ifdef CHDIR +/* + * If you define HACKDIR, then this will be the default playground; + * otherwise it will be the current directory. + */ +#ifdef QUEST +#define HACKDIR _PATH_QUEST +#else /* QUEST */ +#define HACKDIR _PATH_HACK +#endif /* QUEST */ + +/* + * Some system administrators are stupid enough to make Hack suid root + * or suid daemon, where daemon has other powers besides that of reading or + * writing Hack files. In such cases one should be careful with chdir's + * since the user might create files in a directory of his choice. + * Of course SECURE is meaningful only if HACKDIR is defined. + */ +#define SECURE /* do setuid(getuid()) after chdir() */ + +/* + * If it is desirable to limit the number of people that can play Hack + * simultaneously, define HACKDIR, SECURE and MAX_NR_OF_PLAYERS. + * #define MAX_NR_OF_PLAYERS 100 + */ +#endif /* CHDIR */ + +/* size of terminal screen is (at least) (ROWNO+2) by COLNO */ +#define COLNO 80 +#define ROWNO 22 + +/* + * small signed integers (8 bits suffice) + * typedef char schar; + * will do when you have signed characters; otherwise use + * typedef short int schar; + * + * Use short chars anyway to avoid warnings. + */ +#if 1 +typedef short int schar; +#else +typedef char schar; +#endif + +/* + * small unsigned integers (8 bits suffice - but 7 bits do not) + * - these are usually object types; be careful with inequalities! - + * typedef unsigned char uchar; + * will be satisfactory if you have an "unsigned char" type; otherwise use + * typedef unsigned short int uchar; + */ +typedef unsigned char uchar; + +/* + * small integers in the range 0 - 127, usually coordinates + * although they are nonnegative they must not be declared unsigned + * since otherwise comparisons with signed quantities are done incorrectly + */ +typedef schar xchar; +typedef xchar boolean; /* 0 or 1 */ +#define TRUE 1 +#define FALSE 0 + +/* + * Declaration of bitfields in various structs; if your C compiler + * doesnt handle bitfields well, e.g., if it is unable to initialize + * structs containing bitfields, then you might use + * #define Bitfield(x,n) uchar x + * since the bitfields used never have more than 7 bits. (Most have 1 bit.) + */ +#define Bitfield(x,n) unsigned x:n + +#define SIZE(x) (int)(sizeof(x) / sizeof(x[0])) + +#endif /* CONFIG */ diff --git a/hack/hack.h b/hack/hack.h index 575b00ef..4579fae6 100644 --- a/hack/hack.h +++ b/hack/hack.h @@ -64,7 +64,7 @@ #ifndef _HACK_H_ #define _HACK_H_ -#include "config.h" +#include "hack-config.h" #include #include #include diff --git a/hack/pathnames.h b/hack/pathnames.h index 3af190e9..bbd2fa71 100644 --- a/hack/pathnames.h +++ b/hack/pathnames.h @@ -31,7 +31,9 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_MAIL "/usr/bin/mail" -#define _PATH_QUEST "/var/games/questdir" -#define _PATH_HACK "/var/games/hackdir" +#include "config.h" + +#define _PATH_MAIL PREFIX"/bin/mail" +#define _PATH_QUEST LOCALSTATEDIR"/games/questdir" +#define _PATH_HACK LOCALSTATEDIR"/games/hackdir" diff --git a/hals_end/Makefile b/hals_end/Makefile index 89b10b30..4aff7ab3 100644 --- a/hals_end/Makefile +++ b/hals_end/Makefile @@ -11,8 +11,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hangman/Makefile b/hangman/Makefile index 0205e266..c6876220 100644 --- a/hangman/Makefile +++ b/hangman/Makefile @@ -9,12 +9,12 @@ MAN= hangman.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hangman/pathnames.h b/hangman/pathnames.h index 74c7b7b6..e11964e1 100644 --- a/hangman/pathnames.h +++ b/hangman/pathnames.h @@ -31,4 +31,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_DICT "/usr/share/dict/words" +#include "config.h" + +#define _PATH_DICT PREFIX"/share/dict/words" diff --git a/hunt/hunt/Makefile b/hunt/hunt/Makefile index 211b9619..8f898974 100644 --- a/hunt/hunt/Makefile +++ b/hunt/hunt/Makefile @@ -7,12 +7,12 @@ MAN= hunt.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) $(EXTRADEFS) -I../include -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) $(EXTRADEFS) -I../include -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hunt/huntd/Makefile b/hunt/huntd/Makefile index c90d71db..385bb5b2 100644 --- a/hunt/huntd/Makefile +++ b/hunt/huntd/Makefile @@ -8,12 +8,12 @@ MAN= huntd.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(EXTRADEFS) -I../include + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) $(EXTRADEFS) -I../include -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/hunt/include/pathnames.h b/hunt/include/pathnames.h index 2595c9a0..e8cdf276 100644 --- a/hunt/include/pathnames.h +++ b/hunt/include/pathnames.h @@ -30,6 +30,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#define PATH_HUNTD "/usr/games/huntd" +#include "config.h" + +#define PATH_HUNTD PREFIX"/games/huntd" #define PATH_HUNTSOCKET "/tmp/hunt" #define PATH_STATSOCKET "/tmp/hunt.stats" diff --git a/larn/Makefile b/larn/Makefile index 643e1913..47b0ae1b 100644 --- a/larn/Makefile +++ b/larn/Makefile @@ -66,14 +66,14 @@ FILES= datfiles/larn.help datfiles/larnmaze datfiles/larnopts all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/usr/share/games/larn - $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/usr/share/games/larn/ + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(PREFIX)/share/games/larn + $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)/$(PREFIX)/share/games/larn/ clean: rm -f $(CLEANFILES) $(PROG) diff --git a/larn/pathnames.h b/larn/pathnames.h index 0790dfc4..8f7ba236 100644 --- a/larn/pathnames.h +++ b/larn/pathnames.h @@ -31,8 +31,10 @@ * @(#)pathnames.h 5.2 (Berkeley) 4/27/95 */ -#define _PATH_LOG "/var/games/larn/llog12.0" -#define _PATH_SCORE "/var/games/larn/lscore12.0" -#define _PATH_HELP "/usr/share/games/larn/larn.help" -#define _PATH_LEVELS "/usr/share/games/larn/larnmaze" -#define _PATH_PLAYERIDS "/var/games/larn/playerids" +#include "config.h" + +#define _PATH_LOG LOCALSTATEDIR"/games/larn/llog12.0" +#define _PATH_SCORE LOCALSTATEDIR"/games/larn/lscore12.0" +#define _PATH_HELP PREFIX"/share/games/larn/larn.help" +#define _PATH_LEVELS PREFIX"/share/games/larn/larnmaze" +#define _PATH_PLAYERIDS LOCALSTATEDIR"/games/larn/playerids" diff --git a/mille/Makefile b/mille/Makefile index a03c79f1..090a3e2f 100644 --- a/mille/Makefile +++ b/mille/Makefile @@ -13,8 +13,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/monop/Makefile b/monop/Makefile index a41871f8..7105af18 100644 --- a/monop/Makefile +++ b/monop/Makefile @@ -13,8 +13,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/morse/Makefile b/morse/Makefile index 70eba999..7cc3b053 100644 --- a/morse/Makefile +++ b/morse/Makefile @@ -11,7 +11,7 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/number/Makefile b/number/Makefile index 22ccf93b..eb50d2f3 100644 --- a/number/Makefile +++ b/number/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/phantasia/Makefile b/phantasia/Makefile index 3792164c..c0a4484a 100644 --- a/phantasia/Makefile +++ b/phantasia/Makefile @@ -5,7 +5,7 @@ PROG= phantasia SRCS= fight.c gamesupport.c interplayer.c io.c main.c misc.c phantglobs.c MAN= phantasia.6 -FILESDIR=/var/games/phantasia +FILESDIR=$(LOCALSTATEDIR)/games/phantasia FILESMODE=0660 ALLFILES=gold lastdead mess monsters void motd characs scoreboard FILES=gold lastdead mess monsters void motd @@ -21,7 +21,7 @@ files.stamp: mkdata monsters.asc touch files.stamp mkdata: phantglobs.c setup.c - clang -o mkdata phantglobs.c setup.c + clang -o mkdata phantglobs.c setup.c -I$(ROOT) # Make Phantasia map. Change the map commands reflect your installation. # PLOTDEVICE is used for plotting the map. Change as appropriate. @@ -31,14 +31,14 @@ map: map.c ./map | plot > /dev/tty $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) $(ALLFILES): $(FILES) install: $(PROG) $(MAN) $(ALLFILES) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -d $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm$(FILESMODE) $(ALLFILES) $(DESTDIR)$(FILESDIR) diff --git a/phantasia/pathnames.h b/phantasia/pathnames.h index af287785..5bfc3bc0 100644 --- a/phantasia/pathnames.h +++ b/phantasia/pathnames.h @@ -31,12 +31,14 @@ * @(#)pathnames.h 8.2 (Berkeley) 4/2/94 */ -#define _PATH_GAMEPROG "/usr/games/phantasia" -#define _PATH_GOLD "/var/games/phantasia/gold" -#define _PATH_LASTDEAD "/var/games/phantasia/lastdead" -#define _PATH_MESS "/var/games/phantasia/mess" -#define _PATH_MONST "/var/games/phantasia/monsters" -#define _PATH_MOTD "/var/games/phantasia/motd" -#define _PATH_PEOPLE "/var/games/phantasia/characs" -#define _PATH_SCORE "/var/games/phantasia/scoreboard" -#define _PATH_VOID "/var/games/phantasia/void" +#include "config.h" + +#define _PATH_GAMEPROG PREFIX"/games/phantasia" +#define _PATH_GOLD LOCALSTATEDIR"/games/phantasia/gold" +#define _PATH_LASTDEAD LOCALSTATEDIR"/games/phantasia/lastdead" +#define _PATH_MESS LOCALSTATEDIR"/games/phantasia/mess" +#define _PATH_MONST LOCALSTATEDIR"/games/phantasia/monsters" +#define _PATH_MOTD LOCALSTATEDIR"/games/phantasia/motd" +#define _PATH_PEOPLE LOCALSTATEDIR"/games/phantasia/characs" +#define _PATH_SCORE LOCALSTATEDIR"/games/phantasia/scoreboard" +#define _PATH_VOID LOCALSTATEDIR"/games/phantasia/void" diff --git a/pig/Makefile b/pig/Makefile index 497efad9..a9f85f23 100644 --- a/pig/Makefile +++ b/pig/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/pom/Makefile b/pom/Makefile index 686f4655..f436cc2e 100644 --- a/pom/Makefile +++ b/pom/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/ppt/Makefile b/ppt/Makefile index 0b58797d..55002893 100644 --- a/ppt/Makefile +++ b/ppt/Makefile @@ -11,7 +11,7 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/primes/Makefile b/primes/Makefile index e0f0dad6..b20aad42 100644 --- a/primes/Makefile +++ b/primes/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/quiz/Makefile b/quiz/Makefile index 54afe386..54e1547d 100644 --- a/quiz/Makefile +++ b/quiz/Makefile @@ -9,17 +9,17 @@ CATS= africa america areas arith asia babies bard chinese collectives \ midearth morse mult murders poetry posneg pres province seq-easy \ seq-hard sexes sov spell state trek ucc FILES= $(addprefix datfiles/,$(CATS)) -FILESDIR=/usr/share/games/quiz.db +FILESDIR=$(PREFIX)/share/games/quiz.db all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -d $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR) diff --git a/quiz/pathnames.h b/quiz/pathnames.h index 821cc29c..01acdc25 100644 --- a/quiz/pathnames.h +++ b/quiz/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_PAGER "/usr/bin/more" -#define _PATH_QUIZIDX "/usr/share/games/quiz.db/index" +#include "config.h" + +#define _PATH_PAGER PREFIX"/bin/more" +#define _PATH_QUIZIDX PREFIX"/share/games/quiz.db/index" diff --git a/rain/Makefile b/rain/Makefile index 0f8a9224..db13b233 100644 --- a/rain/Makefile +++ b/rain/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/random/Makefile b/random/Makefile index cad8a5de..2cd339be 100644 --- a/random/Makefile +++ b/random/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/robots/Makefile b/robots/Makefile index 293ea7d8..eb71c00a 100644 --- a/robots/Makefile +++ b/robots/Makefile @@ -10,13 +10,13 @@ MAN= robots.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/robots/pathnames.h b/robots/pathnames.h index 152810e6..fe3500ba 100644 --- a/robots/pathnames.h +++ b/robots/pathnames.h @@ -31,4 +31,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCORE "/var/games/robots_roll" +#include "config.h" + +#define _PATH_SCORE LOCALSTATEDIR"/games/robots_roll" diff --git a/rogue/Makefile b/rogue/Makefile index 07b115de..a1c8d834 100644 --- a/rogue/Makefile +++ b/rogue/Makefile @@ -11,13 +11,13 @@ MAN= rogue.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/rogue/pathnames.h b/rogue/pathnames.h index d6e91a57..e27f6d09 100644 --- a/rogue/pathnames.h +++ b/rogue/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCOREFILE "/var/games/rogue.scores" +#include "config.h" + +#define _PATH_SCOREFILE LOCALSTATEDIR"/games/rogue.scores" #define _PATH_SCREENDUMP "rogue.screen" diff --git a/sail/Makefile b/sail/Makefile index 6d50ae19..4eac58be 100644 --- a/sail/Makefile +++ b/sail/Makefile @@ -10,13 +10,13 @@ MAN= sail.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/sail/pathnames.h b/sail/pathnames.h index 65bc3641..46a657ec 100644 --- a/sail/pathnames.h +++ b/sail/pathnames.h @@ -31,8 +31,10 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_LOGFILE "/var/games/saillog" -#define _PATH_SAILDIR "/var/games/sail" +#include "config.h" + +#define _PATH_LOGFILE LOCALSTATEDIR"/games/saillog" +#define _PATH_SAILDIR LOCALSTATEDIR"/games/sail" /* in _PATH_SAILDIR */ #define _FILE_SYNC "#sailsink.%d" diff --git a/snake/snake/Makefile b/snake/snake/Makefile index 131ba12d..5ff9c430 100644 --- a/snake/snake/Makefile +++ b/snake/snake/Makefile @@ -8,13 +8,13 @@ MAN= snake.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/snake/snake/pathnames.h b/snake/snake/pathnames.h index dcd8b0b6..faf7f269 100644 --- a/snake/snake/pathnames.h +++ b/snake/snake/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_RAWSCORES "/var/games/snakerawscores" -#define _PATH_LOGFILE "/var/games/snake.log" +#include "config.h" + +#define _PATH_RAWSCORES LOCALSTATEDIR"/games/snakerawscores" +#define _PATH_LOGFILE LOCALSTATEDIR"/games/snake.log" diff --git a/snake/snscore/Makefile b/snake/snscore/Makefile index 945b34d5..0a71046a 100644 --- a/snake/snscore/Makefile +++ b/snake/snscore/Makefile @@ -7,11 +7,11 @@ SRCS= snscore.c all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../snake + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I../snake -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/testpat/Makefile b/testpat/Makefile index 40a1d702..abc82d12 100644 --- a/testpat/Makefile +++ b/testpat/Makefile @@ -11,8 +11,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/tetris/Makefile b/tetris/Makefile index aeda79a9..ebec48b6 100644 --- a/tetris/Makefile +++ b/tetris/Makefile @@ -8,13 +8,13 @@ MAN= tetris.6 all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) - $(GINSTALL) -d $(DESTDIR)/var/games + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) + $(GINSTALL) -d $(DESTDIR)/$(LOCALSTATEDIR)/games clean: rm -f $(CLEANFILES) $(PROG) diff --git a/tetris/pathnames.h b/tetris/pathnames.h index f96e3cc5..5a9ccc04 100644 --- a/tetris/pathnames.h +++ b/tetris/pathnames.h @@ -34,4 +34,6 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_SCOREFILE "/var/games/tetris.scores" +#include "config.h" + +#define _PATH_SCOREFILE LOCALSTATEDIR"/games/tetris.scores" diff --git a/trek/Makefile b/trek/Makefile index 1b702605..acdf7d2b 100644 --- a/trek/Makefile +++ b/trek/Makefile @@ -19,8 +19,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/wargames/Makefile b/wargames/Makefile index df1a97d6..32aae0af 100644 --- a/wargames/Makefile +++ b/wargames/Makefile @@ -7,7 +7,7 @@ MAN= wargames.6 all: install: $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(basename $(SCRIPTS)) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(basename $(SCRIPTS)) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) .PHONY: all install clean diff --git a/warp/Makefile b/warp/Makefile index 0e674c14..855b68af 100644 --- a/warp/Makefile +++ b/warp/Makefile @@ -11,17 +11,17 @@ CLEANFILES+=warp.6 MAN= warp.6 FILES=smap.0 smap.1 smap.2 smap.3 smap.4 smap.5 smap.6 smap.7 -FILESDIR=/usr/share/games/warp +FILESDIR=$(PREFIX)/share/games/warp all: $(PROG) $(MAN) $(FILES) $(PROG): $(SRCS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw + $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(SRCS) -lncursesw -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) $(FILES) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -d $(DESTDIR)$(FILESDIR) $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR) @@ -56,6 +56,6 @@ smap.7: smp.7 sm ./sm < smp.7 > $@ sm: sm.c - clang -o $@ sm.c + clang -o $@ sm.c -I$(ROOT) .PHONY: all clean install diff --git a/warp/config.h b/warp/config.h deleted file mode 100644 index 8f4d28a4..00000000 --- a/warp/config.h +++ /dev/null @@ -1,116 +0,0 @@ -/* RDCHK: - * This symbol, if defined, indicates that the rdchk routine is available - * to find out if there is input pending on an IO channel. Generally - * the routine is used only if FIONREAD and O_NDELAY aren't available. - */ -#undef RDCHK /**/ - -/* SCOREFULL: - * This symbol, if defined, indicates that any scoreboard kept by the - * program should be kept on the basis of the user's full name as opposed - * to the user's login name. If the user can change his full name he - * can enter multiple scores if this is defined. - */ -#undef SCOREFULL /**/ - -/* SIGNEDCHAR: - * This symbol, if defined, indicates that characters are a signed type. - * If not defined, things declared as signed characters (and that make - * use of negative values) should probably be declared as shorts instead. - */ -#define SIGNEDCHAR /**/ - -/* TERMIOS: - * This symbol, if defined, indicates that the program should include - * termio.h rather than sgtty.h. There are also differences in the - * ioctl() calls that depend on the value of this symbol. - */ -#define TERMIOS /**/ - -/* USENDIR: - * This symbol, if defined, indicates that the program should compile - * the ndir.c code provided with the package. - */ -/* LIBNDIR: - * This symbol, if defined, indicates that the program should include the - * system's version of ndir.h, rather than the one with this package. - */ -#undef USENDIR /**/ -#undef LIBNDIR /**/ -#define LIBNDIR - -/* WHOAMI: - * This symbol, if defined, indicates that the program may include - * whoami.h. - */ -#undef WHOAMI /**/ - -/* HOSTNAME: - * This symbol contains name of the host the program is going to run on. - * The domain is not kept with hostname, but must be gotten from MYDOMAIN. - * The dot comes with MYDOMAIN, and need not be supplied by the program. - * If gethostname() or uname() exist, HOSTNAME may be ignored. - */ -/* MYDOMAIN: - * This symbol contains the domain of the host the program is going to - * run on. The domain must be appended to HOSTNAME to form a complete - * host name. The dot comes with MYDOMAIN, and need not be supplied by - * the program. If the host name is derived from PHOSTNAME, the domain - * may or may not already be there, and the program should check. - */ -#define HOSTNAME "kazoo" /**/ -#define MYDOMAIN ".uucp" /**/ - -/* PASSNAMES: - * This symbol, if defined, indicates that full names are stored in - * the /etc/passwd file. - */ -/* BERKNAMES: - * This symbol, if defined, indicates that full names are stored in - * the /etc/passwd file in Berkeley format (name first thing, everything - * up to first comma, with & replaced by capitalized login id, yuck). - */ -/* USGNAMES: - * This symbol, if defined, indicates that full names are stored in - * the /etc/passwd file in USG format (everything after - and before ( is - * the name). - */ -#define PASSNAMES /* (undef to take name from ~/.fullname) */ -#define BERKNAMES /* (that is, ":name,stuff:") */ -#undef USGNAMES /* (that is, ":stuff-name(stuff):") */ - -/* PREFSHELL: - * This symbol contains the full name of the preferred user shell on this - * system. Usual values are /bin/csh, /bin/ksh, /bin/sh. - */ -#define PREFSHELL "/bin/csh" /**/ - -/* ROOTID: - * This symbol contains the uid of root, normally 0. - */ -#define ROOTID 0 /**/ - -/* VOIDFLAGS: - * This symbol indicates how much support of the void type is given by this - * compiler. What various bits mean: - * - * 1 = supports declaration of void - * 2 = supports arrays of pointers to functions returning void - * 4 = supports comparisons between pointers to void functions and - * addresses of void functions - * - * The package designer should define VOIDUSED to indicate the requirements - * of the package. This can be done either by #defining VOIDUSED before - * including config.h, or by defining defvoidused in Myinit.U. - */ -#ifndef VOIDUSED -#define VOIDUSED 7 -#endif -#define VOIDFLAGS 7 -#if (VOIDFLAGS & VOIDUSED) != VOIDUSED -#define void int /* is void to be avoided? */ -#define M_VOID /* Xenix strikes again */ -#endif - -/* warp private library, may use ~ expansion, %x and %l */ -#define PRIVLIB "/usr/share/games/warp" /**/ diff --git a/warp/sm.c b/warp/sm.c index 69b10401..a91c64ac 100644 --- a/warp/sm.c +++ b/warp/sm.c @@ -9,7 +9,7 @@ #include #include #include -#include "config.h" +#include "warp-config.h" int main(void) diff --git a/warp/warp-config.h b/warp/warp-config.h new file mode 100644 index 00000000..825991a3 --- /dev/null +++ b/warp/warp-config.h @@ -0,0 +1,118 @@ +#include "config.h" + +/* RDCHK: + * This symbol, if defined, indicates that the rdchk routine is available + * to find out if there is input pending on an IO channel. Generally + * the routine is used only if FIONREAD and O_NDELAY aren't available. + */ +#undef RDCHK /**/ + +/* SCOREFULL: + * This symbol, if defined, indicates that any scoreboard kept by the + * program should be kept on the basis of the user's full name as opposed + * to the user's login name. If the user can change his full name he + * can enter multiple scores if this is defined. + */ +#undef SCOREFULL /**/ + +/* SIGNEDCHAR: + * This symbol, if defined, indicates that characters are a signed type. + * If not defined, things declared as signed characters (and that make + * use of negative values) should probably be declared as shorts instead. + */ +#define SIGNEDCHAR /**/ + +/* TERMIOS: + * This symbol, if defined, indicates that the program should include + * termio.h rather than sgtty.h. There are also differences in the + * ioctl() calls that depend on the value of this symbol. + */ +#define TERMIOS /**/ + +/* USENDIR: + * This symbol, if defined, indicates that the program should compile + * the ndir.c code provided with the package. + */ +/* LIBNDIR: + * This symbol, if defined, indicates that the program should include the + * system's version of ndir.h, rather than the one with this package. + */ +#undef USENDIR /**/ +#undef LIBNDIR /**/ +#define LIBNDIR + +/* WHOAMI: + * This symbol, if defined, indicates that the program may include + * whoami.h. + */ +#undef WHOAMI /**/ + +/* HOSTNAME: + * This symbol contains name of the host the program is going to run on. + * The domain is not kept with hostname, but must be gotten from MYDOMAIN. + * The dot comes with MYDOMAIN, and need not be supplied by the program. + * If gethostname() or uname() exist, HOSTNAME may be ignored. + */ +/* MYDOMAIN: + * This symbol contains the domain of the host the program is going to + * run on. The domain must be appended to HOSTNAME to form a complete + * host name. The dot comes with MYDOMAIN, and need not be supplied by + * the program. If the host name is derived from PHOSTNAME, the domain + * may or may not already be there, and the program should check. + */ +#define HOSTNAME "kazoo" /**/ +#define MYDOMAIN ".uucp" /**/ + +/* PASSNAMES: + * This symbol, if defined, indicates that full names are stored in + * the /etc/passwd file. + */ +/* BERKNAMES: + * This symbol, if defined, indicates that full names are stored in + * the /etc/passwd file in Berkeley format (name first thing, everything + * up to first comma, with & replaced by capitalized login id, yuck). + */ +/* USGNAMES: + * This symbol, if defined, indicates that full names are stored in + * the /etc/passwd file in USG format (everything after - and before ( is + * the name). + */ +#define PASSNAMES /* (undef to take name from ~/.fullname) */ +#define BERKNAMES /* (that is, ":name,stuff:") */ +#undef USGNAMES /* (that is, ":stuff-name(stuff):") */ + +/* PREFSHELL: + * This symbol contains the full name of the preferred user shell on this + * system. Usual values are /bin/csh, /bin/ksh, /bin/sh. + */ +#define PREFSHELL "/bin/sh" /**/ + +/* ROOTID: + * This symbol contains the uid of root, normally 0. + */ +#define ROOTID 0 /**/ + +/* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. + */ +#ifndef VOIDUSED +#define VOIDUSED 7 +#endif +#define VOIDFLAGS 7 +#if (VOIDFLAGS & VOIDUSED) != VOIDUSED +#define void int /* is void to be avoided? */ +#define M_VOID /* Xenix strikes again */ +#endif + +/* warp private library, may use ~ expansion, %x and %l */ +#define PRIVLIB PREFIX"/share/games/warp" /**/ diff --git a/warp/warp.h b/warp/warp.h index 24abfdc3..4dabe7be 100644 --- a/warp/warp.h +++ b/warp/warp.h @@ -15,7 +15,8 @@ #ifndef WARP_H #define WARP_H -#include "config.h" /* generated by Configure script */ +#include "config.h" +#include "warp-config.h" /* generated by Configure script */ #include #include @@ -43,7 +44,7 @@ * access.) */ -#define SAVEDIR "/var/games/warp" +#define SAVEDIR LOCALSTATEDIR"/games/warp" #define NEWSFILE "warp.news" #define HELPFILE "warp.doc" #define LOCKFILE ".warp.lock" @@ -59,7 +60,7 @@ # ifdef PRIVLIB # define WARPLIB PRIVLIB # else -# define WARPLIB "/usr/games/warp" +# define WARPLIB PREFIX"/games/warp" # endif #endif @@ -267,7 +268,7 @@ EXT char amb[YSIZE][XSIZE]; /* preferred shell for use in doshell routine */ /* ksh or sh would be okay here */ #ifndef PREFSHELL -# define PREFSHELL "/bin/csh" +# define PREFSHELL "/bin/sh" #endif /* path to fastest starting shell */ diff --git a/worm/Makefile b/worm/Makefile index 99985b11..b57264ee 100644 --- a/worm/Makefile +++ b/worm/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/worms/Makefile b/worms/Makefile index f96a8bbd..d1fda31c 100644 --- a/worms/Makefile +++ b/worms/Makefile @@ -12,8 +12,8 @@ $(PROG): $(SRCS) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) clean: rm -f $(CLEANFILES) $(PROG) diff --git a/wtf/Makefile b/wtf/Makefile index b5c694e8..9a6ff806 100644 --- a/wtf/Makefile +++ b/wtf/Makefile @@ -6,7 +6,7 @@ MAN= wtf.6 all: install: $(MAN) $(SCRIPTS) - $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/usr/games/$(basename $(SCRIPTS)) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm755 $(SCRIPTS) $(DESTDIR)/$(PREFIX)/games/$(basename $(SCRIPTS)) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) .PHONY: all install clean diff --git a/wump/Makefile b/wump/Makefile index 49ca6588..43bdc1da 100644 --- a/wump/Makefile +++ b/wump/Makefile @@ -5,17 +5,17 @@ PROG= wump MAN= wump.6 SRCS= wump.c FILES=wump.info -FILESDIR=/usr/share/games +FILESDIR=$(PREFIX)/share/games all: $(PROG) $(PROG): $(SRCS) - $(CC) $(CFLAGS) -o $(PROG) $(SRCS) + $(CC) $(CFLAGS) -o $(PROG) $(SRCS) -I$(ROOT) $(STRIP) $(PROG) install: $(PROG) $(MAN) - $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/usr/games/$(PROG) - $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/usr/share/man/man6/$(MAN) + $(GINSTALL) -Dm2755 $(PROG) $(DESTDIR)/$(PREFIX)/games/$(PROG) + $(GINSTALL) -Dm644 $(MAN) $(DESTDIR)/$(PREFIX)/share/man/man6/$(MAN) $(GINSTALL) -Dm644 $(FILES) $(DESTDIR)$(FILESDIR) clean: diff --git a/wump/pathnames.h b/wump/pathnames.h index d3984f12..c1e99eb4 100644 --- a/wump/pathnames.h +++ b/wump/pathnames.h @@ -31,5 +31,7 @@ * @(#)pathnames.h 8.1 (Berkeley) 5/31/93 */ -#define _PATH_PAGER "/usr/bin/more" -#define _PATH_WUMPINFO "/usr/share/games/wump.info" +#include "config.h" + +#define _PATH_PAGER PREFIX"/bin/more" +#define _PATH_WUMPINFO PREFIX"/share/games/wump.info" -- cgit v1.2.3-56-ge451