aboutsummaryrefslogtreecommitdiffstats
path: root/games
diff options
context:
space:
mode:
authornemysis <nemysis@FreeBSD.org>2014-05-18 20:28:39 +0800
committernemysis <nemysis@FreeBSD.org>2014-05-18 20:28:39 +0800
commitc3cfe58ddb1ac0db466014a56cdac5c08f45f0c1 (patch)
treef05caed2475c1ceb88e57496afb4551ffd495b89 /games
parentd794ee88004140a182a1957583847ab21f4ba0d3 (diff)
downloadfreebsd-ports-gnome-c3cfe58ddb1ac0db466014a56cdac5c08f45f0c1.tar.gz
freebsd-ports-gnome-c3cfe58ddb1ac0db466014a56cdac5c08f45f0c1.tar.zst
freebsd-ports-gnome-c3cfe58ddb1ac0db466014a56cdac5c08f45f0c1.zip
- Update to 0.7, announce message is here:
http://yakinikuman.wordpress.com/2009/04/28/python-chess-v-07-lowering-pygames-cpu-usage/ - Change master sites, add icon - Transfer maintainership to games@ team - Add license (GPLv3) - Change USE_PYTHON=yes to USE_PYTHON=2 - Add USES dos2unix - Add files/pythonchess.in and Desktop entry file - Remove unnecessary Thumbs.db and pygame2exe_Chess.py - Fix the usage of 'python' to get rid of the implicit lang/python dependency - Change build and install - Change pkg-descr and add WWW
Diffstat (limited to 'games')
-rw-r--r--games/pythonchess/Makefile53
-rw-r--r--games/pythonchess/distinfo6
-rw-r--r--games/pythonchess/files/pythonchess.in7
-rw-r--r--games/pythonchess/pkg-descr11
-rw-r--r--games/pythonchess/pkg-plist70
5 files changed, 110 insertions, 37 deletions
diff --git a/games/pythonchess/Makefile b/games/pythonchess/Makefile
index ce6345b4b9f1..e5ecd6e483fe 100644
--- a/games/pythonchess/Makefile
+++ b/games/pythonchess/Makefile
@@ -2,28 +2,55 @@
# $FreeBSD$
PORTNAME= pythonchess
-PORTVERSION= 0.6
-PORTREVISION= 2
+PORTVERSION= 0.7
CATEGORIES= games
-MASTER_SITES= ${MASTER_SITE_LOCAL}
-MASTER_SITE_SUBDIR= alepulver
-EXTRACT_SUFX= .tgz
+MASTER_SITES= http://sites.google.com/site/purplesaguaroinc/myfiles/ \
+ SF/nemysisfreebsdp/games/:icons
+DISTFILES= ${PORTNAME:S/p/P/:S/c/C/}_v${DISTVERSION}${EXTRACT_SUFX} \
+ ${PORTNAME}.png:icons
+DIST_SUBDIR= ${PORTNAME}
+EXTRACT_ONLY= ${PORTNAME:S/p/P/:S/c/C/}_v${DISTVERSION}${EXTRACT_SUFX}
-MAINTAINER= ports@FreeBSD.org
+MAINTAINER= games@FreeBSD.org
COMMENT= Small program for playing chess against the computer
+LICENSE= GPLv3
+
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}tkinter>0:${PORTSDIR}/x11-toolkits/py-tkinter
-USE_PYTHON= yes
+WRKSRC= ${WRKDIR}/${PORTNAME:S/p/P/:S/c/C/}
+
+USES= dos2unix zip
+DOS2UNIX_REGEX= .*.[^p][^n][^g]$
+USE_PYTHON= 2
+
+SUB_FILES= ${PORTNAME}
+
+DESKTOP_ENTRIES="Python Chess" "" "${PORTNAME}" \
+ "${PORTNAME}" "Game;BoardGame;" ""
+
+post-patch:
+ @${FIND} ${WRKDIR} -name Thumbs.db -or -name pygame2exe_Chess.py | \
+ ${XARGS} ${RM} -fr
+ @${REINPLACE_CMD} -e 's|^.*#!.*python.*$$|#!${PYTHON_CMD}|' \
+ ${WRKSRC}/*.py
+ @(cd ${WRKSRC} && ${RM} *.py.bak)
do-build:
- @(${ECHO_CMD} "#!${SH}"; \
- ${ECHO_CMD} "cd ${DATADIR} && ${PYTHON_CMD} board.py") \
- > ${WRKDIR}/${PORTNAME}
+ ${PYTHON_CMD} -m compileall ${WRKSRC}
+ @${PYTHON_CMD} -O -m compileall ${WRKSRC}
do-install:
- ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
- @${MKDIR} ${STAGEDIR}${DATADIR}
- (cd ${WRKSRC} && ${INSTALL_DATA} *.gif *.py *.txt ${STAGEDIR}${DATADIR})
+ @${REINPLACE_CMD} -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' \
+ ${WRKDIR}/${PORTNAME}
+ ${INSTALL_SCRIPT} ${WRKDIR}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
+
+ @(cd ${WRKSRC} && ${COPYTREE_SHARE} images ${STAGEDIR}${DATADIR})
+.for f in *.py *.pyc *.py
+ ${INSTALL_SCRIPT} ${WRKSRC}/${f} ${STAGEDIR}${DATADIR}
+.endfor
+
+ ${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png \
+ ${STAGEDIR}${PREFIX}/share/pixmaps/
.include <bsd.port.mk>
diff --git a/games/pythonchess/distinfo b/games/pythonchess/distinfo
index 2103b4c1eaa6..d93e7fa1f37e 100644
--- a/games/pythonchess/distinfo
+++ b/games/pythonchess/distinfo
@@ -1,2 +1,4 @@
-SHA256 (pythonchess-0.6.tgz) = 944249decbd8699acb8749c268d8932bbfe2b89c1d1f3375e95ba52c7a926552
-SIZE (pythonchess-0.6.tgz) = 40919
+SHA256 (pythonchess/PythonChess_v0.7.zip) = ebf10767e6c83ea90e39ccee07064929f969862995daae439b6e5edb3def1526
+SIZE (pythonchess/PythonChess_v0.7.zip) = 160772
+SHA256 (pythonchess/pythonchess.png) = 5f4fb6ca2280935b7696bf48e4215c2dcd1c286cbd8fc04cff24524c9d0c9fc0
+SIZE (pythonchess/pythonchess.png) = 680
diff --git a/games/pythonchess/files/pythonchess.in b/games/pythonchess/files/pythonchess.in
new file mode 100644
index 000000000000..25a5519499b0
--- /dev/null
+++ b/games/pythonchess/files/pythonchess.in
@@ -0,0 +1,7 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+cd "%%DATADIR%%"
+exec %%PYTHON_CMD%% ./PythonChessMain.py "${@}"
diff --git a/games/pythonchess/pkg-descr b/games/pythonchess/pkg-descr
index ef6d80f0d967..caf5f976a3a3 100644
--- a/games/pythonchess/pkg-descr
+++ b/games/pythonchess/pkg-descr
@@ -1,4 +1,7 @@
-pythonchess is a computer chess program for human vs. computer games.
-pythonchess is a complete chess program with alpha-beta search, hashing,
-pondering, iterative deepening, etc. implemented in Python programming
-language.
+Chess for player vs. player, player vs. AI, or AI vs. AI.
+Uses Tkinter to get initial game parameters.
+Uses Pygame to draw the board and pieces and to get user
+mouse clicks. Run with the “-h” option to get full listing
+of available command line flags.
+
+WWW: http://yakinikuman.wordpress.com/python-chess/
diff --git a/games/pythonchess/pkg-plist b/games/pythonchess/pkg-plist
index 816078e648b1..d3d652e94bc8 100644
--- a/games/pythonchess/pkg-plist
+++ b/games/pythonchess/pkg-plist
@@ -1,20 +1,54 @@
bin/pythonchess
-%%DATADIR%%/bishopb.gif
-%%DATADIR%%/bishopw.gif
-%%DATADIR%%/board.py
-%%DATADIR%%/chesspersonalities.py
-%%DATADIR%%/empty.gif
-%%DATADIR%%/kingb.gif
-%%DATADIR%%/kingw.gif
-%%DATADIR%%/knightb.gif
-%%DATADIR%%/knightw.gif
-%%DATADIR%%/nchess6.py
-%%DATADIR%%/openinglibrary.py
-%%DATADIR%%/openinglibrary.txt
-%%DATADIR%%/pawnb.gif
-%%DATADIR%%/pawnw.gif
-%%DATADIR%%/queenb.gif
-%%DATADIR%%/queenw.gif
-%%DATADIR%%/rookb.gif
-%%DATADIR%%/rookw.gif
+share/pixmaps/pythonchess.png
+%%DATADIR%%/ChessAI.py
+%%DATADIR%%/ChessAI.pyc
+%%DATADIR%%/ChessBoard.py
+%%DATADIR%%/ChessBoard.pyc
+%%DATADIR%%/ChessGUI_pygame.py
+%%DATADIR%%/ChessGUI_pygame.pyc
+%%DATADIR%%/ChessGUI_text.py
+%%DATADIR%%/ChessGUI_text.pyc
+%%DATADIR%%/ChessGameParams.py
+%%DATADIR%%/ChessGameParams.pyc
+%%DATADIR%%/ChessPlayer.py
+%%DATADIR%%/ChessPlayer.pyc
+%%DATADIR%%/ChessRules.py
+%%DATADIR%%/ChessRules.pyc
+%%DATADIR%%/PySetup.py
+%%DATADIR%%/PySetup.pyc
+%%DATADIR%%/PythonChessAIStats.py
+%%DATADIR%%/PythonChessAIStats.pyc
+%%DATADIR%%/PythonChessMain.py
+%%DATADIR%%/PythonChessMain.pyc
+%%DATADIR%%/ScrollingTextBox.py
+%%DATADIR%%/ScrollingTextBox.pyc
+%%DATADIR%%/images/Chess_tile_bd.png
+%%DATADIR%%/images/Chess_tile_bl.png
+%%DATADIR%%/images/Chess_tile_kd.png
+%%DATADIR%%/images/Chess_tile_kl.png
+%%DATADIR%%/images/Chess_tile_nd.png
+%%DATADIR%%/images/Chess_tile_nl.png
+%%DATADIR%%/images/Chess_tile_pd.png
+%%DATADIR%%/images/Chess_tile_pl.png
+%%DATADIR%%/images/Chess_tile_qd.png
+%%DATADIR%%/images/Chess_tile_ql.png
+%%DATADIR%%/images/Chess_tile_rd.png
+%%DATADIR%%/images/Chess_tile_rl.png
+%%DATADIR%%/images/blackBishop.png
+%%DATADIR%%/images/blackKing.png
+%%DATADIR%%/images/blackKnight.png
+%%DATADIR%%/images/blackPawn.png
+%%DATADIR%%/images/blackQueen.png
+%%DATADIR%%/images/blackRook.png
+%%DATADIR%%/images/brown_square.png
+%%DATADIR%%/images/chess_icon.ico
+%%DATADIR%%/images/cyan_square.png
+%%DATADIR%%/images/whiteBishop.png
+%%DATADIR%%/images/whiteKing.png
+%%DATADIR%%/images/whiteKnight.png
+%%DATADIR%%/images/whitePawn.png
+%%DATADIR%%/images/whiteQueen.png
+%%DATADIR%%/images/whiteRook.png
+%%DATADIR%%/images/white_square.png
+@dirrm %%DATADIR%%/images
@dirrm %%DATADIR%%