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.
This commit is contained in:
parent
e522bb8017
commit
3dbb17828a
9 changed files with 162 additions and 42 deletions
|
@ -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
|
# FreeBSD Id: Makefile,v 1.6 1999/01/27 07:41:12 fenner Exp
|
||||||
#
|
#
|
||||||
|
|
||||||
DISTNAME= chess-5.00
|
DISTNAME= chess-5.00
|
||||||
PKGNAME= gnuchess-5.00
|
PKGNAME= gnuchess-5.00nb1
|
||||||
WRKSRC= ${WRKDIR}/${DISTNAME}/src
|
WRKSRC= ${WRKDIR}/${DISTNAME}/src
|
||||||
CATEGORIES= games
|
CATEGORIES= games
|
||||||
MASTER_SITES= ${MASTER_SITE_GNU:=chess/}
|
MASTER_SITES= ${MASTER_SITE_GNU:=chess/}
|
||||||
|
@ -15,6 +15,9 @@ GNU_CONFIGURE= yes
|
||||||
USE_GMAKE= yes
|
USE_GMAKE= yes
|
||||||
ALL_TARGET= gnuchess
|
ALL_TARGET= gnuchess
|
||||||
|
|
||||||
|
BOOKDIR= ${PREFIX}/lib/gnuchess
|
||||||
|
DOCDIR= ${PREFIX}/share/doc/gnuchess
|
||||||
|
|
||||||
post-build:
|
post-build:
|
||||||
${SED} -e "s,@PREFIX@,${PREFIX},g" ${FILESDIR}/gnuchessx.sh \
|
${SED} -e "s,@PREFIX@,${PREFIX},g" ${FILESDIR}/gnuchessx.sh \
|
||||||
> ${WRKDIR}/gnuchessx.sh
|
> ${WRKDIR}/gnuchessx.sh
|
||||||
|
@ -22,11 +25,9 @@ post-build:
|
||||||
do-install:
|
do-install:
|
||||||
${INSTALL_PROGRAM} ${WRKSRC}/gnuchess ${PREFIX}/bin/gnuchess
|
${INSTALL_PROGRAM} ${WRKSRC}/gnuchess ${PREFIX}/bin/gnuchess
|
||||||
${INSTALL_SCRIPT} ${WRKDIR}/gnuchessx.sh ${PREFIX}/bin/gnuchessx
|
${INSTALL_SCRIPT} ${WRKDIR}/gnuchessx.sh ${PREFIX}/bin/gnuchessx
|
||||||
${INSTALL_DATA_DIR} ${PREFIX}/share/gnuchess
|
${INSTALL_DATA_DIR} ${DOCDIR}
|
||||||
${INSTALL_DATA} ${WRKSRC}/book.dat ${WRKSRC}/book.pgn \
|
${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/doc/README ${DOCDIR}
|
||||||
${PREFIX}/share/gnuchess
|
${INSTALL_DATA_DIR} ${BOOKDIR}
|
||||||
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/gnuchess
|
${TOUCH} ${BOOKDIR}/.directory
|
||||||
${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/doc/README \
|
|
||||||
${PREFIX}/share/doc/gnuchess
|
|
||||||
|
|
||||||
.include "../../mk/bsd.pkg.mk"
|
.include "../../mk/bsd.pkg.mk"
|
||||||
|
|
|
@ -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-aa) = 9c57a6e0ace6dad71a3a2d6305e4667a
|
||||||
MD5 (patch-ab) = 4376f2b68d7733c469ac67e657e1343f
|
MD5 (patch-ab) = 9b40a172e488a073e9de60f3ff3d8c4f
|
||||||
MD5 (patch-ac) = 6eabe3d99fdec3d3259b18de9c944f18
|
MD5 (patch-ac) = 1797a54fc75d3eeb44a449de10e92a8a
|
||||||
|
MD5 (patch-ad) = bcf4fa21b42d76c2f5408e55d194624a
|
||||||
|
MD5 (patch-ae) = 9e914b8af31bca19851e255172b3bb35
|
||||||
|
MD5 (patch-af) = dccd2a2cd509a3d40a0cb097ee787e39
|
||||||
|
|
|
@ -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.orig Sat Oct 23 11:43:36 1999
|
||||||
+++ Makefile.in Thu Feb 17 23:11:58 2000
|
+++ Makefile.in
|
||||||
@@ -43,7 +43,7 @@
|
@@ -43,7 +43,7 @@
|
||||||
|
|
||||||
prefix = @prefix@
|
prefix = @prefix@
|
||||||
exec_prefix = @exec_prefix@
|
exec_prefix = @exec_prefix@
|
||||||
-LIBDIR = $(prefix)/lib
|
-LIBDIR = $(prefix)/lib
|
||||||
+LIBDIR = $(prefix)/share/gnuchess
|
+LIBDIR = $(prefix)/lib/gnuchess
|
||||||
BINDIR = $(exec_prefix)/bin
|
BINDIR = $(exec_prefix)/bin
|
||||||
MANDIR = $(prefix)/man/man6
|
MANDIR = $(prefix)/man/man6
|
||||||
MANEXT = .6
|
MANEXT = .6
|
||||||
|
|
|
@ -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.c.orig Sat Oct 23 06:07:21 1999
|
||||||
+++ book.h Thu Feb 17 23:11:33 2000
|
+++ book.c
|
||||||
@@ -23,5 +23,5 @@
|
@@ -85,7 +85,7 @@
|
||||||
bug-gnu-chess@gnu.org
|
mcnt = -1;
|
||||||
cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net
|
side = board.side;
|
||||||
*/
|
xside = 1^side;
|
||||||
-#define BOOKSRC "book.pgn"
|
- rfp = fopen(BOOKBIN,"r+b");
|
||||||
-#define BOOKBIN "book.dat"
|
+ rfp = fopen(BOOKBIN,"rb"); /* don't need to open read/write */
|
||||||
+#define BOOKSRC LIBDIR "book.pgn"
|
if (rfp == NULL) {
|
||||||
+#define BOOKBIN LIBDIR "book.dat"
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -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.h.orig Fri Oct 15 23:41:03 1999
|
||||||
+++ book.c
|
+++ book.h
|
||||||
@@ -85,7 +85,7 @@
|
@@ -23,5 +23,5 @@
|
||||||
mcnt = -1;
|
bug-gnu-chess@gnu.org
|
||||||
side = board.side;
|
cracraft@ai.mit.edu, cracraft@stanfordalumni.org, cracraft@earthlink.net
|
||||||
xside = 1^side;
|
*/
|
||||||
- rfp = fopen(BOOKBIN,"r+b");
|
-#define BOOKSRC "book.pgn"
|
||||||
+ rfp = fopen(BOOKBIN,"rb"); /* don't need to open read/write */
|
-#define BOOKBIN "book.dat"
|
||||||
if (rfp == NULL) {
|
+#define BOOKSRC LIBDIR "book.pgn"
|
||||||
if (!(flags & XBOARD))
|
+#define BOOKBIN LIBDIR "book.dat"
|
||||||
fprintf(ofp," no book (%s).\n",BOOKBIN);
|
|
||||||
|
|
13
games/gnuchess/patches/patch-ad
Normal file
13
games/gnuchess/patches/patch-ad
Normal file
|
@ -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");
|
12
games/gnuchess/patches/patch-ae
Normal file
12
games/gnuchess/patches/patch-ae
Normal file
|
@ -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 };
|
||||||
|
|
57
games/gnuchess/patches/patch-af
Normal file
57
games/gnuchess/patches/patch-af
Normal file
|
@ -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))
|
||||||
|
{
|
|
@ -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/gnuchess
|
||||||
bin/gnuchessx
|
bin/gnuchessx
|
||||||
share/gnuchess/book.dat
|
lib/gnuchess/.directory
|
||||||
share/gnuchess/book.pgn
|
|
||||||
share/doc/gnuchess/README
|
share/doc/gnuchess/README
|
||||||
@dirrm share/doc/gnuchess
|
@dirrm share/doc/gnuchess
|
||||||
@dirrm share/gnuchess
|
@dirrm lib/gnuchess
|
||||||
|
|
Loading…
Reference in a new issue