- Update GNU Chess to 6.0.0

- Remove obsoleted patch files
- Replace opening book creating script
This commit is contained in:
Johan van Selst 2011-06-11 16:56:00 +00:00
parent b1c501be2e
commit d84bc7f64e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=275387
5 changed files with 37 additions and 54 deletions

View file

@ -6,7 +6,7 @@
#
PORTNAME= gnuchess
PORTVERSION= 5.08
PORTVERSION= 6.0.0
CATEGORIES= games
MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= chess
@ -16,20 +16,19 @@ DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= johans@FreeBSD.org
COMMENT= "Classic" Gnu Chess
PLIST_FILES= bin/gnuchess \
bin/gnuchessx
INFO= gnuchess
PLIST_FILES= bin/gnuchess bin/gnuchessu bin/gnuchessx
PORTDOCS= *
PORTDATA= *
OPTIONS= OPENING_BOOK "Install opening book (25 MB download)" on
OPTIONS= OPENING_BOOK "Install opening book (25 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
DISTFILES+= book_1.02.pgn.gz
EXTRACT_ONLY= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}
USE_PERL5_BUILD=yes
.endif
GNU_CONFIGURE= yes
@ -39,23 +38,18 @@ post-patch:
@${REINPLACE_CMD} -e 's|-D_THREAD_SAFE|${PTHREAD_CFLAGS:S/"//g}|g ; \
s|-pthread ||g' ${WRKSRC}/configure
pre-install:
post-build:
.if defined(WITH_OPENING_BOOK)
@${SH} ${SCRIPTDIR}/create_opening_book.sh ${DISTDIR} ${WRKSRC}
zcat ${DISTDIR}/book_1.02.pgn.gz > ${WRKSRC}/src/book.pgn
cd ${WRKSRC}/src && ${PERL} ${SCRIPTDIR}/create_opening_book.pl
@${REINPLACE_CMD} -e '/Book =/s/false/true/' ${WRKSRC}/src/gnuchess.ini
.endif
post-install:
${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}
${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/NEWS ${WRKSRC}/doc/* ${DOCSDIR}
.endif
.include <bsd.port.post.mk>

View file

@ -1,4 +1,4 @@
SHA256 (gnuchess-5.08.tar.gz) = c4e49e0dec210f5d131a02ff89588b482787cd702a08456791ba9100b4c6ffc0
SIZE (gnuchess-5.08.tar.gz) = 279309
SHA256 (book_1.01.pgn.gz) = 35df43a342c73e6624e8dbfed78d588c2085208168c3cd3300295e3c57981be0
SIZE (book_1.01.pgn.gz) = 26070544
SHA256 (gnuchess-6.0.0.tar.gz) = a91cc84447f2241224c44fb72f5eabaff325f1f883e40da4838fa236bff61ffa
SIZE (gnuchess-6.0.0.tar.gz) = 553779
SHA256 (book_1.02.pgn.gz) = deac77edb061a59249a19deb03da349cae051e52527a6cb5af808d9398d32d44
SIZE (book_1.02.pgn.gz) = 26265281

View file

@ -1,12 +0,0 @@
--- 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
};

View file

@ -0,0 +1,20 @@
#!/usr/bin/env perl
#
# Uses ./gnuchess to build 'book.bin' data from a 'book.pgn' input file
#
use IPC::Open2;
print "\nCreating opening book for gnuchess...\n";
unlink 'book.bin';
open2(\*OUT, \*IN, './gnuchess');
print IN "book add book.pgn\n";
while (<OUT>)
{
print IN "quit\n" if /^all done/;
print;
}
print "\nBook successfully created!\n"

View file

@ -1,19 +0,0 @@
#!/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"