Update of /cvsroot/fink/dists/10.7/stable/main/finkinfo/games
In directory vz-cvs-3.sog:/tmp/cvs-serv5868/games

Added Files:
        sjeng-zhbook.info sjeng.info sjeng.patch 
Log Message:
Fixed & ported to 10.7

--- NEW FILE: sjeng.patch ---
diff -ru Sjeng-Free-11.2-orig/book.c Sjeng-Free-11.2/book.c
--- Sjeng-Free-11.2-orig/book.c 2011-07-23 23:26:30.000000000 +0200
+++ Sjeng-Free-11.2/book.c      2011-07-23 23:40:26.000000000 +0200
@@ -38,6 +38,10 @@
 #define book_solid 4         /* =   */
 #define book_murky 5         /* ?!  */
 
+#undef fopen
+#define fopen book_fopen
+FILE * book_fopen(const char * name, const char * mode);
+
 int init_book (void) {
 
    /* simply read all the book moves into a book array.  The book will be
diff -ru Sjeng-Free-11.2-orig/newbook.c Sjeng-Free-11.2/newbook.c
--- Sjeng-Free-11.2-orig/newbook.c      2011-07-23 23:26:30.000000000 +0200
+++ Sjeng-Free-11.2/newbook.c   2011-07-23 23:40:26.000000000 +0200
@@ -466,13 +466,13 @@
   srand(time(0));
   
   if (Variant == Normal)
-    binbook = gdbm_open("nbook.bin", 16384, GDBM_READER, 0, NULL);
+    binbook = gdbm_open(SJENG_LIB_PATH "/nbook.bin", 16384, GDBM_READER, 0, 
NULL);
   else if (Variant == Suicide)
-    binbook = gdbm_open("sbook.bin", 16384, GDBM_READER, 0, NULL);
+    binbook = gdbm_open(SJENG_LIB_PATH "/sbook.bin", 16384, GDBM_READER, 0, 
NULL);
   else if (Variant == Losers)
-    binbook = gdbm_open("lbook.bin", 16384, GDBM_READER, 0, NULL);
+    binbook = gdbm_open(SJENG_LIB_PATH "/lbook.bin", 16384, GDBM_READER, 0, 
NULL);
   else 
-    binbook = gdbm_open("zbook.bin", 16384, GDBM_READER, 0, NULL);
+    binbook = gdbm_open(SJENG_LIB_PATH "/zbook.bin", 16384, GDBM_READER, 0, 
NULL);
     
   
   if (binbook == NULL)
Only in Sjeng-Free-11.2: newbook.c.orig
diff -ru Sjeng-Free-11.2-orig/rcfile.c Sjeng-Free-11.2/rcfile.c
--- Sjeng-Free-11.2-orig/rcfile.c       2011-07-23 23:26:30.000000000 +0200
+++ Sjeng-Free-11.2/rcfile.c    2011-07-23 23:40:26.000000000 +0200
@@ -47,6 +47,10 @@
 int cfg_attackeval;
 float cfg_scalefac;
 
+#undef fopen
+#define fopen book_fopen
+FILE * book_fopen(const char * name, const char * mode);
+
 void read_rcfile (void) 
 {
   int i;
diff -ru Sjeng-Free-11.2-orig/sjeng.c Sjeng-Free-11.2/sjeng.c
--- Sjeng-Free-11.2-orig/sjeng.c        2011-07-23 23:26:30.000000000 +0200
+++ Sjeng-Free-11.2/sjeng.c     2011-07-23 23:40:26.000000000 +0200
@@ -975,3 +975,26 @@
   return 0;

 

 }

+
+#define MAXBOOKPATH 1000
+
+FILE * book_fopen(const char * name, const char * mode)
+{
+   /* We search a couple of different directories */
+   char                        path[MAXBOOKPATH];
+   FILE *              f;
+   const char *        home;
+
+   if (f = fopen(name, mode)) /* Current directory */
+          return f;
+   if (home = getenv("HOME")) 
+          if (snprintf(path, MAXBOOKPATH, "%s/lib/sjeng/%s", home, name) 
+                  < MAXBOOKPATH
+                  )
+                  if (f = fopen(path, mode)) /* ~/lib/sjeng */
+                          return f;
+   if (snprintf(path, MAXBOOKPATH, "%s/%s", SJENG_LIB_PATH, name) < 
MAXBOOKPATH)
+          if (f = fopen(path, mode)) /* $(SJENG_LIB_PATH)/sjeng */
+                  return f;
+   return NULL;
+}
Only in Sjeng-Free-11.2: sjeng.c.orig
diff -ru Sjeng-Free-11.2-orig/sjeng.h Sjeng-Free-11.2/sjeng.h
--- Sjeng-Free-11.2-orig/sjeng.h        2011-07-23 23:26:30.000000000 +0200
+++ Sjeng-Free-11.2/sjeng.h     2011-07-23 23:40:26.000000000 +0200
@@ -39,6 +39,8 @@
 #define NDEBUG 
 #include <assert.h>
 
