summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjlam <jlam>2001-10-25 04:42:52 +0000
committerjlam <jlam>2001-10-25 04:42:52 +0000
commit64dd212f16ed6d861557f768e11c3ee56896206b (patch)
tree075d68978cb45cd26cca93ab74f22bff1b47169a
parent4c4464df4115ec4b9909770efc25340f6073b801 (diff)
downloadpkgsrc-64dd212f16ed6d861557f768e11c3ee56896206b.tar.gz
games/sjeng - engine for chess variations (bughouse, suicide, etc.)
Sjeng is an attempt to create a bughouse- and crazyhouse-playing program that can attain a level comparable to what the best human players are capable of. Sjeng also can play standard, suicide, giveaway and losers chess.
-rw-r--r--games/sjeng/Makefile45
-rw-r--r--games/sjeng/distinfo8
-rw-r--r--games/sjeng/patches/patch-aa13
-rw-r--r--games/sjeng/patches/patch-ab36
-rw-r--r--games/sjeng/patches/patch-ac63
-rw-r--r--games/sjeng/patches/patch-ad36
-rw-r--r--games/sjeng/pkg/DESCR4
-rw-r--r--games/sjeng/pkg/PLIST8
8 files changed, 213 insertions, 0 deletions
diff --git a/games/sjeng/Makefile b/games/sjeng/Makefile
new file mode 100644
index 00000000000..23af5592f90
--- /dev/null
+++ b/games/sjeng/Makefile
@@ -0,0 +1,45 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
+
+DISTNAME= Sjeng-Free-11.0
+PKGNAME= sjeng-11.0
+CATEGORIES= games
+MASTER_SITES= http://sjeng.sourceforge.net/ftp/ \
+ ${MASTER_SITE_SOURCEFORGE:=sjeng/}
+
+MAINTAINER= jlam@netbsd.org
+HOMEPAGE= http://sjeng.sourceforge.net/
+COMMENT= engine for chess variations (bughouse, suicide, etc.)
+
+USE_BUILDLINK_ONLY= YES
+
+GNU_CONFIGURE= YES
+LIBS+= -lm # floor()
+
+MAKE_ENV+= BOOKDIR="${BOOKDIR}/"
+
+BOOKDIR= ${PREFIX}/lib/sjeng
+TBDIR= ${PREFIX}/share/egtb
+
+DOCDIR= ${PREFIX}/share/doc/sjeng
+EGDIR= ${PREFIX}/share/examples/sjeng
+
+post-build:
+ cd ${WRKSRC}; \
+ file="sjeng.rc"; \
+ for file in $${files}; do \
+ ${SED} -e "s|/wwwindows/crafty/TB|${TBDIR}|g" \
+ $${file} > $${file}.fixed; \
+ ${MV} -f $${file}.fixed $${file}; \
+ done
+
+post-install:
+ ${INSTALL_DATA_DIR} ${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${DOCDIR}
+ ${INSTALL_DATA_DIR} ${EGDIR}
+ ${CAT} ${WRKSRC}/sjeng.rc | ${TR} -d "\015" > ${WRKDIR}/sample.sjengrc
+ ${INSTALL_DATA} ${WRKDIR}/sample.sjengrc ${EGDIR}
+ ${INSTALL_DATA_DIR} ${BOOKDIR}
+ ${INSTALL_DATA} ${WRKSRC}/books/*.opn ${BOOKDIR}
+
+.include "../../databases/gdbm/buildlink.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/games/sjeng/distinfo b/games/sjeng/distinfo
new file mode 100644
index 00000000000..9ad3e4c76a1
--- /dev/null
+++ b/games/sjeng/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
+
+SHA1 (Sjeng-Free-11.0.tar.gz) = cfcbefc5a5872d6340b83fbe64d2c46cf85a8b0f
+Size (Sjeng-Free-11.0.tar.gz) = 173443 bytes
+SHA1 (patch-aa) = c0d98382bccc158a887328577757b5d98574c0ad
+SHA1 (patch-ab) = 7f87c3a8b2bc249352c07e1db73c6dc0799e3553
+SHA1 (patch-ac) = 94c8e903e821f9a77c8faa51033d5b01558d90f6
+SHA1 (patch-ad) = 94b3d1f4636262cd6669d03f3f14ca8ed40d0204
diff --git a/games/sjeng/patches/patch-aa b/games/sjeng/patches/patch-aa
new file mode 100644
index 00000000000..8e7d7a6407a
--- /dev/null
+++ b/games/sjeng/patches/patch-aa
@@ -0,0 +1,13 @@
+$NetBSD: patch-aa,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
+
+--- Makefile.in.orig Wed Sep 12 05:57:11 2001
++++ Makefile.in
+@@ -75,7 +75,7 @@
+ PROGRAMS = $(bin_PROGRAMS)
+
+
+-DEFS = @DEFS@ -I. -I$(srcdir) -I.
++DEFS = @DEFS@ -I. -I$(srcdir) -I. -DBOOKDIR=\"${BOOKDIR}\"
+ CPPFLAGS = @CPPFLAGS@
+ LDFLAGS = @LDFLAGS@
+ LIBS = @LIBS@
diff --git a/games/sjeng/patches/patch-ab b/games/sjeng/patches/patch-ab
new file mode 100644
index 00000000000..445e3fd1a65
--- /dev/null
+++ b/games/sjeng/patches/patch-ab
@@ -0,0 +1,36 @@
+$NetBSD: patch-ab,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
+
+--- book.c.orig Mon Jul 16 08:04:48 2001
++++ book.c
+@@ -64,26 +64,31 @@
+ if (Variant == Normal)
+ {
+ if ((f_book = fopen ("normal.opn", "r")) == NULL)
++ if ((f_book = fopen (BOOKDIR "normal.opn", "r")) == NULL)
+ return FALSE;
+ }
+ else if (Variant == Crazyhouse)
+ {
+ if ((f_book = fopen ("zh.opn", "r")) == NULL)
++ if ((f_book = fopen (BOOKDIR "zh.opn", "r")) == NULL)
+ return FALSE;
+ }
+ else if (Variant == Suicide)
+ {
+ if ((f_book = fopen ("suicide.opn", "r")) == NULL)
++ if ((f_book = fopen (BOOKDIR "suicide.opn", "r")) == NULL)
+ return FALSE;
+ }
+ else if (Variant == Losers)
+ {
+ if ((f_book = fopen ("losers.opn", "r")) == NULL)
++ if ((f_book = fopen (BOOKDIR "losers.opn", "r")) == NULL)
+ return FALSE;
+ }
+ else
+ {
+ if ((f_book = fopen ("bug.opn", "r")) == NULL)
++ if ((f_book = fopen (BOOKDIR "bug.opn", "r")) == NULL)
+ return FALSE;
+ }
+
diff --git a/games/sjeng/patches/patch-ac b/games/sjeng/patches/patch-ac
new file mode 100644
index 00000000000..bdd365f8cbb
--- /dev/null
+++ b/games/sjeng/patches/patch-ac
@@ -0,0 +1,63 @@
+$NetBSD: patch-ac,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
+
+--- newbook.c.orig Wed Jun 6 18:12:39 2001
++++ newbook.c
+@@ -465,14 +465,19 @@
+
+ srand(time(0));
+
+- if (Variant == Normal)
+- binbook = gdbm_open("nbook.bin", 16384, GDBM_READER, 0, NULL);
+- else if (Variant == Suicide)
+- binbook = gdbm_open("sbook.bin", 16384, GDBM_READER, 0, NULL);
+- else if (Variant == Losers)
+- binbook = gdbm_open("lbook.bin", 16384, GDBM_READER, 0, NULL);
+- else
+- binbook = gdbm_open("zbook.bin", 16384, GDBM_READER, 0, NULL);
++ if (Variant == Normal) {
++ if ((binbook = gdbm_open("nbook.bin", 16384, GDBM_READER, 0, NULL)) == NULL)
++ binbook = gdbm_open(BOOKDIR "nbook.bin", 16384, GDBM_READER, 0, NULL);
++ } else if (Variant == Suicide) {
++ if ((binbook = gdbm_open("sbook.bin", 16384, GDBM_READER, 0, NULL)) == NULL)
++ binbook = gdbm_open(BOOKDIR "sbook.bin", 16384, GDBM_READER, 0, NULL);
++ } else if (Variant == Losers) {
++ if ((binbook = gdbm_open("lbook.bin", 16384, GDBM_READER, 0, NULL)) == NULL)
++ binbook = gdbm_open(BOOKDIR "lbook.bin", 16384, GDBM_READER, 0, NULL);
++ } else {
++ if ((binbook = gdbm_open("zbook.bin", 16384, GDBM_READER, 0, NULL)) == NULL)
++ binbook = gdbm_open(BOOKDIR "zbook.bin", 16384, GDBM_READER, 0, NULL);
++ }
+
+
+ if (binbook == NULL)
+@@ -606,16 +611,21 @@
+
+ if (bookidx == 0) return;
+
+- if (Variant == Normal)
+- binbook = gdbm_open("nbook.bin", 16384, GDBM_WRITER, 0, NULL);
+- else if (Variant == Suicide)
+- binbook = gdbm_open("sbook.bin", 16384, GDBM_WRITER, 0, NULL);
+- else if (Variant == Losers)
+- binbook = gdbm_open("lbook.bin", 16384, GDBM_WRITER, 0, NULL);
+- else if (Variant == Crazyhouse)
+- binbook = gdbm_open("zbook.bin", 16384, GDBM_WRITER, 0, NULL);
+- else if (Variant == Bughouse)
++ if (Variant == Normal) {
++ if ((binbook = gdbm_open("nbook.bin", 16384, GDBM_WRITER, 0, NULL)) == NULL)
++ binbook = gdbm_open(BOOKDIR "nbook.bin", 16384, GDBM_WRITER, 0, NULL);
++ } else if (Variant == Suicide) {
++ if ((binbook = gdbm_open("sbook.bin", 16384, GDBM_WRITER, 0, NULL)) == NULL)
++ binbook = gdbm_open(BOOKDIR "sbook.bin", 16384, GDBM_WRITER, 0, NULL);
++ } else if (Variant == Losers) {
++ if ((binbook = gdbm_open("lbook.bin", 16384, GDBM_WRITER, 0, NULL)) == NULL)
++ binbook = gdbm_open(BOOKDIR "lbook.bin", 16384, GDBM_WRITER, 0, NULL);
++ } else if (Variant == Crazyhouse) {
++ if ((binbook = gdbm_open("zbook.bin", 16384, GDBM_WRITER, 0, NULL)) == NULL)
++ binbook = gdbm_open(BOOKDIR "zbook.bin", 16384, GDBM_WRITER, 0, NULL);
++ } else if (Variant == Bughouse) {
+ return;
++ }
+
+ if (binbook == NULL)
+ {
diff --git a/games/sjeng/patches/patch-ad b/games/sjeng/patches/patch-ad
new file mode 100644
index 00000000000..6849d22432a
--- /dev/null
+++ b/games/sjeng/patches/patch-ad
@@ -0,0 +1,36 @@
+$NetBSD: patch-ad,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
+
+--- rcfile.c.orig Fri Jun 15 06:47:10 2001
++++ rcfile.c
+@@ -47,12 +47,30 @@
+ int cfg_attackeval;
+ float cfg_scalefac;
+
++static
++FILE *get_rcfile (void)
++{
++ FILE *rc;
++ char buf[STR_BUFF];
++
++ sprintf (buf, "%s/.sjengrc", getenv ("HOME"));
++ if ((rc = fopen ("sjeng.rc", "r")) != NULL) {
++ return rc;
++ } else if ((rc = fopen (".sjengrc", "r")) != NULL) {
++ return rc;
++ } else if ((rc = fopen (buf, "r")) != NULL) {
++ return rc;
++ } else {
++ return NULL;
++ }
++}
++
+ void read_rcfile (void)
+ {
+ int i;
+ unsigned int setc;
+
+- if ((rcfile = fopen ("sjeng.rc", "r")) == NULL)
++ if ((rcfile = get_rcfile ()) == NULL)
+ {
+ printf("No configuration file!\n");
+
diff --git a/games/sjeng/pkg/DESCR b/games/sjeng/pkg/DESCR
new file mode 100644
index 00000000000..0c028c7b515
--- /dev/null
+++ b/games/sjeng/pkg/DESCR
@@ -0,0 +1,4 @@
+Sjeng is an attempt to create a bughouse- and crazyhouse-playing program
+that can attain a level comparable to what the best human players are
+capable of. Sjeng also can play standard, suicide, giveaway and losers
+chess.
diff --git a/games/sjeng/pkg/PLIST b/games/sjeng/pkg/PLIST
new file mode 100644
index 00000000000..dc8054a1a74
--- /dev/null
+++ b/games/sjeng/pkg/PLIST
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2001/10/25 04:42:52 jlam Exp $
+bin/sjeng
+lib/sjeng/bug.opn
+lib/sjeng/losers.opn
+lib/sjeng/suicide.opn
+share/doc/sjeng/README
+@dirrm share/doc/sjeng
+@dirrm lib/sjeng