aboutsummaryrefslogtreecommitdiffstats
path: root/games/gnuchess/Makefile
blob: 078f70f96a6b71a271b81eb8b2c2d0b9be7d623f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Created by: markm
# $FreeBSD$

PORTNAME=   gnuchess
PORTVERSION=    6.2.1
CATEGORIES= games
MASTER_SITES=   GNU
MASTER_SITE_SUBDIR= chess
# The DISTFILES here is explicitly needed because it can be extended later.
DISTFILES=  ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}

MAINTAINER= johans@FreeBSD.org
COMMENT=    "Classic" Gnu Chess

GNU_CONFIGURE=  yes
CONFIGURE_ENV=  MKDIR_P="${MKDIR}"
INFO=       gnuchess
USES=       shebangfix
SHEBANG_FILES=  doc/quotes.rb

OPTIONS_DEFINE=     OPENING_BOOK DOCS NLS
OPTIONS_DEFAULT=    OPENING_BOOK
OPTIONS_SUB=        yes
OPENING_BOOK_DESC=  Install opening book (25 MB download)
NLS_USES=       gettext
NLS_CONFIGURE_ENABLE=   nls

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MOPENING_BOOK}
DISTFILES+= book_1.02.pgn.gz
EXTRACT_ONLY+=  ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}
.endif

post-build:
.if ${PORT_OPTIONS:MOPENING_BOOK}
    zcat ${DISTDIR}/book_1.02.pgn.gz > ${WRKSRC}/src/book.pgn
    cd ${WRKSRC}/src && ./gnuchess --addbook book.pgn
    @${REINPLACE_CMD} -e '/Book =/s/false/true/' ${WRKSRC}/src/gnuchess.ini
.endif

post-install:
    cd ${STAGEDIR}${PREFIX}/bin && ${LN} -f gnuchess gnuchessx
.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/NEWS ${WRKSRC}/doc/* ${STAGEDIR}${DOCSDIR}
.endif

.include <bsd.port.mk>