summaryrefslogtreecommitdiff
path: root/games/freedoko/Makefile
blob: e95afcd46f1cc17823aaed6c7312a99dbf3aa64f (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Created by: Thomas Gellekum <tg@FreeBSD.org>
# $FreeBSD$

PORTNAME=	freedoko
PORTVERSION=	0.7.14
PORTREVISION=	1
CATEGORIES=	games
MASTER_SITES=	SF/free-doko/FreeDoko%20source
DISTNAME=	FreeDoko_${PORTVERSION}.src

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Play the card game Doppelkopf

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/../doc/GPL

LIB_DEPENDS=	libgnet-2.0.so:net/gnet2

WRKSRC=		${WRKDIR}/${DISTNAME:C/\.src$//}/src

USES=		gmake pkgconfig zip:infozip
USE_GNOME=	gtkmm24
MAKE_ENV=	OS="${OPSYS}" DATADIR="${DATADIR}" DOCSDIR="${DOCSDIR}"

OPTIONS_DEFINE=		DOCS OPENAL
OPTIONS_DEFAULT=	OPENAL

OPENAL_USES=		openal:alut
OPENAL_MAKE_ENV=	INCLUDE_SOUND_ALUT="$$(pkg-config --cflags freealut)" \
			LIBS_SOUND_ALUT="$$(pkg-config --libs freealut)" \
			USE_SOUND=true USE_SOUND_ALUT=true

post-patch:
	@${REINPLACE_CMD} -e \
		's|@echo $$(CXX)|@true $$(CXX)|g ; \
		 s|@$$(CXX)|$$(CXX)|g' \
		${WRKSRC}/Makefile.rules
	@${REINPLACE_CMD} -e \
		'/\/X11\//d ; \
		 s|/usr/local/|${LOCALBASE}/|g' \
		${WRKSRC}/misc/setting.cpp
	@${REINPLACE_CMD} -e \
		'/^Exec/s|=.*|=FreeDoko| ; \
		 /^Path/d ; \
		 /Categories/s|Application;|GTK;|' \
		${WRKSRC}/../bin/FreeDoko.desktop

do-configure:
	@(cd ${WRKSRC} && ${SED} -e \
		'/VALUE/s|#CPPFLAGS|CPPFLAGS| ; \
		 s|\.\./data|$$(DATADIR)| ; \
		 s|\.\./manual|$$(DOCSDIR)/manual|' \
		< Makefile.local.template > Makefile.local)

post-build:
	@${FIND} ${WRKSRC}/../doc -empty -delete

do-install:
	(cd ${WRKSRC} && ${INSTALL_PROGRAM} FreeDoko \
		${STAGEDIR}${PREFIX}/bin)
	${LN} -sf FreeDoko ${STAGEDIR}${PREFIX}/bin/freedoko
	(cd ${WRKSRC}/../bin && ${INSTALL_DATA} FreeDoko.desktop \
		${STAGEDIR}${PREFIX}/share/applications)
	${MKDIR} ${STAGEDIR}${DATADIR}
	(cd ${WRKSRC} && ${INSTALL_DATA} icon.png logo.png \
		${STAGEDIR}${DATADIR})
.for i in backgrounds cardsets iconsets rules sounds translations
	(cd ${WRKSRC}/../data && ${COPYTREE_SHARE} ${i} \
		${STAGEDIR}${DATADIR} "! -name *Makefile*")
.endfor
	${LN} -sf ${DATADIR}/icon.png \
		${STAGEDIR}${PREFIX}/share/pixmaps/FreeDoko.png

post-install-DOCS-on:
	${MKDIR} ${STAGEDIR}${DOCSDIR}
	(cd ${WRKSRC}/../doc && ${INSTALL_DATA} Bugs Roadmap \
		${STAGEDIR}${DOCSDIR})
	${MKDIR} ${STAGEDIR}${DOCSDIR}/de
	(cd ${WRKSRC}/../doc/de && ${INSTALL_DATA} LiesMich.* \
		${STAGEDIR}${DOCSDIR}/de)
	${MKDIR} ${STAGEDIR}${DOCSDIR}/en
	(cd ${WRKSRC}/../doc/en && ${INSTALL_DATA} README.* \
		${STAGEDIR}${DOCSDIR}/en)
	${MKDIR} ${STAGEDIR}${DOCSDIR}/manual
	(cd ${WRKSRC}/../manual && ${COPYTREE_SHARE} . \
		${STAGEDIR}${DOCSDIR}/manual "! -name *Makefile*")

.include <bsd.port.mk>