+#define SJENG_LIB_PATH         "/usr/local/lib/sjeng"
+
 #define DIE (*(int *)(NULL) = 0)
 
 /* GCP : my code uses WHITE=0 and BLACK=1 so reverse this */

--- NEW FILE: sjeng.info ---
Package: sjeng
Version: 11.2
Revision: 2
Maintainer: Matthias Neeracher <neerac...@mac.com>
BuildDepends: fink (>= 0.24.12), gdbm3
Depends: gdbm3-shlibs
Provides: chess
Source: http://sjeng.sourceforge.net/ftp/Sjeng-Free-%v.tar.gz
Source-MD5: 6561e740b7af703c16701304697d2870
PatchFile: %n.patch
PatchFile-MD5: 522fd5032d61285b51fc8fff9651bbd8
PatchScript: <<
        %{default_script}
 perl -pi.bak -e 's|/usr/local/(\w+)/sjeng|%p/\1/sjeng|' sjeng.h
 perl -pi.bak -e 's|\015||g' AUTHORS BUGS COPYING NEWS README THANKS TODO
<<
InstallScript:<<
 make install prefix=%i
 /usr/bin/install -d -m 555 %i/lib/sjeng
 /usr/bin/install -d -m 777 %i/var/sjeng
 /bin/chmod 777  %i/var/sjeng
 /usr/bin/install sjeng.rc books/*.opn %i/lib/sjeng
<<
DocFiles: AUTHORS BUGS COPYING NEWS README THANKS TODO
Description: Engine for Chess Variants
DescDetail: <<
Sjeng is a program that can play both regular chess and a number of
variants: crazyhouse, bughouse, suicide, and losers.
<<
DescPort: <<
Patched to read opening books from /sw/lib/sjeng $HOME/lib/sjeng
<<
Homepage: http://sjeng.sourceforge.net
License: GPL



--- NEW FILE: sjeng-zhbook.info ---
Package: sjeng-zhbook
Version: 11.0
Revision: 2
Maintainer: Matthias Neeracher <neerac...@mac.com>
Depends: sjeng
Source: http://sjeng.sourceforge.net/ftp/zhbook.pgn
Source-MD5: 87b1c79962d715a950d4f1af3125a4de
NoSourceDirectory: true
CompileScript: <<
 perl -e 'print "variant crazyhouse\nbook\nzhbook.pgn\n32000000\nquit\n"' | 
sjeng
<<
InstallScript: <<
 /bin/mkdir -p %i/lib/sjeng
 /usr/bin/install zbook.bin %i/lib/sjeng
<<
Description: Crazyhouse opening book for Sjeng
License: GPL 
Homepage: http://sjeng.sourceforge.net


------------------------------------------------------------------------------
Storage Efficiency Calculator
This modeling tool is based on patent-pending intellectual property that
has been used successfully in hundreds of IBM storage optimization engage-
ments, worldwide.  Store less, Store more with what you own, Move data to 
the right place. Try It Now! http://www.accelacomm.com/jaw/sfnl/114/51427378/
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to