summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2000-10-15 01:53:39 +0000
committerjlam <jlam>2000-10-15 01:53:39 +0000
commit80c8c0e3e942a3e5b0fdbb6d27297aa0b5461987 (patch)
tree443186d75233dce6339108138ecd86e4f8bfc518
parent41d7a34f754483641cdcf367d215d74e22237389 (diff)
downloadpkgsrc-80c8c0e3e942a3e5b0fdbb6d27297aa0b5461987.tar.gz
Update to gnuchess-5.00nb1: add code to allow building of opening books in
user-specified locations. Remove installation of default book...it's so small that it's pretty much useless anyway. See games/gnuchess-book-* for chess opening books for GNU Chess.
-rw-r--r--games/gnuchess/Makefile17
-rw-r--r--games/gnuchess/files/patch-sum11
-rw-r--r--games/gnuchess/patches/patch-aa6
-rw-r--r--games/gnuchess/patches/patch-ab58
-rw-r--r--games/gnuchess/patches/patch-ac23
-rw-r--r--games/gnuchess/patches/patch-ad13
-rw-r--r--games/gnuchess/patches/patch-ae12
-rw-r--r--games/gnuchess/patches/patch-af57
-rw-r--r--games/gnuchess/pkg/PLIST7
9 files changed, 162 insertions, 42 deletions
diff --git a/games/gnuchess/Makefile b/games/gnuchess/Makefile
index 6cd73fbc56f..73632f6a6df 100644
--- a/games/gnuchess/Makefile
+++ b/games/gnuchess/Makefile
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.9 2000/03/27 10:25:51 jlam Exp $
+# $NetBSD: Makefile,v 1.10 2000/10/15 01:53:39 jlam Exp $
# FreeBSD Id: Makefile,v 1.6 1999/01/27 07:41:12 fenner Exp
#
DISTNAME= chess-5.00
-PKGNAME= gnuchess-5.00
+PKGNAME= gnuchess-5.00nb1
WRKSRC= ${WRKDIR}/${DISTNAME}/src
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_GNU:=chess/}
@@ -15,6 +15,9 @@ GNU_CONFIGURE= yes
USE_GMAKE= yes
ALL_TARGET= gnuchess
+BOOKDIR= ${PREFIX}/lib/gnuchess
+DOCDIR= ${PREFIX}/share/doc/gnuchess
+
post-build:
${SED} -e "s,@PREFIX@,${PREFIX},g" ${FILESDIR}/gnuchessx.sh \
> ${WRKDIR}/gnuchessx.sh
@@ -22,11 +25,9 @@ post-build:
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/gnuchess ${PREFIX}/bin/gnuchess
${INSTALL_SCRIPT} ${WRKDIR}/gnuchessx.sh ${PREFIX}/bin/gnuchessx
- ${INSTALL_DATA_DIR} ${PREFIX}/share/gnuchess
- ${INSTALL_DATA} ${WRKSRC}/book.dat ${WRKSRC}/book.pgn \
- ${PREFIX}/share/gnuchess
- ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/gnuchess
- ${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/doc/README \
- ${PREFIX}/share/doc/gnuchess
+ ${INSTALL_DATA_DIR} ${DOCDIR}
+ ${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/doc/README ${DOCDIR}
+ ${INSTALL_DATA_DIR} ${BOOKDIR}
+ ${TOUCH} ${BOOKDIR}/.directory
.include "../../mk/bsd.pkg.mk"
diff --git a/games/gnuchess/files/patch-sum b/games/gnuchess/files/patch-sum
index 752fc141c6f..39dd4232d72 100644
--- a/games/gnuchess/files/patch-sum
+++ b/games/gnuchess/files/patch-sum
@@ -1,5 +1,8 @@
-$NetBSD: patch-sum,v 1.4 2000/10/01 04:24:27 jlam Exp $
+$NetBSD: patch-sum,v 1.5 2000/10/15 01:53:40 jlam Exp $
-MD5 (patch-aa) = 9aede68ccd4a386b653381a8245a21d5
-MD5 (patch-ab) = 4376f2b68d7733c469ac67e657e1343f
-MD5 (patch-ac) = 6eabe3d99fdec3d3259b18de9c944f18
+MD5 (patch-aa) = 9c57a6e0ace6dad71a3a2d6305e4667a
+MD5 (patch-ab) = 9b40a172e488a073e9de60f3ff3d8c4f
+MD5 (patch-ac) = 1797a54fc75d3eeb44a449de10e92a8a
+MD5 (patch-ad) = bcf4fa21b42d76c2f5408e55d194624a
+MD5 (patch-ae) = 9e914b8af31bca19851e255172b3bb35
+MD5 (patch-af) = dccd2a2cd509a3d40a0cb097ee787e39
diff --git a/games/gnuchess/patches/patch-aa b/games/gnuchess/patches/patch-aa
index 24acf971c1c..247fdf0c428 100644
--- a/games/gnuchess/patches/patch-aa
+++ b/games/gnuchess/patches/patch-aa
@@ -1,13 +1,13 @@
-$NetBSD: patch-aa,v 1.3 2000/03/26 08:29:25 jlam Exp $
+$NetBSD: patch-aa,v 1.4 2000/10/15 01:53:40 jlam Exp $
--- Makefile.in.orig Sat Oct 23 11:43:36 1999
-+++ Makefile.in Thu Feb 17 23:11:58 2000
++++ Makefile.in
@@ -43,7 +43,7 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
-LIBDIR = $(prefix)/lib
-+LIBDIR = $(prefix)/share/gnuchess
++LIBDIR = $(prefix)/lib/gnuchess
BINDIR = $(exec_prefix)/bin
MANDIR = $(prefix)/man/man6
MANEXT = .6
diff --git a/games/gnuchess/patches/patch-ab b/games/gnuchess/patches/patch-ab
index 23fda70571e..59a84185728 100644
--- a/games/gnuchess/patches/patch-ab
+++ b/games/gnuchess/patches/patch-ab
@@ -1,12 +1,48 @@
-$NetBSD: patch-ab,v 1.3 2000/03/26 08:29:25 jlam Exp $
+$NetBSD: patch-ab,v 1.4 2000/10/15 01:53:40 jlam Exp $
---- book.h.orig Fri Oct 15 23:41:03 1999
-+++ book.h Thu Feb 17 23:11:33 2000
-@@ -23,5 +23,5 @@
- bug-gnu-chess@gnu.org
- cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net
- */
--#define BOOKSRC "book.pgn"
--#define BOOKBIN "book.dat"
-+#define BOOKSRC LIBDIR "book.pgn"
-+#define BOOKBIN LIBDIR "book.dat"
+--- book.c.orig Sat Oct 23 06:07:21 1999
++++ book.c
+@@ -85,7 +85,7 @@
+ mcnt = -1;
+ side = board.side;
+ xside = 1^side;
+- rfp = fopen(BOOKBIN,"r+b");
++ rfp = fopen(BOOKBIN,"rb"); /* don't need to open read/write */
+ if (rfp == NULL) {
+ if (!(flags & XBOARD))
+ fprintf(ofp," no book (%s).\n",BOOKBIN);
+@@ -215,8 +215,13 @@
+ return(1);
+ }
+
+-int genbook(void);
+-int genbook()
++/*
++ * Change genbook() to accept source (pgn book) and target (bin book)
++ * paths. This lets us generate a book from a pgn file different from
++ * the ones in BOOKSRC and BOOKBIN.
++ */
++int genbook(char *, char *);
++int genbook(char *src, char *tgt)
+ {
+ int i,j;
+ short found, epsilon;
+@@ -225,13 +230,13 @@
+ leaf *ptr;
+ FILE *wfp,*rfp;
+
+- printf("Trying to generate book %s from %s...\n",BOOKBIN,BOOKSRC);
+- if ((wfp = fopen(BOOKBIN,"w+b"))==NULL) {
+- printf("Couldn't open the bin book (%s) for write.\n",BOOKBIN);
++ printf("Trying to generate book %s from %s...\n",tgt,src);
++ if ((wfp = fopen(tgt,"w+b"))==NULL) {
++ printf("Couldn't open the bin book (%s) for write.\n",tgt);
+ return(0);
+ }
+- if ((rfp = fopen(BOOKSRC,"r"))==NULL) {
+- printf("Couldn't open the pgn book (%s) for read.\n",BOOKSRC);
++ if ((rfp = fopen(src,"r"))==NULL) {
++ printf("Couldn't open the pgn book (%s) for read.\n",src);
+ fclose(wfp);
+ return(0);
+ }
diff --git a/games/gnuchess/patches/patch-ac b/games/gnuchess/patches/patch-ac
index 46d28f30351..0d294dea0e1 100644
--- a/games/gnuchess/patches/patch-ac
+++ b/games/gnuchess/patches/patch-ac
@@ -1,13 +1,12 @@
-$NetBSD: patch-ac,v 1.4 2000/10/01 04:24:27 jlam Exp $
+$NetBSD: patch-ac,v 1.5 2000/10/15 01:53:40 jlam Exp $
---- book.c.orig Sat Oct 23 06:07:21 1999
-+++ book.c
-@@ -85,7 +85,7 @@
- mcnt = -1;
- side = board.side;
- xside = 1^side;
-- rfp = fopen(BOOKBIN,"r+b");
-+ rfp = fopen(BOOKBIN,"rb"); /* don't need to open read/write */
- if (rfp == NULL) {
- if (!(flags & XBOARD))
- fprintf(ofp," no book (%s).\n",BOOKBIN);
+--- book.h.orig Fri Oct 15 23:41:03 1999
++++ book.h
+@@ -23,5 +23,5 @@
+ bug-gnu-chess@gnu.org
+ cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net
+ */
+-#define BOOKSRC "book.pgn"
+-#define BOOKBIN "book.dat"
++#define BOOKSRC LIBDIR "book.pgn"
++#define BOOKBIN LIBDIR "book.dat"
diff --git a/games/gnuchess/patches/patch-ad b/games/gnuchess/patches/patch-ad
new file mode 100644
index 00000000000..1e297dcb5ae
--- /dev/null
+++ b/games/gnuchess/patches/patch-ad
@@ -0,0 +1,13 @@
+$NetBSD: patch-ad,v 1.4 2000/10/15 01:53:40 jlam Exp $
+
+--- cmd.c.orig Sat Oct 23 06:07:32 1999
++++ cmd.c
+@@ -154,7 +154,7 @@
+ printf("inputstr = %s\n",inputstr);
+ if (strncmp (inputstr, "compile", 7) == 0) {
+ printf("calling genbook.\n");
+- genbook ();
++ genbook (booksrc, bookbin);
+ } else if (strcmp (inputstr, "on") == 0) {
+ bookmode = BOOKBEST;
+ printf("book now on.\n");
diff --git a/games/gnuchess/patches/patch-ae b/games/gnuchess/patches/patch-ae
new file mode 100644
index 00000000000..2e037d8780b
--- /dev/null
+++ b/games/gnuchess/patches/patch-ae
@@ -0,0 +1,12 @@
+$NetBSD: patch-ae,v 1.3 2000/10/15 01:53:41 jlam Exp $
+
+--- common.h.orig Fri Oct 15 23:41:21 1999
++++ common.h
+@@ -375,6 +375,7 @@
+ extern int nmovesfrombook;
+ extern float maxtime;
+
++extern char *booksrc, *bookbin;
+
+ enum Piece { empty, pawn, knight, bishop, rook, queen, king, bpawn };
+
diff --git a/games/gnuchess/patches/patch-af b/games/gnuchess/patches/patch-af
new file mode 100644
index 00000000000..d3bf21a43c2
--- /dev/null
+++ b/games/gnuchess/patches/patch-af
@@ -0,0 +1,57 @@
+$NetBSD: patch-af,v 1.1 2000/10/15 01:53:41 jlam Exp $
+
+--- main.c.orig Sat Oct 23 11:50:27 1999
++++ main.c
+@@ -277,6 +277,9 @@
+ 0x7F, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03,
+ 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01 };
+
++char *booksrc = BOOKSRC;
++char *bookbin = BOOKBIN;
++
+ int main (int argc, char *argv[])
+ {
+ int compilebook = 0;
+@@ -302,8 +305,14 @@
+ SET (flags, XBOARD);
+ } else if (strcmp(argv[i],"post") == 0) {
+ SET (flags, POST);
+- } else if (strcmp(argv[i],"compile") == 0)
++ } else if (strcmp(argv[i],"compile") == 0) {
+ compilebook++;
++ if (argc > 2) {
++ booksrc = argv[2];
++ if (argc > 3)
++ bookbin = argv[3];
++ }
++ }
+ }
+ }
+
+@@ -318,8 +327,14 @@
+ SET (flags, XBOARD);
+ } else if (strcmp(argv[i],"post") == 0) {
+ SET (flags, POST);
+- } else if (strcmp(argv[i],"compile") == 0)
++ } else if (strcmp(argv[i],"compile") == 0) {
+ compilebook++;
++ if (argc > 2) {
++ booksrc = argv[2];
++ if (argc > 3)
++ bookbin = argv[3];
++ }
++ }
+ }
+ }
+
+@@ -327,8 +342,8 @@
+ bookfirstlast = 3;
+
+ if (compilebook) {
+- unlink(BOOKBIN);
+- genbook();
++ unlink(bookbin);
++ genbook(booksrc, bookbin);
+ } else {
+ while (!(flags & QUIT))
+ {
diff --git a/games/gnuchess/pkg/PLIST b/games/gnuchess/pkg/PLIST
index 8b7c81c02b8..fe570f69966 100644
--- a/games/gnuchess/pkg/PLIST
+++ b/games/gnuchess/pkg/PLIST
@@ -1,8 +1,7 @@
-@comment $NetBSD: PLIST,v 1.3 2000/03/26 08:29:26 jlam Exp $
+@comment $NetBSD: PLIST,v 1.4 2000/10/15 01:53:41 jlam Exp $
bin/gnuchess
bin/gnuchessx
-share/gnuchess/book.dat
-share/gnuchess/book.pgn
+lib/gnuchess/.directory
share/doc/gnuchess/README
@dirrm share/doc/gnuchess
-@dirrm share/gnuchess
+@dirrm lib/gnuchess