ports/74441: Update port: games/gnuchess (new version 5.07 with optional opening book support added)

Conrad J. Sabatier conrads at cox.net
Sat Dec 4 05:27:49 UTC 2004


On Thu, 2 Dec 2004 11:46:22 GMT, Volker Stolz <vs at FreeBSD.org> wrote:

> Synopsis: Update port: games/gnuchess (new version 5.07 with optional
> opening book support added)
> 
> State-Changed-From-To: open->feedback
> State-Changed-By: vs
> State-Changed-When: Thu Dec 2 11:45:27 GMT 2004
> State-Changed-Why: 
> Please see the Porter's Handbook on how to submit updates in
> unified diff format. Also, please not that README.html is not part
> of the port but generated for the CD-sets.
> 
> http://www.freebsd.org/cgi/query-pr.cgi?pr=74441
> 

Ah, OK.  Sorry about that.  Here's the diff:

diff -ruN ports/games/gnuchess.orig/CVS/Entries
ports/games/gnuchess/CVS/Entries
--- ports/games/gnuchess.orig/CVS/Entries	Fri Dec  3 23:04:35 2004
+++ ports/games/gnuchess/CVS/Entries	Wed Dec 31 18:00:00 1969
@@ -1,5 +0,0 @@
-/Makefile/1.17/Wed Oct  8 11:31:49 2003//
-/distinfo/1.9/Thu Jan 29 07:23:54 2004//
-/pkg-descr/1.2/Mon Oct  7 10:28:08 2002//
-/pkg-plist/1.5/Wed Oct  8 11:31:49 2003//
-D
diff -ruN ports/games/gnuchess.orig/CVS/Repository
ports/games/gnuchess/CVS/Repository
--- ports/games/gnuchess.orig/CVS/Repository	Fri Dec  3 23:04:35 2004
+++ ports/games/gnuchess/CVS/Repository	Wed Dec 31 18:00:00 1969
@@ -1 +0,0 @@
-ports/games/gnuchess
diff -ruN ports/games/gnuchess.orig/CVS/Root
ports/games/gnuchess/CVS/Root
--- ports/games/gnuchess.orig/CVS/Root	Fri Dec  3 23:04:35 2004
+++ ports/games/gnuchess/CVS/Root	Wed Dec 31 18:00:00 1969
@@ -1 +0,0 @@
-/home/ncvs
diff -ruN ports/games/gnuchess.orig/Makefile
ports/games/gnuchess/Makefile
--- ports/games/gnuchess.orig/Makefile	Wed Oct  8 06:31:49 2003
+++ ports/games/gnuchess/Makefile	Fri Dec  3 23:06:34 2004
@@ -1,30 +1,65 @@
-# New ports collection makefile for:	Gnu Chess
-# Date created:		04 July 1996
-# Whom:			markm
+# New ports collection makefile for:   Gnu Chess
+# Date created:                04 July 1996
+# Whom:                        markm
 #
 # $FreeBSD: ports/games/gnuchess/Makefile,v 1.17 2003/10/08 11:31:49
edwin Exp $
 #
 
-PORTNAME=	gnuchess
-PORTVERSION=	5.06
-PORTREVISION=	1
-CATEGORIES=	games
-MASTER_SITES=	${MASTER_SITE_GNU}
-MASTER_SITE_SUBDIR=	chess
-
-MAINTAINER=	ports at FreeBSD.org
-COMMENT=	"Classic" Gnu Chess
-
-USE_REINPLACE=	yes
-GNU_CONFIGURE=	yes
-CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
-CONFIGURE_ENV=	LIBS="${PTHREAD_LIBS}"
+PORTNAME=      gnuchess
+PORTVERSION=   5.07
+CATEGORIES=    games
+MASTER_SITES=  ${MASTER_SITE_GNU}
+MASTER_SITE_SUBDIR=    chess
+
+MAINTAINER=    ports at FreeBSD.org
+COMMENT=       "Classic" Gnu Chess
+
+PLIST_FILES=   bin/gnuchess \
+               bin/gnuchessx
+
+.if !defined(NOPORTDOCS)
+PORTDOCS=      ChangeLog \
+               NEWS \
+               README
+.endif
+
+OPTIONS=    OPENING_BOOK "Install opening book (24 MB download)" on
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_OPENING_BOOK)
+DISTFILES+=    book_1.01.pgn.gz
+PLIST_DIRS+=   %%DATADIR%%
+PLIST_FILES+=  %%DATADIR%%/book.dat
+EXTRACT_ONLY=  ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}
+.endif
+
+USE_REINPLACE= yes
+GNU_CONFIGURE= yes
+CONFIGURE_TARGET=      --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
+CONFIGURE_ENV= LIBS="${PTHREAD_LIBS}"
 
 post-patch:
