aboutsummaryrefslogtreecommitdiffstats
path: root/games/pysolfc/Makefile
blob: fbdf1be55455f7c518fe604e6499018cafd8df86 (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
# $FreeBSD$

PORTNAME=   pysolfc
PORTVERSION=    2.0
PORTREVISION=   6
CATEGORIES= games python
MASTER_SITES=   SF/${PORTNAME}/PySolFC/PySolFC-${PORTVERSION} \
        SF/${PORTNAME}/PySolFC-Cardsets/PySolFC-Cardsets-${PORTVERSION}:cardsets
DISTFILES=  PySolFC-${DISTVERSION}${EXTRACT_SUFX}
DIST_SUBDIR=    ${PORTNAME}

MAINTAINER= mva@FreeBSD.org
COMMENT=    Solitaire game, written in Python and the successor of PySol

LICENSE=    GPLv3

RUN_DEPENDS=    ${PYTHON_PKGNAMEPREFIX}tkinter>0:x11-toolkits/py-tkinter \
        ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow

USES=       python tar:bzip2
USE_PYTHON= autoplist distutils
NO_ARCH=    yes

PLIST_FILES=    share/pixmaps/pysolfc.png
DATADIR=    ${PREFIX}/share/PySolFC
WRKSRC=     ${WRKDIR}/PySolFC-${PORTVERSION}
PORTDOCS=   README

CARDSET_DUPS=   2000 crystal-mahjongg dashavatara-ganjifa dondorf \
        gnome-mahjongg-1 hexadeck kintengu matrix mughal-ganjifa \
        oxymoron standard tuxedo vienna-2k

OPTIONS_DEFINE= CARDSETS DOCS NLS
CARDSETS_DESC=  Install additional cardsets

OPTIONS_SUB=    yes

CARDSETS_DISTFILES= PySolFC-Cardsets-${DISTVERSION}${EXTRACT_SUFX}:cardsets
NLS_USES=       gettext

post-patch:
    @${MV} ${WRKSRC}/pysol.py ${WRKSRC}/pysolfc
    @${REINPLACE_CMD} -e 's|pysol.py|pysolfc|' ${WRKSRC}/setup.py
    @${REINPLACE_CMD} -e 's|^Icon.*|Icon=${PORTNAME}|' \
        -e 's|^Exec.*|Exec=${PORTNAME}|' \
        ${WRKSRC}/data/pysol.desktop
    @${FIND} ${WRKDIR} -name .thumbnails -or -name .xvpics | \
        ${XARGS} ${RM} -rf
    @${FIND} ${WRKSRC} -name "*.bak" -delete

post-patch-NLS-off:
    @${REINPLACE_CMD} -e "s|for l in ('ru', 'ru_RU')|for l in ()|" \
        ${WRKSRC}/setup.py

post-install:
    ${LN} -s ${PREFIX}/share/icons/pysol01.png \
        ${STAGEDIR}${PREFIX}/share/pixmaps/${PORTNAME}.png

post-install-CARDSETS-on:
.for cdir in ${CARDSET_DUPS}
    @${RM} -rf ${WRKDIR}/PySolFC-Cardsets-${PORTVERSION}/cardset-${cdir}
.endfor
    @cd ${WRKDIR}/PySolFC-Cardsets-${PORTVERSION} && \
        ${COPYTREE_SHARE} \* ${STAGEDIR}${DATADIR}
    @cd ${WRKDIR}/PySolFC-Cardsets-${PORTVERSION} && \
        ${FIND} . -type f | ${SED} -e 's|^./|${DATADIR_REL}/|' >> ${TMPPLIST}

post-install-DOCS-on:
    @${INSTALL} -d ${STAGEDIR}${DOCSDIR}/
    @cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/

.include <bsd.port.mk>