diff options
author | johans <johans@FreeBSD.org> | 2011-06-12 00:56:00 +0800 |
---|---|---|
committer | johans <johans@FreeBSD.org> | 2011-06-12 00:56:00 +0800 |
commit | c8f009986a9f5508921ff1240bdf72a66beeb3ad (patch) | |
tree | 867f5b9184602efacd5fbb6ba5b9246eaa0914d2 /games/gnuchess | |
parent | 4fc6114a0f09e1248171e169f54a476a419690ef (diff) | |
download | freebsd-ports-gnome-c8f009986a9f5508921ff1240bdf72a66beeb3ad.tar.gz freebsd-ports-gnome-c8f009986a9f5508921ff1240bdf72a66beeb3ad.tar.zst freebsd-ports-gnome-c8f009986a9f5508921ff1240bdf72a66beeb3ad.zip |
- Update GNU Chess to 6.0.0
- Remove obsoleted patch files
- Replace opening book creating script
Diffstat (limited to 'games/gnuchess')
-rw-r--r-- | games/gnuchess/Makefile | 32 | ||||
-rw-r--r-- | games/gnuchess/distinfo | 8 | ||||
-rw-r--r-- | games/gnuchess/files/patch-book.h | 12 | ||||
-rw-r--r-- | games/gnuchess/scripts/create_opening_book.pl | 20 | ||||
-rw-r--r-- | games/gnuchess/scripts/create_opening_book.sh | 19 |
5 files changed, 37 insertions, 54 deletions
diff --git a/games/gnuchess/Makefile b/games/gnuchess/Makefile index a5ea8d168a94..b7ceebae686e 100644 --- a/games/gnuchess/Makefile +++ b/games/gnuchess/Makefile @@ -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> diff --git a/games/gnuchess/distinfo b/games/gnuchess/distinfo index 1d792a56922e..3a398b3d327c 100644 --- a/games/gnuchess/distinfo +++ b/games/gnuchess/distinfo @@ -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 diff --git a/games/gnuchess/files/patch-book.h b/games/gnuchess/files/patch-book.h deleted file mode 100644 index 1c2d6666c16e..000000000000 --- a/games/gnuchess/files/patch-book.h +++ /dev/null @@ -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 - }; - diff --git a/games/gnuchess/scripts/create_opening_book.pl b/games/gnuchess/scripts/create_opening_book.pl new file mode 100644 index 000000000000..7997966c56f2 --- /dev/null +++ b/games/gnuchess/scripts/create_opening_book.pl @@ -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" diff --git a/games/gnuchess/scripts/create_opening_book.sh b/games/gnuchess/scripts/create_opening_book.sh deleted file mode 100644 index 39d4aff2d097..000000000000 --- a/games/gnuchess/scripts/create_opening_book.sh +++ /dev/null @@ -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" |