-	@${REINPLACE_CMD} -e 's|-D_THREAD_SAFE|${PTHREAD_CFLAGS:S/"//g}|g ; \
-		 s|-pthread ||g' ${WRKSRC}/configure
+       @${REINPLACE_CMD} -e
's|-D_THREAD_SAFE|${PTHREAD_CFLAGS:S/"//g}|g ; \
+                s|-pthread ||g' ${WRKSRC}/configure
+
+pre-install:
+.if defined(WITH_OPENING_BOOK)
+       @scripts/create_opening_book.sh ${DISTDIR} ${WRKSRC}
+.endif
 
 post-install:
-	${LN} -f ${PREFIX}/bin/gnuchess ${PREFIX}/bin/gnuchessx
+       ${LN} -f ${PREFIX}/bin/gnuchess ${PREFIX}/bin/gnuchessx
+.if defined(WITH_OPENING_BOOK)
+       @${ECHO_CMD} Installing opening book
+       ${MKDIR} ${DATADIR} && \
+       ${CP} ${WRKSRC}/src/book.dat ${DATADIR}
+.endif
+.if !defined(NOPORTDOCS)
+       @${ECHO_CMD} Installing documentation
+       ${MKDIR} ${DOCSDIR} && \
+       ${CP} ${WRKSRC}/NEWS ${DOCSDIR} && \
+       ${CP} ${WRKSRC}/doc/* ${DOCSDIR}
+.endif
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff -ruN ports/games/gnuchess.orig/distinfo
ports/games/gnuchess/distinfo
--- ports/games/gnuchess.orig/distinfo	Thu Jan 29 01:23:54 2004
+++ ports/games/gnuchess/distinfo	Fri Dec  3 23:06:34 2004
@@ -1,2 +1,4 @@
-MD5 (gnuchess-5.06.tar.gz) = 9b25c80bef39e6ab24088dcfdea7d845
-SIZE (gnuchess-5.06.tar.gz) = 212829
+MD5 (gnuchess-5.07.tar.gz) = 259da00aa559e5624c65279484fccaf7
+SIZE (gnuchess-5.07.tar.gz) = 234542
+MD5 (book_1.01.pgn.gz) = 1be508d7a38a8c9a7d599d0cd92b24a6
+SIZE (book_1.01.pgn.gz) = 26070544
diff -ruN ports/games/gnuchess.orig/files/patch-book.h
ports/games/gnuchess/files/patch-book.h
--- ports/games/gnuchess.orig/files/patch-book.h	Wed Dec 31 18:00:00 1969
+++ ports/games/gnuchess/files/patch-book.h	Fri Dec  3 23:06:34 2004
@@ -0,0 +1,12 @@
+--- src/book.h.orig    Fri Nov 26 19:20:29 2004
++++ src/book.h Fri Nov 26 19:21:15 2004
+@@ -31,8 +31,7 @@
+  */
+ static char const * bookbin[] = {
+    "book.dat",
+-   "/usr/share/games/gnuchess/book.dat",
+-   "/usr/lib/games/gnuchess/book.dat",
++   "/usr/local/share/gnuchess/book.dat",
+    NULL
+ };
+ 
diff -ruN ports/games/gnuchess.orig/pkg-descr
ports/games/gnuchess/pkg-descr
--- ports/games/gnuchess.orig/pkg-descr	Mon Oct  7 05:28:08 2002
+++ ports/games/gnuchess/pkg-descr	Fri Dec  3 23:06:34 2004
@@ -1,4 +1,4 @@
-       Gnuchess  plays	a  game  of  chess against the user or it
+       Gnuchess  plays a  game  of  chess against the user or it
        plays against itself.
 
        Gnuchess is an updated version of the  GNU  chess  playing
diff -ruN ports/games/gnuchess.orig/pkg-plist
ports/games/gnuchess/pkg-plist
--- ports/games/gnuchess.orig/pkg-plist	Wed Oct  8 06:31:49 2003
+++ ports/games/gnuchess/pkg-plist	Wed Dec 31 18:00:00 1969
@@ -1,2 +0,0 @@
-bin/gnuchess
-bin/gnuchessx
diff -ruN ports/games/gnuchess.orig/scripts/create_opening_book.sh
ports/games/gnuchess/scripts/create_opening_book.sh
--- ports/games/gnuchess.orig/scripts/create_opening_book.sh	Wed Dec 31 18:00:00 1969
+++ ports/games/gnuchess/scripts/create_opening_book.sh	Fri Dec  3 23:06:34 2004
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+DISTDIR=$1
+WRKSRC=$2
+
+[ -f ${WRKSRC}/src/book.dat ] && exit 0
+
+builtin echo -e "\nCreating opening book for gnuchess...\n"
+
+cp ${DISTDIR}/book_1.01.pgn.gz ${WRKSRC}/src/book.pgn.gz
+
+cd ${WRKSRC}/src && gunzip -f book.pgn.gz
+
+./gnuchess << END
+book add book.pgn
+quit
+END
+
+[ $? = 0 ] && builtin echo -e "\nBook successfully created!\n"


-- 
Conrad J. Sabatier <conrads at cox.net> -- "In Unix veritas"



More information about the freebsd-ports-bugs mailing list