aboutsummaryrefslogtreecommitdiff
path: root/games/bsdgames
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2009-11-21 22:00:34 +0000
committerMartin Wilke <miwi@FreeBSD.org>2009-11-21 22:00:34 +0000
commit858884a7f02d5854bef7403058c54c37abb3e308 (patch)
tree24574a73abb012bd1d899d167a7abf3021a27798 /games/bsdgames
parentf08269464767d9c55be4fa8f53c61b2e84193340 (diff)
downloadports-858884a7f02d5854bef7403058c54c37abb3e308.tar.gz
ports-858884a7f02d5854bef7403058c54c37abb3e308.zip
Notes
Diffstat (limited to 'games/bsdgames')
-rw-r--r--games/bsdgames/Makefile70
-rw-r--r--games/bsdgames/distinfo6
-rw-r--r--games/bsdgames/files/patch-Makefile35
-rw-r--r--games/bsdgames/files/patch-Makefile.inc47
-rw-r--r--games/bsdgames/files/patch-adventure_crc.c11
-rw-r--r--games/bsdgames/files/patch-adventure_hdr.h11
-rw-r--r--games/bsdgames/files/patch-atc_Makefile10
-rw-r--r--games/bsdgames/files/patch-atc_include.h35
-rw-r--r--games/bsdgames/files/patch-atc_input.c23
-rw-r--r--games/bsdgames/files/patch-atc_main.c47
-rw-r--r--games/bsdgames/files/patch-backgammon_backgammon_main.c29
-rw-r--r--games/bsdgames/files/patch-backgammon_common__source_back.h25
-rw-r--r--games/bsdgames/files/patch-backgammon_common__source_subs.c10
-rw-r--r--games/bsdgames/files/patch-backgammon_teachgammon_teach.c25
-rw-r--r--games/bsdgames/files/patch-battlestar_init.c11
-rw-r--r--games/bsdgames/files/patch-dfly40
-rw-r--r--games/bsdgames/files/patch-hack51
-rw-r--r--games/bsdgames/files/patch-hack_Makefile12
-rw-r--r--games/bsdgames/files/patch-hack_config.h9
-rw-r--r--games/bsdgames/files/patch-hack_hack.ioctl.c29
-rw-r--r--games/bsdgames/files/patch-hack_hack.pager.c10
-rw-r--r--games/bsdgames/files/patch-hack_hack.shk.c46
-rw-r--r--games/bsdgames/files/patch-hack_hack.termcap.c26
-rw-r--r--games/bsdgames/files/patch-hack_hack.tty.c42
-rw-r--r--games/bsdgames/files/patch-hack_hack.unix.c13
-rw-r--r--games/bsdgames/files/patch-larn_Makefile10
-rw-r--r--games/bsdgames/files/patch-larn_diag.c31
-rw-r--r--games/bsdgames/files/patch-larn_header.h18
-rw-r--r--games/bsdgames/files/patch-larn_io.c46
-rw-r--r--games/bsdgames/files/patch-quiz175
-rw-r--r--games/bsdgames/files/patch-rogue_Makefile11
-rw-r--r--games/bsdgames/files/patch-snake_snake_move.c24
-rw-r--r--games/bsdgames/files/patch-snake_snake_snake.c10
-rw-r--r--games/bsdgames/files/patch-snake_snake_snake.h25
-rw-r--r--games/bsdgames/files/patch-trek_main.c33
-rw-r--r--games/bsdgames/files/patch-warns40
-rw-r--r--games/bsdgames/files/share.mtree11
-rw-r--r--games/bsdgames/files/var.mtree17
-rw-r--r--games/bsdgames/pkg-descr9
-rw-r--r--games/bsdgames/pkg-plist34
40 files changed, 315 insertions, 852 deletions
diff --git a/games/bsdgames/Makefile b/games/bsdgames/Makefile
index 472a6934d69a..d48b6f6d7695 100644
--- a/games/bsdgames/Makefile
+++ b/games/bsdgames/Makefile
@@ -5,20 +5,20 @@
# $FreeBSD$
#
-PORTNAME= freebsd-games
-PORTVERSION= 5.1.1
-PORTREVISION= 7
+PORTNAME= bsdgames
+PORTVERSION= 2.4
+PORTEPOCH= 1
CATEGORIES= games
-MASTER_SITES= ${MASTER_SITE_LOCAL}
-MASTER_SITE_SUBDIR=markm
+# Fetched from http://gitweb.dragonflybsd.org/dragonfly.git/tree/v2.4.0:/games
+# Content is stable, but file timestamps differ. Bad gitweb, no cookie!
+MASTER_SITES= https://www.spoerlein.net/pub/
-MAINTAINER= uspoerlein@gmail.com
-COMMENT= FreeBSD-modified "Standard" BSD games
+MAINTAINER= uqs@spoerlein.net
+COMMENT= Traditional BSD games taken from DragonFly BSD
+WRKSRC= ${WRKDIR}/dragonfly
USE_BZIP2= yes
-
-MAN6= \
- adventure.6 \
+MAN6= adventure.6 \
arithmetic.6 \
atc.6 \
backgammon.6 \
@@ -30,25 +30,32 @@ MAN6= \
fish.6 \
hack.6 \
hangman.6 \
+ hunt.6 \
+ huntd.6 \
larn.6 \
mille.6 \
phantasia.6 \
piano.6 \
pig.6 \
quiz.6 \
+ rain.6 \
robots.6 \
rogue.6 \
sail.6 \
snake.6 \
snscore.6 \
trek.6 \
+ wargames.6 \
worm.6 \
+ worms.6 \
wump.6
MANCOMPRESSED= maybe
-PATHNAME_FILES= atc/atc.6 \
+# contain /usr/share/games
+SHAREPATH_FILES=atc/atc.6 \
atc/pathnames.h \
+ cribbage/cribbage.6 \
cribbage/pathnames.h \
fish/pathnames.h \
larn/pathnames.h \
@@ -57,25 +64,32 @@ PATHNAME_FILES= atc/atc.6 \
quiz/quiz.6 \
wump/pathnames.h
-MAKE_JOBS_UNSAFE= yes
-
-.include <bsd.port.pre.mk>
-
-post-extract:
- @(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} \
- ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} extract)
+# contain /usr/games/*
+GAMESPATH_FILES=backgammon/backgammon/backgammon.6 \
+ backgammon/common_source/init.c \
+ canfield/canfield/canfield.6 \
+ cribbage/cribbage.6 \
+ hunt/hunt/hunt.6 \
+ hunt/huntd/huntd.6 \
+ phantasia/pathnames.h \
+ wargames/wargames.sh
post-patch:
- @${FIND} ${WRKSRC} -name '*.c' -or -name '*.h' -or -name '*.6' -or \
- -name 'index' | ${XARGS} ${REINPLACE_CMD} -e \
- 's|share/games|local/share/games|g'
- @${FIND} ${WRKSRC} -name 'Makefile' | \
- ${XARGS} ${REINPLACE_CMD} 's|$${LIBCOMPAT}||g;;s|-lcompat||g'
- @for f in ${PATHNAME_FILES}; do \
- ${REINPLACE_CMD} -e 's|/usr/local/local/local|${PREFIX}|g' \
+ @for f in ${SHAREPATH_FILES}; do \
+ ${REINPLACE_CMD} -e 's|/usr/share/games|${PREFIX}/share/games|g' \
${WRKSRC}/$${f}; \
done
- @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \
- "${WRKSRC}/hack/hack.unix.c"
+ @for f in ${GAMESPATH_FILES}; do \
+ ${REINPLACE_CMD} -e 's|/usr/games|${PREFIX}/bin|g' \
+ ${WRKSRC}/$${f}; \
+ done
+
+# Only useful for DESTDIR
+VARDIR?= /var
+
+pre-install:
+ ${MKDIR} ${VARDIR}
+ mtree -deU -f ${FILESDIR}/var.mtree -p ${VARDIR}
+ mtree -deU -f ${FILESDIR}/share.mtree -p ${PREFIX}/share
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/games/bsdgames/distinfo b/games/bsdgames/distinfo
index 0e72990e3eb4..bfba03f2d3d3 100644
--- a/games/bsdgames/distinfo
+++ b/games/bsdgames/distinfo
@@ -1,3 +1,3 @@
-MD5 (freebsd-games-5.1.1.tar.bz2) = 31c098a1ef0d198a6456e26b6d65be72
-SHA256 (freebsd-games-5.1.1.tar.bz2) = 2ef700e090c975c7d6807a556ca29acc11215ba43f3ad26ad555a63cb3f72f71
-SIZE (freebsd-games-5.1.1.tar.bz2) = 2434501
+MD5 (bsdgames-2.4.tar.bz2) = cd05ba9ade4c905520222d54845d4b13
+SHA256 (bsdgames-2.4.tar.bz2) = c89da5b3a63b3d5b4ecb9658a549a0ade114529d10890cd6cf0979a96a28ce19
+SIZE (bsdgames-2.4.tar.bz2) = 2011321
diff --git a/games/bsdgames/files/patch-Makefile b/games/bsdgames/files/patch-Makefile
new file mode 100644
index 000000000000..07b07f9fa0d0
--- /dev/null
+++ b/games/bsdgames/files/patch-Makefile
@@ -0,0 +1,35 @@
+--- Makefile.orig 2009-09-24 10:46:30.000000000 +0200
++++ Makefile 2009-11-04 18:14:08.698185298 +0100
+@@ -8,32 +8,20 @@
+ atc \
+ backgammon \
+ battlestar \
+- bcd \
+ bs \
+- caesar \
+ canfield \
+ cribbage \
+- dm \
+- factor \
+ fish \
+- fortune \
+- grdc \
+ hack \
+ hangman \
+ hunt \
+ larn \
+ mille \
+- morse \
+- number \
+ phantasia \
+ piano \
+ pig \
+- pom \
+- ppt \
+- primes \
+ quiz \
+ rain \
+- random \
+ robots \
+ rogue \
+ sail \
diff --git a/games/bsdgames/files/patch-Makefile.inc b/games/bsdgames/files/patch-Makefile.inc
new file mode 100644
index 000000000000..ccf013c21d89
--- /dev/null
+++ b/games/bsdgames/files/patch-Makefile.inc
@@ -0,0 +1,47 @@
+--- Makefile.inc.orig 2009-09-24 10:46:30.000000000 +0200
++++ Makefile.inc 2009-11-04 20:09:49.102229343 +0100
+@@ -2,14 +2,40 @@
+ # $FreeBSD: /tmp/pcvs/ports/games/bsdgames/files/patch-Makefile.inc,v 1.1 2009-11-21 22:00:33 miwi Exp $
+ # $DragonFly: src/games/Makefile.inc,v 1.3 2006/10/08 16:22:34 pavalos Exp $
+
+-BINDIR?= /usr/games
++PREFIX?= /usr/local
++BINDIR?= ${PREFIX}/bin
++SHAREDIR= ${PREFIX}/share
++MANDIR= ${PREFIX}/man/man
+ FILESDIR?= ${SHAREDIR}/games
+ WARNS?= 6
+
+ .if defined(HIDEGAME)
+-ORIGBINDIR:= ${BINDIR}
+-BINDIR:= ${BINDIR}/hide
+-ORIGBINGRP:= ${BINGRP}
+ BINGRP= games
+ BINMODE= 550
+ .endif
++
++# cribbed from DragonflyBSD build system
++
++NXCC?= ${CC}
++NXCFLAGS?= ${CFLAGS:N-mtune*:N-mcpu*:N-march*}
++
++.SUFFIXES: .nx .no
++
++# .no == native object file, for helper code when cross building.
++#
++.c.no:
++ ${NXCC} ${_${.IMPSRC:T}_FLAGS} ${NXCFLAGS} -c ${.IMPSRC} -o ${.TARGET}
++
++.y.no:
++ ${YACC} ${YFLAGS} ${.IMPSRC}
++ ${NXCC} ${NXCFLAGS} -c y.tab.c -o ${.TARGET}
++ rm -f y.tab.c
++
++.l.no:
++ ${LEX} ${LFLAGS} -o${.TARGET}.c ${.IMPSRC}
++ ${NXCC} ${NXCFLAGS} -c ${.TARGET}.c -o ${.TARGET}
++ rm -f ${.TARGET}.c
++
++.no.nx .c.nx:
++ ${NXCC} ${_${.IMPSRC:T}_FLAGS} ${NXCFLAGS} ${NXLDFLAGS} ${.IMPSRC} \
++ ${NXLDLIBS} -o ${.TARGET}
diff --git a/games/bsdgames/files/patch-adventure_crc.c b/games/bsdgames/files/patch-adventure_crc.c
deleted file mode 100644
index dfca63e6ab53..000000000000
--- a/games/bsdgames/files/patch-adventure_crc.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- adventure/crc.c.bak Sat Feb 23 01:59:45 2002
-+++ adventure/crc.c Wed Sep 29 03:29:37 2004
-@@ -120,7 +120,7 @@
-
- /* Process nr bytes at a time; ptr points to them */
- u_long
--crc(const char *ptr, size_t nr)
-+crc(const char *ptr, ssize_t nr)
- {
- int i;
- const char *p;
diff --git a/games/bsdgames/files/patch-adventure_hdr.h b/games/bsdgames/files/patch-adventure_hdr.h
deleted file mode 100644
index 02344c9191b4..000000000000
--- a/games/bsdgames/files/patch-adventure_hdr.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- adventure/hdr.h.bak Mon Nov 10 15:46:52 2003
-+++ adventure/hdr.h Wed Sep 29 03:30:55 2004
-@@ -167,7 +167,7 @@
- void checkhints (void);
- void ciao (void);
- extern gid_t egid;
--u_long crc (const char *ptr, size_t nr);
-+u_long crc (const char *ptr, ssize_t nr);
- void crc_start (void);
- int dark (void);
- void datime (int *d, int *t);
diff --git a/games/bsdgames/files/patch-atc_Makefile b/games/bsdgames/files/patch-atc_Makefile
deleted file mode 100644
index b225c610b586..000000000000
--- a/games/bsdgames/files/patch-atc_Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-Index: atc/Makefile
-@@ -2,7 +2,7 @@
- # $FreeBSD$
-
- PROG= atc
--CFLAGS+=-DBSD -I${.CURDIR} -I.
-+CFLAGS+=-DPOSIX -I${.CURDIR} -I.
- SRCS= extern.c grammar.y graphics.c input.c lex.l list.c log.c \
- main.c tunable.c update.c y.tab.h
- MAN= atc.6
diff --git a/games/bsdgames/files/patch-atc_include.h b/games/bsdgames/files/patch-atc_include.h
deleted file mode 100644
index e35e06466e45..000000000000
--- a/games/bsdgames/files/patch-atc_include.h
+++ /dev/null
@@ -1,35 +0,0 @@
-Index: atc/include.h
-@@ -63,6 +63,14 @@
- #include <sys/utsname.h>
- #endif
-
-+#ifdef POSIX
-+#include <termios.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+#include <string.h>
-+#include <sys/utsname.h>
-+#endif
-+
- #include <signal.h>
- #include <math.h>
-
-@@ -76,6 +84,18 @@
- #define srandom srand
- #define random rand
- #define sgttyb termio
-+#define sg_erase c_cc[VERASE]
-+#define sg_kill c_cc[VKILL]
-+#endif
-+
-+#ifdef POSIX
-+#define index strchr
-+#define rindex strrchr
-+#define bcopy(a,b,c) memcpy((b), (a), (c))
-+#define bzero(a,b) memset((a), '\0', (b))
-+#define srandom srand
-+#define random rand
-+#define sgttyb termios
- #define sg_erase c_cc[2]
- #define sg_kill c_cc[3]
- #endif
diff --git a/games/bsdgames/files/patch-atc_input.c b/games/bsdgames/files/patch-atc_input.c
deleted file mode 100644
index 7cafb6d74459..000000000000
--- a/games/bsdgames/files/patch-atc_input.c
+++ /dev/null
@@ -1,23 +0,0 @@
-Index: atc/input.c
-@@ -323,6 +323,10 @@
- int aval;
- aval = alarm(0);
- #endif
-+#ifdef POSIX
-+ int aval;
-+ aval = alarm(0);
-+#endif
- if (fork() == 0) /* child */
- {
- char *shell, *base;
-@@ -358,6 +362,10 @@
- #endif
- #ifdef SYSV
- ioctl(fileno(stdin), TCSETAW, &tty_new);
-+ alarm(aval);
-+#endif
-+#ifdef POSIX
-+ tcsetattr(fileno(stdin), TCSANOW, &tty_new);
- alarm(aval);
- #endif
- }
diff --git a/games/bsdgames/files/patch-atc_main.c b/games/bsdgames/files/patch-atc_main.c
deleted file mode 100644
index 3592011afea8..000000000000
--- a/games/bsdgames/files/patch-atc_main.c
+++ /dev/null
@@ -1,47 +0,0 @@
-Index: atc/main.c
-@@ -173,6 +173,15 @@
- ioctl(fileno(stdin), TCSETAW, &tty_new);
- #endif
-
-+#ifdef POSIX
-+ tcgetattr(fileno(stdin), &tty_start);
-+ bcopy(&tty_start, &tty_new, sizeof(tty_new));
-+ tty_new.c_lflag &= ~ICANON;
-+ tty_new.c_lflag &= ~ECHO;
-+ tty_new.c_cc[VMIN] = 1;
-+ tty_new.c_cc[VTIME] = 0;
-+ tcsetattr(fileno(stdin), TCSANOW, &tty_new);
-+#endif
- signal(SIGALRM, update);
-
- #ifdef BSD
-@@ -185,6 +194,9 @@
- #ifdef SYSV
- alarm(sp->update_secs);
- #endif
-+#ifdef POSIX
-+ alarm(sp->update_secs);
-+#endif
-
- for (;;) {
- if (getcommand() != 1)
-@@ -198,6 +210,9 @@
- #ifdef SYSV
- alarm(0);
- #endif
-+#ifdef POSIX
-+ alarm(0);
-+#endif
-
- update();
-
-@@ -209,6 +224,9 @@
- setitimer(ITIMER_REAL, &itv, NULL);
- #endif
- #ifdef SYSV
-+ alarm(sp->update_secs);
-+#endif
-+#ifdef POSIX
- alarm(sp->update_secs);
- #endif
- }
diff --git a/games/bsdgames/files/patch-backgammon_backgammon_main.c b/games/bsdgames/files/patch-backgammon_backgammon_main.c
deleted file mode 100644
index 840d4ba48057..000000000000
--- a/games/bsdgames/files/patch-backgammon_backgammon_main.c
+++ /dev/null
@@ -1,29 +0,0 @@
-Index: backgammon/backgammon/main.c
-@@ -113,13 +111,13 @@
- signal (SIGINT,getout); /* trap interrupts */
- if (gtty (0,&tty) == -1) /* get old tty mode */
- errexit ("backgammon(gtty)");
-- old = tty.sg_flags;
-+ old = tty.c_lflag;
- #ifdef V7
-- raw = ((noech = old & ~ECHO) | CBREAK); /* set up modes */
-+ raw = ((noech = old & ~ECHO) & ~ICANON); /* set up modes */
- #else
- raw = ((noech = old & ~ECHO) | RAW); /* set up modes */
- #endif
-- ospeed = tty.sg_ospeed; /* for termlib */
-+ ospeed = cfgetospeed(&tty); /* for termlib */
-
- /* get terminal
- * capabilities, and
-@@ -135,8 +133,8 @@
- getarg (argc, argv);
- args[acnt] = NULL;
- if (tflag) { /* clear screen */
-- noech &= ~(CRMOD|XTABS);
-- raw &= ~(CRMOD|XTABS);
-+ noech &= ~(ICRNL|OXTABS);
-+ raw &= ~(ICRNL|OXTABS);
- clear();
- }
- fixtty (raw); /* go into raw mode */
diff --git a/games/bsdgames/files/patch-backgammon_common__source_back.h b/games/bsdgames/files/patch-backgammon_common__source_back.h
deleted file mode 100644
index 2542f462c63e..000000000000
--- a/games/bsdgames/files/patch-backgammon_common__source_back.h
+++ /dev/null
@@ -1,25 +0,0 @@
-Index: backgammon/common_source/back.h
-@@ -33,7 +33,13 @@
- * @(#)back.h 8.1 (Berkeley) 5/31/93
- */
-
--#include <sgtty.h>
-+#include <termios.h>
-+
-+#define sg_erase c_cc[2]
-+#define sg_kill c_cc[3]
-+
-+#define gtty(_a,_b) tcgetattr(_a,_b)
-+#define stty(_a,_b) tcsetattr(_a,TCSANOW,_b)
-
- #define rnum(r) (random()%r)
- #define D0 dice[0]
-@@ -114,7 +120,7 @@
- extern const char *const *Colorptr; /* color of current player, capitalized */
- extern int colen; /* length of color of current player */
-
--extern struct sgttyb tty; /* tty information buffer */
-+extern struct termios tty; /* tty information buffer */
- extern int old; /* original tty status */
- extern int noech; /* original tty status without echo */
- extern int raw; /* raw tty status, no echo */
diff --git a/games/bsdgames/files/patch-backgammon_common__source_subs.c b/games/bsdgames/files/patch-backgammon_common__source_subs.c
deleted file mode 100644
index 646faa72d625..000000000000
--- a/games/bsdgames/files/patch-backgammon_common__source_subs.c
+++ /dev/null
@@ -1,10 +0,0 @@
-Index: backgammon/common_source/subs.c
-@@ -420,7 +418,7 @@
- if (tflag)
- newpos();
- buflush();
-- tty.sg_flags = mode;
-+ tty.c_lflag = mode;
- if (stty (0,&tty) < 0)
- errexit("fixtty");
- }
diff --git a/games/bsdgames/files/patch-backgammon_teachgammon_teach.c b/games/bsdgames/files/patch-backgammon_teachgammon_teach.c
deleted file mode 100644
index 8b1ae587e9e8..000000000000
--- a/games/bsdgames/files/patch-backgammon_teachgammon_teach.c
+++ /dev/null
@@ -1,25 +0,0 @@
-Index: backgammon/teachgammon/teach.c
-@@ -94,18 +92,18 @@
- signal (SIGINT,getout);
- if (gtty (0,&tty) == -1) /* get old tty mode */
- errexit ("teachgammon(gtty)");
-- old = tty.sg_flags;
-+ old = tty.c_lflag;
- #ifdef V7
-- raw = ((noech = old & ~ECHO) | CBREAK); /* set up modes */
-+ raw = ((noech = old & ~ECHO) & ~ICANON); /* set up modes */
- #else
- raw = ((noech = old & ~ECHO) | RAW); /* set up modes */
- #endif
-- ospeed = tty.sg_ospeed; /* for termlib */
-+ ospeed = cfgetospeed(&tty); /* for termlib */
- tflag = getcaps (getenv ("TERM"));
- getarg (argc, argv);
- if (tflag) {
-- noech &= ~(CRMOD|XTABS);
-- raw &= ~(CRMOD|XTABS);
-+ noech &= ~(ICRNL|OXTABS);
-+ raw &= ~(ICRNL|OXTABS);
- clear();
- }
- text (hello);
diff --git a/games/bsdgames/files/patch-battlestar_init.c b/games/bsdgames/files/patch-battlestar_init.c
deleted file mode 100644
index 077107c3e5aa..000000000000
--- a/games/bsdgames/files/patch-battlestar_init.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- battlestar/init.c.old Mon Dec 15 17:48:41 2003
-+++ battlestar/init.c Mon Dec 15 17:48:54 2003
-@@ -62,7 +62,7 @@
- puts("Admiral D.W. Riggle\n");
- srandomdev();
- getutmp(uname);
-- if (startup)
-+ if (startup == NULL)
- location = dayfile;
- wiz = wizard(uname);
- wordinit();
diff --git a/games/bsdgames/files/patch-dfly b/games/bsdgames/files/patch-dfly
new file mode 100644
index 000000000000..f67f19f89f11
--- /dev/null
+++ b/games/bsdgames/files/patch-dfly
@@ -0,0 +1,40 @@
+--- ./cribbage/instr.c
++++ ./cribbage/instr.c
+@@ -51,7 +51,11 @@ void
+ instructions(void)
+ {
+ struct stat sb;
++#ifdef __DragonFly__
+ union wait pstat;
++#else
++ int pstat;
++#endif
+ pid_t pid;
+ const char *pager, *path;
+
+@@ -77,7 +81,11 @@ instructions(void)
+ do {
+ pid = waitpid(pid, (int *)&pstat, 0);
+ } while (pid == -1 && errno == EINTR);
++#ifdef __DragonFly__
+ if (pid == -1 || pstat.w_status)
++#else
++ if (pid == -1 || WEXITSTATUS(pstat) || WTERMSIG(pstat))
++#endif
+ exit(1);
+ }
+ }
+--- ./sail/pl_1.c
++++ ./sail/pl_1.c
+@@ -122,7 +122,11 @@ choke(void)
+ void
+ child(void)
+ {
++#ifdef __DragonFly__
+ union wait status;
++#else
++ int status;
++#endif
+ int pid;
+
+ signal(SIGCHLD, SIG_IGN);
diff --git a/games/bsdgames/files/patch-hack b/games/bsdgames/files/patch-hack
new file mode 100644
index 000000000000..7165fa62fdb9
--- /dev/null
+++ b/games/bsdgames/files/patch-hack
@@ -0,0 +1,51 @@
+--- hack/hack.unix.c.orig 2009-09-24 10:46:30.000000000 +0200
++++ hack/hack.unix.c 2009-11-04 18:49:58.645035610 +0100
+@@ -19,7 +19,9 @@
+
+ #include <sys/types.h> /* for time_t and stat */
+ #include <sys/stat.h>
++#include <sys/param.h>
+ #include <time.h>
++#include <err.h>
+
+ static struct tm *getlt(void);
+ static bool veryold(int);
+@@ -95,13 +97,32 @@
+ void
+ gethdate(const char *name)
+ {
+-/* old version - for people short of space */
+-char *np;
++ char *p, *np, *path;
++ char filename[MAXPATHLEN+1];
+
+- name = "/usr/games/hide/hack";
+- if(stat(name, &hbuf))
+- error("Cannot get status of %s.",
+- (np = rindex(name, '/')) ? np+1 : name);
++ if (strchr(name, '/') != NULL || (p = getenv("PATH")) == NULL)
++ p = "";
++ np = path = strdup(p); /* Make a copy for strsep. */
++ if (path == NULL)
++ err(1, NULL);
++
++ for (;;) {
++ if ((p = strsep(&np, ":")) == NULL)
++ break;
++ if (*p == '\0') /* :: */
++ (void) strlcpy(filename, name, sizeof filename);
++ else
++ (void) snprintf(filename, sizeof filename,
++ "%s/%s", p, name);
++
++ if (stat(filename, &hbuf) == 0) {
++ free(path);
++ return;
++ }
++ }
++ error("Cannot get status of %s.",
++ (p = strrchr(name, '/')) ? p+1 : name);
++ free(path);
+ }
+
+ bool
diff --git a/games/bsdgames/files/patch-hack_Makefile b/games/bsdgames/files/patch-hack_Makefile
deleted file mode 100644
index 384893572eb5..000000000000
--- a/games/bsdgames/files/patch-hack_Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-Index: hack/Makefile
-@@ -17,7 +17,9 @@
- MAN= hack.6
- DPADD= ${LIBTERMCAP} ${LIBCOMPAT}
- LDADD= -ltermcap -lcompat
--CFLAGS+= -fwritable-strings -I${.CURDIR} -I.
-+CFLAGS+= -DPOSIX -I${.CURDIR} -I.
-+BINGRP=games
-+BINMODE=2555
- FILES= rumors help hh data
- FILESMODE_rumors= 440
- FILESGRP= ${BINGRP}
diff --git a/games/bsdgames/files/patch-hack_config.h b/games/bsdgames/files/patch-hack_config.h
deleted file mode 100644
index cc7fd6cf95b2..000000000000
--- a/games/bsdgames/files/patch-hack_config.h
+++ /dev/null
@@ -1,9 +0,0 @@
-Index: hack/config.h
-@@ -22,7 +22,6 @@
- * 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 */
diff --git a/games/bsdgames/files/patch-hack_hack.ioctl.c b/games/bsdgames/files/patch-hack_hack.ioctl.c
deleted file mode 100644
index cd899364bed0..000000000000
--- a/games/bsdgames/files/patch-hack_hack.ioctl.c
+++ /dev/null
@@ -1,29 +0,0 @@
-Index: hack/hack.ioctl.c
-@@ -13,6 +13,9 @@
- #ifdef BSD
- #include <sgtty.h>
- struct ltchars ltchars, ltchars0;
-+#elif POSIX
-+#include <termios.h>
-+struct termios termio;
- #else
- #include <termio.h> /* also includes part of <sgtty.h> */
- struct termio termio;
-@@ -22,6 +25,8 @@
- #ifdef BSD
- (void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) &ltchars);
- (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) &ltchars0);
-+#elif POSIX
-+ tcgetattr(fileno(stdin), &termio);
- #else
- (void) ioctl(fileno(stdin), (int) TCGETA, &termio);
- #endif /* BSD */
-@@ -30,6 +35,8 @@
- setioctls() {
- #ifdef BSD
- (void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) &ltchars);
-+#elif POSIX
-+ tcsetattr(fileno(stdin), TCSANOW, &termio);
- #else
- (void) ioctl(fileno(stdin), (int) TCSETA, &termio);
- #endif /* BSD */
diff --git a/games/bsdgames/files/patch-hack_hack.pager.c b/games/bsdgames/files/patch-hack_hack.pager.c
deleted file mode 100644
index 3a9df40b839e..000000000000
--- a/games/bsdgames/files/patch-hack_hack.pager.c
+++ /dev/null
@@ -1,10 +0,0 @@
-Index: hack/hack.pager.c
-@@ -367,6 +367,8 @@
- #else
-
- #ifdef BSD
-+#include <sys/wait.h>
-+#elif POSIX
- #include <sys/wait.h>
- #else
- #include <wait.h>
diff --git a/games/bsdgames/files/patch-hack_hack.shk.c b/games/bsdgames/files/patch-hack_hack.shk.c
deleted file mode 100644
index 3c936b353a23..000000000000
--- a/games/bsdgames/files/patch-hack_hack.shk.c
+++ /dev/null
@@ -1,46 +0,0 @@
---- hack/hack.shk.c.orig Sun May 27 21:36:53 2007
-+++ hack/hack.shk.c Sun May 27 21:38:28 2007
-@@ -131,11 +131,11 @@ struct bill_x *bp = bill;
- }
- }
-
-+static void findshk();
-+
- inshop(){
- int roomno = inroom(u.ux,u.uy);
-
-- static void findshk();
--
- /* Did we just leave a shop? */
- if(u.uinshop &&
- (u.uinshop != roomno + 1 || shlevel != dlevel || !shopkeeper)) {
-@@ -308,14 +308,14 @@ struct monst *shkp;
- }
- }
-
-+static int dopayobj();
-+
- dopay(){
- long ltmp;
- struct bill_x *bp;
- struct monst *shkp;
- int pass, tmp;
-
-- static int dopayobj();
--
- multi = 0;
- (void) inshop();
- for(shkp = fmon; shkp; shkp = shkp->nmon)
-@@ -692,10 +692,11 @@ quit:
- return(0);
- }
-
-+static int realhunger();
-+
- static
- getprice(obj) struct obj *obj; {
- int tmp, ac;
-- static int realhunger();
-
- switch(obj->olet){
- case AMULET_SYM:
diff --git a/games/bsdgames/files/patch-hack_hack.termcap.c b/games/bsdgames/files/patch-hack_hack.termcap.c
deleted file mode 100644
index eefbf4a52eea..000000000000
--- a/games/bsdgames/files/patch-hack_hack.termcap.c
+++ /dev/null
@@ -1,26 +0,0 @@
---- hack/hack.termcap.c.orig Tue Nov 16 11:26:38 1999
-+++ hack/hack.termcap.c Sun May 27 21:39:48 2007
-@@ -11,10 +11,11 @@
- extern long *alloc();
-
- static char tbuf[512];
--static char *HO, *CL, *CE, *UP, *CM, *ND, *XD, *BC, *SO, *SE, *TI, *TE;
-+static char *HO, *CL, *CE, *CM, *ND, *XD, *SO, *SE, *TI, *TE;
-+char *UP, *BC;
- static char *VS, *VE;
- static int SG;
--static char PC = '\0';
-+char PC = '\0';
- char *CD; /* tested in pri.c: docorner() */
- int CO, LI; /* used in pri.c and whatis.c */
-
-@@ -35,7 +36,8 @@ startup()
- flags.nonull = 1;
- if(pc = tgetstr("pc", &tbufptr))
- PC = *pc;
-- if(!(BC = tgetstr("bc", &tbufptr))) {
-+ if(!(BC = tgetstr("bc", &tbufptr))
-+ &&!(BC = tgetstr("le", &tbufptr))) {
- if(!tgetflag("bs"))
- error("Terminal must backspace.");
- BC = tbufptr;
diff --git a/games/bsdgames/files/patch-hack_hack.tty.c b/games/bsdgames/files/patch-hack_hack.tty.c
deleted file mode 100644
index 07a126779f6a..000000000000
--- a/games/bsdgames/files/patch-hack_hack.tty.c
+++ /dev/null
@@ -1,42 +0,0 @@
-Index: hack/hack.tty.c
-@@ -53,6 +53,7 @@
- */
- #ifdef BSD
- #define V7
-+#elif POSIX
- #else
- #define USG
- #endif /* BSD */
-@@ -82,6 +83,21 @@
- #define GTTY(x) (ioctl(0, TCGETA, x))
- #define STTY(x) (ioctl(0, TCSETA, x)) /* TCSETAF? TCSETAW? */
-
-+#elif POSIX
-+#include <termios.h>
-+#define termstruct termios
-+#define kill_sym c_cc[VKILL]
-+#define erase_sym c_cc[VERASE]
-+#define EXTABS OXTABS
-+#define tabflgs c_oflag
-+#define echoflgs c_lflag
-+#define cbrkflgs c_lflag
-+#define CBRKMASK ICANON
-+#define CBRKON ! /* reverse condition */
-+#define OSPEED(x) cfgetospeed(x)
-+#define GTTY(x) tcgetattr(fileno(stdin),x)
-+#define STTY(x) tcsetattr(fileno(stdin),TCSANOW,x) /* TCSETAF? TCSETAW? */
-+
- #else /* V7 */
-
- #include <sgtty.h>
-@@ -169,6 +185,10 @@
- /* be satisfied with one character; no timeout */
- curttyb.c_cc[VMIN] = 1; /* was VEOF */
- curttyb.c_cc[VTIME] = 0; /* was VEOL */
-+#elif POSIX
-+ /* be satisfied with one character; no timeout */
-+ curttyb.c_cc[VMIN] = 1; /* was VEOF */
-+ curttyb.c_cc[VTIME] = 0; /* was VEOL */
- #endif /* USG */
- change++;
- }
diff --git a/games/bsdgames/files/patch-hack_hack.unix.c b/games/bsdgames/files/patch-hack_hack.unix.c
deleted file mode 100644
index ec4e5eab205d..000000000000
--- a/games/bsdgames/files/patch-hack_hack.unix.c
+++ /dev/null
@@ -1,13 +0,0 @@
-$FreeBSD: /tmp/pcvs/ports/games/bsdgames/files/Attic/patch-hack_hack.unix.c,v 1.1 2007-03-23 23:02:33 nox Exp $
-
---- hack/hack.unix.c.orig Thu Nov 20 10:17:36 2003
-+++ hack/hack.unix.c Thu Nov 20 10:18:09 2003
-@@ -86,7 +86,7 @@
- /* old version - for people short of space */
- char *np;
-
-- name = "/usr/games/hide/hack";
-+ name = "%%PREFIX%%/bin/hack";
- if(stat(name, &hbuf))
- error("Cannot get status of %s.",
- (np = rindex(name, '/')) ? np+1 : name);
diff --git a/games/bsdgames/files/patch-larn_Makefile b/games/bsdgames/files/patch-larn_Makefile
deleted file mode 100644
index 3671991924cb..000000000000
--- a/games/bsdgames/files/patch-larn_Makefile
+++ /dev/null
@@ -1,10 +0,0 @@
-Index: larn/Makefile
-@@ -54,7 +54,7 @@
-
- PROG= larn
- MAN= larn.6
--CFLAGS+=-DBSD -DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE -fwritable-strings -DNOVARARGS
-+CFLAGS+=-DPOSIX -DVER=12 -DSUBVER=0 -DNONAP -DUIDSCORE -DNOVARARGS
- SRCS= main.c object.c create.c tok.c display.c global.c data.c io.c \
- monster.c store.c diag.c help.c config.c nap.c bill.c scores.c \
- signal.c moreobj.c movem.c regen.c fortune.c savelev.c
diff --git a/games/bsdgames/files/patch-larn_diag.c b/games/bsdgames/files/patch-larn_diag.c
deleted file mode 100644
index 0129c5e747fe..000000000000
--- a/games/bsdgames/files/patch-larn_diag.c
+++ /dev/null
@@ -1,31 +0,0 @@
-$FreeBSD: /tmp/pcvs/ports/games/bsdgames/files/Attic/patch-larn_diag.c,v 1.1 2007-03-23 23:02:33 nox Exp $
-
---- larn/diag.c 17 Jun 2003 04:25:24 -0000 1.2
-+++ larn/diag.c 21 Jun 2004 02:28:34 -0000 1.3
-@@ -210,7 +210,7 @@
- if (beenhere[k])
- lrfill((char*)&cell[k*MAXX*MAXY],sizeof(struct cel)*MAXY*MAXX);
-
-- lrfill((char*)&c[0],100*sizeof(long)); gtime = lrint();
-+ lrfill((char*)&c[0],100*sizeof(long)); gtime = lrint_x();
- level = c[CAVELEVEL] = lgetc();
- playerx = lgetc(); playery = lgetc();
- lrfill((char*)iven,26); lrfill((char*)ivenarg,26*sizeof(short));
-@@ -241,7 +241,7 @@
- }
-
- time(&zzz);
-- initialtime = zzz-lrint();
-+ initialtime = zzz-lrint_x();
- fstat(fd,&filetimes); /* get the creation and modification time of file */
- lrfill((char*)&zzz,sizeof(long)); zzz += 6;
- if (filetimes.st_ctime > zzz) fsorry(); /* file create time */
-@@ -249,7 +249,7 @@
- if (c[HP]<0) { died(284); return; } /* died a post mortem death */
-
- oldx = oldy = 0;
-- i = lrint(); /* inode # */
-+ i = lrint_x(); /* inode # */
- if (i && (filetimes.st_ino!=i)) fsorry();
- lrclose();
- if (strcmp(fname,ckpfile) == 0)
diff --git a/games/bsdgames/files/patch-larn_header.h b/games/bsdgames/files/patch-larn_header.h
deleted file mode 100644
index 96f43651a9c7..000000000000
--- a/games/bsdgames/files/patch-larn_header.h
+++ /dev/null
@@ -1,18 +0,0 @@
-Index: larn/header.h
-@@ -326,7 +326,6 @@
- #define DEMONLORD 57
- #define DEMONPRINCE 64
-
--#define NULL 0
- #define BUFBIG 4096 /* size of the output buffer */
- #define MAXIBUF 4096 /* size of the input buffer */
- #define LOGNAMESIZE 40 /* max size of the players name */
-@@ -359,7 +359,7 @@
-
- char *fortune(),*lgetw(),*lgetl();
- char *tmcapcnv();
--long paytaxes(),lgetc(),lrint();
-+long paytaxes(),lgetc(),lrint_x();
- unsigned long readnum();
-
- /* macro to create scroll #'s with probability of occurrence */
diff --git a/games/bsdgames/files/patch-larn_io.c b/games/bsdgames/files/patch-larn_io.c
deleted file mode 100644
index bbbb35860082..000000000000
--- a/games/bsdgames/files/patch-larn_io.c
+++ /dev/null
@@ -1,46 +0,0 @@
-Index: larn/io.c
-@@ -24,7 +24,7 @@
- * FILE INPUT ROUTINES
- *
- * long lgetc() read one character from input buffer
-- * long lrint() read one integer from input buffer
-+ * long lrint_x() read one integer from input buffer
- * lrfill(address,number) put input bytes into a buffer
- * char *lgetw() get a whitespace ended word from input
- * char *lgetl() get a \n or EOF ended line from input
-@@ -69,6 +69,17 @@
- _a.c_cc[VMIN]=1;_a.c_cc[VTIME]=1;_a.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL)
- #define unraw(_a) _a.c_cc[VMIN]=saveeof;_a.c_cc[VTIME]=saveeol;_a.c_lflag |= ICANON|ECHO|ECHOE|ECHOK|ECHONL
-
-+#elif POSIX
-+#include <termios.h>
-+#define sgttyb termios
-+#define gtty(_a,_b) tcgetattr(_a,_b)
-+#define stty(_a,_b) tcsetattr(_a,TCSANOW,_b)
-+static int rawflg = 0;
-+static char saveeof,saveeol;
-+#define doraw(_a) if(!rawflg){++rawflg;saveeof=_a.c_cc[VMIN];saveeol=_a.c_cc[VTIME];}\
-+ _a.c_cc[VMIN]=1;_a.c_cc[VTIME]=1;_a.c_lflag &= ~(ICANON|ECHO|ECHOE|ECHOK|ECHONL)
-+#define unraw(_a) _a.c_cc[VMIN]=saveeof;_a.c_cc[VTIME]=saveeol;_a.c_lflag |= ICANON|ECHO|ECHOE|ECHOK|ECHONL
-+
- #else /* not SYSV */
-
- #ifndef BSD
-@@ -345,7 +356,7 @@
- }
-
- /*
-- * long lrint() Read one integer from input buffer
-+ * long lrint_x() Read one integer from input buffer
- *
- * +---------+---------+---------+---------+
- * | high | | | low |
-@@ -357,7 +368,7 @@
- * The save order is low order first, to high order (4 bytes total)
- * Returns the int read
- */
--long lrint()
-+long lrint_x()
- {
- unsigned long i;
- i = 255 & lgetc(); i |= (255 & lgetc()) << 8;
diff --git a/games/bsdgames/files/patch-quiz b/games/bsdgames/files/patch-quiz
deleted file mode 100644
index 9f4832ba2ae0..000000000000
--- a/games/bsdgames/files/patch-quiz
+++ /dev/null
@@ -1,175 +0,0 @@
-Index: index
-===================================================================
-RCS file: /ncvs/src/games/quiz/datfiles/index,v
-retrieving revision 1.1.1.1
-diff -u -r1.1.1.1 index
---- quiz/datfiles/index 4 Sep 1994 04:03:09 -0000 1.1.1.1
-+++ quiz/datfiles/index 20 Sep 2002 23:49:50 -0000
-@@ -21,7 +21,7 @@
- /usr/local/local/share/games/quiz.db/murders:victim:killer
- /usr/local/local/share/games/quiz.db/poetry:poem{-}line:next:poem:author
- /usr/local/local/share/games/quiz.db/posneg:pos{itive}:neg{ative}
--/usr/local/local/share/games/quiz.db/pres:pres{ident}:term:succ{essor}
-+/usr/local/local/share/games/quiz.db/pres:pres{ident}:term:vice:succ{essor}
- /usr/local/local/share/games/quiz.db/province:province:cap{ital}
- /usr/local/local/share/games/quiz.db/seq-easy:easy{-}{seq{uence}}:next:name
- /usr/local/local/share/games/quiz.db/seq-hard:hard{-}{seq{uence}}:next:name
-Index: pres
-===================================================================
-RCS file: /ncvs/src/games/quiz/datfiles/pres,v
-retrieving revision 1.1.1.1
-diff -u -r1.1.1.1 pres
---- quiz/datfiles/pres 4 Sep 1994 04:03:10 -0000 1.1.1.1
-+++ quiz/datfiles/pres 20 Sep 2002 23:38:18 -0000
-@@ -1,38 +1,83 @@
--{G{eorge} }Washington:1789-{17}97:{J{ohn} }Adams
--{J{ohn} }Adams:1797-1801:{T{homas} }Jefferson
--{T{homas} }Jefferson:1801-{{18}0}9:{J{ames} }Madison
--{J{ames} }Madison:1809-{18}17:{J{ames} }Monroe
--{J{ames} }Monroe:1817-1825:{J{ohn} }{Q{uincy} }Adams
--{J{ohn} }{Q{uincy} }Adams:1825-{{18}2}9:{A{ndrew} }Jackson
--{A{ndrew} }Jackson:1829-{18}37:{M{artin} }Van Buren
--{M{artin} }Van Buren:1837-{18}41:{W{illiam|m} }{H{enry} }Harrison
--{W{illiam|m} }{H{enry} }Harrison:1841:{J{ohn} }Tyler
--{J{ohn} }Tyler:1841-{{18}4}5:{J{ames} }{K{nox} }Polk
--{J{ames} }{K{nox} }Polk:1845-{{18}4}9:{Z{achary} }Taylor
--{Z{achary} }Taylor:1849-{18}50:{M{illard} }Fillmore
--{M{illard} }Fillmore:1850-{{18}5}3:{F{ranklin} }Pierce
--{F{ranklin} }Pierce:1853-{{18}5}7:{J{ames} }Buchanan
--{J{ames} }Buchanan:1857-{18}61:{A{braham|be} }Lincoln
--{A{braham|be} }Lincoln:1861-{{18}6}5:{A{ndrew} }Johnson
--{A{ndrew} }Johnson:1865-{{18}6}9:{U{lysses} }{S{impson} }Grant
--{U{lysses} }{S{impson} }Grant:1869-{18}77:{R{utherford} }{B{irchard} }Hayes
--{R{utherford} }{B{irchard} }Hayes:1877-{18}81:{J{ames} }{A{bram} }Garfield
--{J{ames} }{A{bram} }Garfield:1881:{C{hester} }{A{lan} }Arthur
--{C{hester} }{A{lan} }Arthur:1881-{{18}8}5:{G{rover} }Cleveland{ (1st term)}
--{G{rover} }Cleveland{ (1st term)}:1885-{{18}8}9:{B{enjamin} }Harrison
--{B{enjamin} }Harrison:1889-{18}93:{G{rover} }Cleveland{ (2nd term)}
--{G{rover} }Cleveland{ (2nd term)}:1893-{18}97:{W{illiam|m} }McKinley
--{W{illiam|m} }McKinley:1897-1901:{T{heodore|eddy} }Roosevelt|TR
--{T{heodore|eddy} }Roosevelt|TR:1901-{{19}0}9:{W{illiam|m} }{H{oward} }Taft
--{W{illiam|m} }{H{oward} }Taft:1909-{19}13:{W{oodrow} }Wilson
--{W{oodrow} }Wilson:1913-{19}21:{W{arren} }{G{amaliel} }Harding
--{W{arren} }{G{amaliel} }Harding:1921-{{19}2}3:{C{alvin} }Coolidge
--{C{alvin} }Coolidge:1923-{{19}2}9:{H{erbert} }Hoover
--{H{erbert} }Hoover:1929-{19}33:{F{ranklin} }{D{elano} }Roosevelt|FDR
--{F{ranklin} }{D{elano} }Roosevelt|FDR:1933-{19}45:{H{arry} }{S }Truman
--{H{arry} }{S }Truman:1945-{19}53:{D{wight} }{D{avid} }Eisenhower
--{D{wight} }{D{avid} }Eisenhower:1953-{19}61:{J{ohn} }{F{itzgerald} }Kennedy|JFK
--{J{ohn} }{F{itzgerald} }Kennedy|JFK:1961-{{19}6}3:{L{yndon} }{B{aines} }Johnson|LBJ
--{L{yndon} }{B{aines} }Johnson|LBJ:1963-{{19}6}9:{R{ichard} }{M{ilhouse} }Nixon
--{R{ichard} }{M{ilhouse} }Nixon:1969-{19}74:{G{erald} }{R{obert} }Ford
--{G{erald} }{R{obert} }Ford:1974-:
-+{G{eorge} }Washington:1789-{17}97:{J{ohn} }Adams:{J{ohn} }Adams
-+{J{ohn} }Adams:1797-1801:{T{homas} }Jefferson:{T{homas} }Jefferson
-+{T{homas} }Jefferson:1801-{{18}0}9:{A{aron} }Burr|{G{eorge} }Clinton:\
-+{J{ames} }Madison
-+{J{ames} }Madison:1809-{18}17:{G{eorge} }Clinton|{E{lbridge} }Gerry:\
-+{J{ames} }Monroe
-+{J{ames} }Monroe:1817-1825:\
-+{D{aniel} }{D{.} }Tompkins:{J{ohn} }{Q{uincy} }Adams
-+{J{ohn} }{Q{uincy} }Adams:1825-{{18}2}9:{J{ohn} }{C{aldwell} }Calhoun:\
-+{A{ndrew} }Jackson
-+{A{ndrew} }Jackson:1829-{18}37:\
-+{J{ohn} }{C{aldwell} }Calhoun|{M{artin} }Van Buren:{M{artin} }Van Buren
-+{M{artin} }Van Buren:1837-{18}41:\
-+{R{ichard} }{M{entor} }Johnson:{W{illiam|m} }{H{enry} }Harrison
-+{W{illiam|m} }{H{enry} }Harrison:1841:{J{ohn} }Tyler:{J{ohn} }Tyler
-+{J{ohn} }Tyler:1841-{{18}4}5:[N|n]one{ (1841-5)}:{J{ames} }{K{nox} }Polk
-+{J{ames} }{K{nox} }Polk:1845-{{18}4}9:\
-+{G{eorge} }{M{ifflin} }Dallas:{Z{achary} }Taylor
-+{Z{achary} }Taylor:1849-{18}50:{M{illard} }Fillmore:{M{illard} }Fillmore
-+{M{illard} }Fillmore:1850-{{18}5}3:[N|n]one{ (1850-3)}:{F{ranklin} }Pierce
-+{F{ranklin} }Pierce:1853-{{18}5}7:\
-+{W{illiam|m} }{R{ufus} }{de Vane }King:{J{ames} }Buchanan
-+{J{ames} }Buchanan:1857-{18}61:\
-+{J{ohn} }{C{abell} }Breckinridge:{A{braham|be} }Lincoln
-+{A{braham|be} }Lincoln:1861-{{18}6}5:\
-+{H{annibal} }Hamlin|{A{ndrew} }Johnson:{A{ndrew} }Johnson
-+{A{ndrew} }Johnson:1865-{{18}6}9:[N|n]one{ (1865-9)}:\
-+{U{lysses} }{S{impson} }Grant
-+{U{lysses} }{S{impson} }Grant:1869-{18}77:\
-+{S{chuyler} }Colfax|{H{enry} }Wilson:{R{utherford} }{B{irchard} }Hayes
-+{R{utherford} }{B{irchard} }Hayes:1877-{18}81:\
-+{W{illiam|m} }{A{lmon} }Wheeler:{J{ames} }{A{bram} }Garfield
-+{J{ames} }{A{bram} }Garfield:1881:\
-+{C{hester} }{A{lan} }Arthur:{C{hester} }{A{lan} }Arthur
-+{C{hester} }{A{lan} }Arthur:1881-{{18}8}5:[N|n]one{ (1881-5)}:\
-+{G{rover} }Cleveland{ (1st term)}
-+{G{rover} }Cleveland{ (1st term)}:1885-{{18}8}9:\
-+{T{homas} }{A{ndrews} }Hendricks:{B{enjamin} }Harrison
-+{B{enjamin} }Harrison:1889-{18}93:\
-+{L{evi} }{P{arsons} }Morton:{G{rover} }Cleveland{ (2nd term)}
-+{G{rover} }Cleveland{ (2nd term)}:1893-{18}97:\
-+{A{dlai} }{E{wing} }Stevenson:{W{illiam|m} }McKinley
-+{W{illiam|m} }McKinley:1897-1901:\
-+{G{arret} }{A{ugustus} }Hobart|{T{heodore|eddy} }Roosevelt|TR:\
-+{T{heodore|eddy} }Roosevelt|TR
-+{T{heodore|eddy} }Roosevelt|TR:1901-{{19}0}9:\
-+{C{harles} }{W{arren} }Fairbanks:{W{illiam|m} }{H{oward} }Taft
-+{W{illiam|m} }{H{oward} }Taft:1909-{19}13:\
-+{J{ames} }{S{choolcraft} }Sherman:{W{oodrow} }Wilson
-+{W{oodrow} }Wilson:1913-{19}21:\
-+{T{homas} }{R{iley} }Marshall:{W{arren} }{G{amaliel} }Harding
-+{W{arren} }{G{amaliel} }Harding:1921-{{19}2}3:{C{alvin} }Coolidge:\
-+{C{alvin} }Coolidge
-+{C{alvin} }Coolidge:1923-{{19}2}9:\
-+{C{harles} }{G{ates} }Dawes:{H{erbert} }{C{lark} }Hoover
-+{H{erbert} }{C{lark} }Hoover:1929-{19}33:\
-+{C{harles} }Curtis:{F{ranklin} }{D{elano} }Roosevelt|FDR
-+{F{ranklin} }{D{elano} }Roosevelt|FDR:1933-{19}45:\
-+{J{ohn} }{N{ance} }Garner|{H{enry} }{A{gard} }Wallace|{H{arry} }{S }Truman:\
-+{H{arry} }{S }Truman
-+{H{arry} }{S }Truman:1945-{19}53:\
-+{A{lben} }{W{illiam} }Barkley:{D{wight} }{D{avid} }Eisenhower
-+{D{wight} }{D{avid} }Eisenhower:1953-{19}61:\
-+{R{ichard} }{M{ilhous} }Nixon:{J{ohn} }{F{itzgerald} }Kennedy|JFK
-+{J{ohn} }{F{itzgerald} }Kennedy|JFK:1961-{{19}6}3:\
-+{L{yndon} }{B{aines} }Johnson|LBJ:{L{yndon} }{B{aines} }Johnson|LBJ
-+{L{yndon} }{B{aines} }Johnson|LBJ:1963-{{19}6}9:\
-+{H{ubert} }{H{oratio} }Humphrey:{R{ichard} }{M{ilhous} }Nixon
-+{R{ichard} }{M{ilhous} }Nixon:1969-{19}74:\
-+{S{piro} }{T{heodore} }Agnew|{G{erald} }{R{udolph} }Ford:\
-+{G{erald} }{R{udolph} }Ford
-+{G{erald} }{R{udolph} }Ford:1974-{{19}7}7:\
-+{N{elson} }{A{ldrich} }Rockefeller:{J{ames} }{E{arl} }Carter{{,} J{unio}r}
-+{J{ames} }{E{arl} }Carter{{,} J{unio}r}:1977-{19}81:\
-+{W{alter} }{F{rederick} }Mondale:{R{onald} }{W{ilson} }Reagan
-+{R{onald} }{W{ilson} }Reagan:1981-{{19}8}9:\
-+{G{eorge} }{H{erbert} }{W{alker} }Bush:{G{eorge} }{H{erbert} }{W{alker} }Bush
-+{G{eorge} }{H{erbert} }{W{alker} }Bush:1989-{19}93:\
-+{J{ames} }{D{anforth|an} }Quayle:{W{illiam|m} }{J{efferson} }Clinton
-+{W{illiam|m} }{J{efferson} }Clinton:1993-2001:\
-+{A{lbert} }{A{rnold} }Gore{{,} J{unio}r}:{G{eorge} }{W{alker} }Bush{{,} J{unio}r}
-+{G{eorge} }{W{alker} }Bush{{,} J{unio}r}:2001-:\
-+{R{ichard} }{B{ruce} }Cheney:
-
-
-
-
---- quiz/datfiles/pres Sat Sep 21 01:38:18 2002
-+++ quiz/datfiles/pres.new Sat Sep 21 20:55:47 2002
-@@ -70,14 +70,17 @@
- {S{piro} }{T{heodore} }Agnew|{G{erald} }{R{udolph} }Ford:\
- {G{erald} }{R{udolph} }Ford
- {G{erald} }{R{udolph} }Ford:1974-{{19}7}7:\
--{N{elson} }{A{ldrich} }Rockefeller:{J{ames} }{E{arl} }Carter{{,} J{unio}r}
--{J{ames} }{E{arl} }Carter{{,} J{unio}r}:1977-{19}81:\
-+{N{elson} }{A{ldrich} }Rockefeller:\
-+{J{ames} }{E{arl} }{(Jimmy) }Carter{{,} J{unio}r}|Jimmy Carter
-+{J{ames} }{E{arl} }{(Jimmy) }Carter{{,} J{unio}r}|Jimmy Carter:1977-{19}81:\
- {W{alter} }{F{rederick} }Mondale:{R{onald} }{W{ilson} }Reagan
- {R{onald} }{W{ilson} }Reagan:1981-{{19}8}9:\
- {G{eorge} }{H{erbert} }{W{alker} }Bush:{G{eorge} }{H{erbert} }{W{alker} }Bush
- {G{eorge} }{H{erbert} }{W{alker} }Bush:1989-{19}93:\
--{J{ames} }{D{anforth|an} }Quayle:{W{illiam|m} }{J{efferson} }Clinton
--{W{illiam|m} }{J{efferson} }Clinton:1993-2001:\
--{A{lbert} }{A{rnold} }Gore{{,} J{unio}r}:{G{eorge} }{W{alker} }Bush{{,} J{unio}r}
-+{J{ames} }{D{anforth|an} }Quayle:\
-+{W{illiam|m} }{J{efferson} }{(Bill) }Clinton|Bill Clinton
-+{W{illiam|m} }{J{efferson} }{(Bill) }Clinton|Bill Clinton:1993-2001:\
-+{A{l{bert}} }{A{rnold} }Gore{{,} J{unio}r}:\
-+{G{eorge} }{W{alker} }Bush{{,} J{unio}r}
- {G{eorge} }{W{alker} }Bush{{,} J{unio}r}:2001-:\
--{R{ichard} }{B{ruce} }Cheney:
-+{R{ichard} }{B{ruce} }{(Dick) }Cheney|Dick Cheney:
diff --git a/games/bsdgames/files/patch-rogue_Makefile b/games/bsdgames/files/patch-rogue_Makefile
deleted file mode 100644
index 3a819d26158f..000000000000
--- a/games/bsdgames/files/patch-rogue_Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
---- rogue/Makefile.orig Sun May 27 21:36:53 2007
-+++ rogue/Makefile Sun May 27 21:40:48 2007
-@@ -2,7 +2,7 @@
- # $FreeBSD$
-
- PROG= rogue
--CFLAGS+=-DUNIX -fwritable-strings
-+CFLAGS+=-DUNIX
- SRCS= hit.c init.c inventory.c level.c machdep.c main.c \
- message.c monster.c move.c object.c pack.c play.c random.c ring.c \
- room.c save.c score.c spec_hit.c throw.c trap.c use.c zap.c
diff --git a/games/bsdgames/files/patch-snake_snake_move.c b/games/bsdgames/files/patch-snake_snake_move.c
deleted file mode 100644
index 03f96cdc9885..000000000000
--- a/games/bsdgames/files/patch-snake_snake_move.c
+++ /dev/null
@@ -1,24 +0,0 @@
-Index: snake/snake/move.c
-@@ -677,10 +674,10 @@
-
- gtty(0, &orig);
- new=orig;
-- new.sg_flags &= ~(ECHO|CRMOD|ALLDELAY|XTABS);
-- new.sg_flags |= CBREAK;
-+ new.c_lflag &= ~(ECHO|ICRNL|OXTABS);
-+ new.c_lflag &= ~ICANON;
- signal(SIGINT,stop);
-- ospeed = orig.sg_ospeed;
-+ ospeed = cfgetospeed(&orig);
- #ifdef TIOCGLTC
- ioctl(0, TIOCGLTC, &olttyc);
- nlttyc = olttyc;
-@@ -689,7 +686,7 @@
- #endif
- raw();
-
-- if ((orig.sg_flags & XTABS) == XTABS) TA=0;
-+ if ((orig.c_lflag & OXTABS) == OXTABS) TA=0;
- putpad(KS);
- putpad(TI);
- point(&cursor,0,LINES-1);
diff --git a/games/bsdgames/files/patch-snake_snake_snake.c b/games/bsdgames/files/patch-snake_snake_snake.c
deleted file mode 100644
index 11c001d38bf6..000000000000
--- a/games/bsdgames/files/patch-snake_snake_snake.c
+++ /dev/null
@@ -1,10 +0,0 @@
-Index: snake/snake/snake.c
-@@ -183,7 +181,7 @@
- snrand(&money);
- snrand(&snake[0]);
-
-- if ((orig.sg_ospeed < B9600) ||
-+ if ((cfgetospeed(&orig) < B9600) ||
- ((! CM) && (! TA))) fast=0;
- for(i=1;i<6;i++)
- chase (&snake[i], &snake[i-1]);
diff --git a/games/bsdgames/files/patch-snake_snake_snake.h b/games/bsdgames/files/patch-snake_snake_snake.h
deleted file mode 100644
index a89166ac21f3..000000000000
--- a/games/bsdgames/files/patch-snake_snake_snake.h
+++ /dev/null
@@ -1,25 +0,0 @@
-Index: snake/snake/snake.h
-@@ -38,10 +38,13 @@
- # include <stdio.h>
- # include <assert.h>
- # include <sys/types.h>
--# include <sgtty.h>
-+# include <termios.h>
- # include <signal.h>
- # include <math.h>
-
-+#define gtty(_a,_b) tcgetattr(_a,_b)
-+#define stty(_a,_b) tcsetattr(_a,TCSANOW,_b)
-+
- #define ESC '\033'
-
- struct tbuffer {
-@@ -72,7 +75,7 @@
- int col, line;
- };
- struct point cursor;
--struct sgttyb orig, new;
-+struct termios orig, new;
- #ifdef TIOCLGET
- struct ltchars olttyc, nlttyc;
- #endif
diff --git a/games/bsdgames/files/patch-trek_main.c b/games/bsdgames/files/patch-trek_main.c
deleted file mode 100644
index c6880a8a5893..000000000000
--- a/games/bsdgames/files/patch-trek_main.c
+++ /dev/null
@@ -1,33 +0,0 @@
-Index: trek/main.c
-@@ -47,10 +47,12 @@
-
- # include "trek.h"
- # include <stdio.h>
--# include <sgtty.h>
-+# include <termios.h>
- # include <setjmp.h>
- # include <stdlib.h>
-
-+# define gtty(_a,_b) tcgetattr(_a,_b)
-+
- # define PRIO 00 /* default priority */
-
- int Mother = 51 + (51 << 8);
-@@ -163,7 +165,7 @@
- int prio;
- int ac;
- char **av;
-- struct sgttyb argp;
-+ struct termios argp;
-
- /* revoke */
- setgid(getgid());
-@@ -176,7 +178,7 @@
- prio = PRIO;
- if (gtty(1, &argp) == 0)
- {
-- if ((argp.sg_ispeed ) < B1200)
-+ if ((cfgetispeed(&argp)) < B1200)
- Etc.fast++;
- }
- while (ac > 1 && av[0][0] == '-')
diff --git a/games/bsdgames/files/patch-warns b/games/bsdgames/files/patch-warns
new file mode 100644
index 000000000000..2f2c11b131ab
--- /dev/null
+++ b/games/bsdgames/files/patch-warns
@@ -0,0 +1,40 @@
+--- ./atc/Makefile
++++ ./atc/Makefile
+@@ -4,6 +4,7 @@
+
+ PROG= atc
+ CFLAGS+=-I${.CURDIR} -I.
++WARNS?= 2
+ SRCS= extern.c grammar.y graphics.c input.c lex.l list.c log.c \
+ main.c tunable.c update.c y.tab.h
+ MAN= atc.6
+--- ./atc/include.h
++++ ./atc/include.h
+@@ -56,6 +56,7 @@
+ #include <pwd.h>
+ #include <signal.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <termios.h>
+ #include <unistd.h>
+--- ./hack/Makefile
++++ ./hack/Makefile
+@@ -19,6 +19,7 @@ MAN= hack.6
+ DPADD= ${LIBTERMCAP}
+ LDADD= -ltermcap
+ CFLAGS+= -I${.CURDIR} -I.
++WARNS?= 3 # shadowed 'u' variable, blame sys/stat.h :/
+ FILES= rumors help hh data
+ FILESMODE_rumors= 440
+ FILESGRP= ${BINGRP}
+--- ./rogue/Makefile
++++ ./rogue/Makefile
+@@ -4,6 +4,7 @@
+
+ PROG= rogue
+ CFLAGS+=-DUNIX
++WARNS?= 1
+ SRCS= hit.c init.c inventory.c level.c machdep.c main.c \
+ message.c monster.c move.c object.c pack.c play.c random.c ring.c \
+ room.c save.c score.c spec_hit.c throw.c trap.c use.c zap.c
diff --git a/games/bsdgames/files/share.mtree b/games/bsdgames/files/share.mtree
new file mode 100644
index 000000000000..edace46aff41
--- /dev/null
+++ b/games/bsdgames/files/share.mtree
@@ -0,0 +1,11 @@
+# Games dirs
+.
+/set type=dir uname=root gname=wheel mode=0755
+ games
+ atc
+ ..
+ larn
+ ..
+ quiz.db
+ ..
+ ..
diff --git a/games/bsdgames/files/var.mtree b/games/bsdgames/files/var.mtree
new file mode 100644
index 000000000000..7c87be94fba2
--- /dev/null
+++ b/games/bsdgames/files/var.mtree
@@ -0,0 +1,17 @@
+# Games dirs
+.
+/set type=dir uname=root gname=games mode=0775
+ games
+ atc
+ ..
+ battlestar
+ ..
+ hackdir mode=0770
+ save mode=0770
+ ..
+ ..
+ larn
+ ..
+ phantasia
+ ..
+ ..
diff --git a/games/bsdgames/pkg-descr b/games/bsdgames/pkg-descr
index 4f0e98eb0b0c..4f55314ab702 100644
--- a/games/bsdgames/pkg-descr
+++ b/games/bsdgames/pkg-descr
@@ -1,6 +1,5 @@
-This is a port of the FreeBSD "standard" games as they were just
-before they were removed from the base system.
+This is a port of the BSD "standard" games from Dragonfly BSD which
+includes many improvements and cleanups from NetBSD and OpenBSD.
-This source was formerly a part of the FreeBSD base system, and this
-package is based on the final version of that source code, so it
-includes all previous FreeBSD customizations.
+This source was formerly a part of the FreeBSD base system, but has
+survived in the Dragonfly BSD repository.
diff --git a/games/bsdgames/pkg-plist b/games/bsdgames/pkg-plist
index 4c0ebf9239e3..cd71d3ecdba2 100644
--- a/games/bsdgames/pkg-plist
+++ b/games/bsdgames/pkg-plist
@@ -12,19 +12,24 @@ bin/cribbage
bin/fish
bin/hack
bin/hangman
+bin/hunt
+bin/huntd
bin/larn
bin/mille
bin/phantasia
bin/piano
bin/pig
bin/quiz
+bin/rain
bin/robots
bin/rogue
bin/sail
bin/snake
bin/snscore
bin/trek
+bin/wargames
bin/worm
+bin/worms
bin/wump
share/games/atc/Game_List
share/games/atc/Killer
@@ -76,28 +81,39 @@ share/games/fish.instr
share/games/wump.info
@dirrm share/games
@cwd /var/games
-@dirrm atc
-@dirrm battlestar
+@exec chgrp games /var/games
+@dirrmtry atc
+@exec mkdir %D/atc
+@exec chmod 0775 %D/atc
+@dirrmtry battlestar
+@exec mkdir %D/battlestar
+@exec chmod 0775 %D/battlestar
hackdir/perm
-hackdir/record
hackdir/rumors
hackdir/help
hackdir/hh
hackdir/data
-@dirrm hackdir/save
-@dirrm hackdir
+phantasia/monsters
+phantasia/void
+@comment FIXME below are highscores, we should keep them if non-empty
+@comment Also, we must make sure to not clobber them upon install XXX
+hackdir/record
+@dirrmtry hackdir/save
+@dirrmtry hackdir
+@exec mkdir -p %D/hackdir/save
+@exec chmod 0770 %D/hackdir %D/hackdir/save
larn/lscore12.0
larn/llog12.0
-@dirrm larn
+@dirrmtry larn
+@exec chmod 0775 %D/larn
phantasia/characs
phantasia/gold
phantasia/lastdead
phantasia/mess
-phantasia/monsters
phantasia/motd
phantasia/scoreboard
-phantasia/void
-@dirrm phantasia
+@dirrmtry phantasia
+@exec chmod 0775 %D/phantasia
battlestar.log
cfscores
criblog