summaryrefslogtreecommitdiffstats
path: root/games/pysolfc/Makefile
blob: 034be7a758cbd16fe106c9dbdb1b3a42b6b34399 (plain)
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
# $FreeBSD$

PORTNAME=	pysolfc
PORTVERSION=	2.0
PORTREVISION=	7
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=	ports@FreeBSD.org
COMMENT=	Solitaire game, written in Python and the successor of PySol

LICENSE=	GPLv3+
LICENSE_FILE=	${WRKSRC}/COPYING

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

USES=		python shebangfix tar:bzip2
USE_PYTHON=	autoplist distutils
NO_ARCH=	yes
SHEBANG_FILES=	data/themes/clearlooks/create_imgs.py

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} -r
	@${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} -r ${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:
	@${MKDIR} ${STAGEDIR}${DOCSDIR}/
	cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${STAGEDIR}${DOCSDIR}/

.include <bsd.port.mk>
OpenPOWER on IntegriCloud