Update games/stransball2 to version 1.5_10
[dports.git] / games / pythonsudoku / Makefile
1 # Created by: Rusmir Dusko <nemysis@FreeBSD.org>
2 # $FreeBSD$
3
4 PORTNAME=       pythonsudoku
5 PORTVERSION=    0.13
6 PORTREVISION=   6
7 CATEGORIES=     games python
8 MASTER_SITES=   SF/${PORTNAME}/Python%20Sudoku/${PORTVERSION}/ \
9                 SF/nemysisfreebsdp/games/:icons
10 DISTFILES=      ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} \
11                 ${PORTNAME}.png:icons
12 DIST_SUBDIR=    python
13 EXTRACT_ONLY=   ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}
14
15 MAINTAINER=     ports@FreeBSD.org
16 COMMENT=        Text and graphical program to create or resolve Sudokus
17
18 LICENSE=        GPLv2 # or later
19 LICENSE_FILE=   ${WRKSRC}/COPYING
20
21 LIB_DEPENDS+=   libcups.so:${PORTSDIR}/print/cups-client
22 RUN_DEPENDS=    ${PYGAME} \
23                 ${PYTHON_PKGNAMEPREFIX}pillow>=0:${PORTSDIR}/graphics/py-pillow \
24                 ${PYTHON_PKGNAMEPREFIX}reportlab1>=0:${PORTSDIR}/print/py-reportlab1
25
26 USES=           python:2 tar:bzip2
27 USE_GNOME=      pygtk2
28 USE_PYTHON=     distutils
29 INSTALLS_ICONS= yes
30
31 PORTDOCS=       *
32
33 DESKTOP_ENTRIES="Python Sudoku" "" "${PORTNAME}" \
34                 "${PORTNAME}" "Game;LogicGame;" ""
35
36 OPTIONS_DEFINE= DOCS NLS
37 OPTIONS_SUB=    yes
38
39 NLS_USES=       gettext-runtime:run
40
41 .include <bsd.port.options.mk>
42
43 post-patch:
44         @${REINPLACE_CMD} -e 's|/usr/games|${PREFIX}/bin|; \
45                 s|/usr/share/games|${PREFIX}/share|' \
46                 ${WRKSRC}/setup.cfg
47         @${REINPLACE_CMD} -e  \
48                 's|#localedir = "DIRECTORY"|localedir = "${PREFIX}/share/locale"|' \
49                 ${WRKSRC}/pythonsudoku/config.py
50         @${FIND} ${WRKSRC} -name POTFILES -or -name *.po -or -name *.pot | \
51                 ${XARGS} ${REINPLACE_CMD} -e \
52                 's|/usr/lib/python2.4|${PYTHON_CMD}|'
53         @${FIND} ${WRKSRC} -name "*.bak" -delete
54
55 .if ! ${PORT_OPTIONS:MNLS}
56         @${REINPLACE_CMD} -i '' \
57                 '/for lingua in linguas():/,/\["locale\/%s\/LC_MESSAGES\/pythonsudoku.mo" % lingua\]))/s/^/#/' \
58                 ${WRKSRC}/setup.py
59 .endif
60
61 post-install:
62         @cd ${STAGEDIR}${PREFIX}/bin && ${LN} -sf pysdk-gui.py ${PORTNAME}
63         (cd ${WRKSRC}/doc && ${INSTALL_MAN} *.6 \
64                 ${STAGEDIR}${MAN6PREFIX}/man/man6/)
65         ${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png \
66                 ${STAGEDIR}${PREFIX}/share/pixmaps/
67         cd ${WRKSRC} && ${COPYTREE_SHARE} "Changelog README \
68                 doc/*.png doc/*.html doc/*.txt doc/*.css" ${STAGEDIR}${DOCSDIR}
69
70 .include <bsd.port.mk>