aboutsummaryrefslogtreecommitdiffstats
path: root/games/pythonsudoku/Makefile
blob: 2f1fe79d915593e4418a2194d544a38bcbe5d35c (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Created by: Rusmir Dusko <nemysis@FreeBSD.org>
# $FreeBSD$

PORTNAME=   pythonsudoku
PORTVERSION=    0.13
PORTREVISION=   4
CATEGORIES= games python
MASTER_SITES=   SF/${PORTNAME}/Python%20Sudoku/${PORTVERSION}/ \
        SF/nemysisfreebsdp/games/:icons
DISTFILES=  ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} \
        ${PORTNAME}.png:icons
DIST_SUBDIR=    python
EXTRACT_ONLY=   ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX}

MAINTAINER= games@FreeBSD.org
COMMENT=    Text and graphical program to create or resolve Sudokus

LICENSE=    GPLv2

LIB_DEPENDS+=   libcups.so:${PORTSDIR}/print/cups-client
RUN_DEPENDS=    ${PYGAME} \
        ${PYTHON_PKGNAMEPREFIX}imaging>=0:${PORTSDIR}/graphics/py-imaging \
        ${PYTHON_PKGNAMEPREFIX}reportlab1>=0:${PORTSDIR}/print/py-reportlab1

USES=       tar:bzip2
USE_GNOME=  pygtk2
USE_PYTHON= 2
USE_PYDISTUTILS=yes
INSTALLS_ICONS= yes

PORTDOCS=   *

DOCSRCDIR1= ${WRKSRC}
DOC_FILES1= Changelog README

DOCSRCDIR2= ${WRKSRC}/doc
DOCSDIR2=   ${DOCSDIR}/doc
DOC_FILES2= *.png *.html *.txt *.css

DESKTOP_ENTRIES="Python Sudoku" "" "${PORTNAME}" \
        "${PORTNAME}" "Game;LogicGame;" ""

OPTIONS_DEFINE= DOCS NLS
OPTIONS_SUB=    yes

NLS_USES=   gettext:run

.include <bsd.port.options.mk>

post-patch:
    @${REINPLACE_CMD} -e 's|/usr/games|${PREFIX}/bin|; \
        s|/usr/share/games|${PREFIX}/share|' \
        ${WRKSRC}/setup.cfg
    @${REINPLACE_CMD} -e  \
        's|#localedir = "DIRECTORY"|localedir = "${PREFIX}/share/locale"|' \
        ${WRKSRC}/pythonsudoku/config.py
    @${FIND} ${WRKSRC} -name POTFILES -or -name *.po -or -name *.pot | \
        ${XARGS} ${REINPLACE_CMD} -e \
        's|/usr/lib/python2.4|${PYTHON_CMD}|'
    @${FIND} ${WRKSRC} -name "*.bak" -delete

.if ! ${PORT_OPTIONS:MNLS}
    @${REINPLACE_CMD} -i '' \
        '/for lingua in linguas():/,/\["locale\/%s\/LC_MESSAGES\/pythonsudoku.mo" % lingua\]))/s/^/#/' \
        ${WRKSRC}/setup.py
.endif

post-install:
    @cd ${STAGEDIR}${PREFIX}/bin && ${LN} -sf pysdk-gui.py ${PORTNAME}
    (cd ${WRKSRC}/doc && ${INSTALL_MAN} *.6 \
        ${STAGEDIR}${MAN6PREFIX}/man/man6/)

    ${INSTALL_DATA} ${_DISTDIR}/${PORTNAME}.png \
        ${STAGEDIR}${PREFIX}/share/pixmaps/

    @${MKDIR} ${STAGEDIR}${DOCSDIR2}
    ${INSTALL_DATA} ${DOC_FILES1:S|^|${DOCSRCDIR1}/|} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${DOC_FILES2:S|^|${DOCSRCDIR2}/|} ${STAGEDIR}${DOCSDIR2}

.include <bsd.port.mk>