aboutsummaryrefslogtreecommitdiff
path: root/games/ufoai/Makefile
blob: c249fdb9a6314eb0c854399f2664f0f66d21b883 (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# New ports collection makefile for:	ufoai
# Date created:		2006-09-03
# Whom:			Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=	ufoai
DISTVERSION=	2.0RC5
PORTREVISION=	2
CATEGORIES=	games
MASTER_SITES=	SF
DISTNAME=	${PORTNAME:S/$/-/}${DISTVERSION:S/R/-R/}-source
DIST_SUBDIR=	${PORTNAME}

MAINTAINER=	acm@FreeBSD.org
COMMENT=	A strategy game featuring tactical combat

LIB_DEPENDS=	vorbis:${PORTSDIR}/audio/libvorbis \
		jpeg.9:${PORTSDIR}/graphics/jpeg
RUN_DEPENDS=	${LOCALBASE}/share/${PORTNAME}/default.cfg:${PORTSDIR}/games/ufoai-data

USE_BZIP2=	yes
USE_GL=		yes
USE_SDL=	sdl ttf
USE_GETTEXT=	yes
USE_GMAKE=	yes

DATADIR=	share/${PORTNAME}
SUB_FILES=	pkg-message
UFO_DIR=	${PREFIX}/lib/${PORTNAME}
UFO_LIBS=	ref_glx ref_sdl snd_sdl ref_glx snd_oss
UFO_FILES=	ufo

OPTIONS=		SERVER	"Install dedicated server"	on \
			UFO2MAP	"Install UFO tools"	on \
			ARTS	"Support for arts sound system"	off \
			IPV6	"Support for ipv6"	off

.include <bsd.port.pre.mk>

.if ${OSVERSION} < 500000
IGNORE=		does not build on FreeBSD 4.x
.endif

.if !defined(WITHOUT_SERVER)
HAVE_SERVER=	true
MAKE_ENV+=	BUILD_DEDICATED="YES"
UFO_FILES+=	ufoded
PLIST_SUB+=	SERVER=""
.else
MAKE_ENV+=	BUILD_DEDICATED="NO"
PLIST_SUB+=	SERVER="@comment "
.endif

.if !defined(WITHOUT_UFO2MAP)
HAVE_UFO2MAP=	true
MAKE_ENV+=	BUILD_COMPILETOOLS="YES"
UFO_FILES+=	ufo2map
PLIST_SUB+=	UFO2MAP=""
.else
MAKE_ENV+=	BUILD_COMPILETOOLS="NO"
PLIST_SUB+=	UFO2MAP="@comment "
.endif

.if defined(WITH_ARTS)
HAVE_ARTS=	true
MAKE_ENV+=	BUILD_ARTS="YES"
LIB_DEPENDS+=	artsc.0:${PORTSDIR}/audio/arts
UFO_LIBS+=	snd_arts
PLIST_SUB+=	ARTS=""
.else
MAKE_ENV+=	BUILD_ARTS="NO"
PLIST_SUB+=	ARTS="@comment "
.endif

.if defined(WITH_IPV6)
HAVE_IPV6=	true
MAKE_ENV+=	HAVE_IPV6="YES"
.else
MAKE_ENV+=	HAVE_IPV6="NO"
.endif

post-patch:
	${REINPLACE_CMD} -e "s|^BUILD_ARTS=|BUILD_ARTS?=|g" -e \
		"s|^BUILD_DEDICATED=|BUILD_DEDICATED?=|g" -e \
		"s|^BUILD_COMPILETOOLS=|BUILD_COMPILETOOLS?=|g" -e \
		"s|^HAVE_IPV6=|HAVE_IPV6?=|g" ${WRKSRC}/Makefile

pre-install:
.	for FILE in ${UFO_FILES}
		@${ECHO} "#!/bin/sh" > ${WRKDIR}/${FILE}
		@${ECHO} "cd ${PREFIX}/${DATADIR} || exit 1 " >> ${WRKDIR}/${FILE}
		@${ECHO} "exec ${PREFIX}/${DATADIR}/${FILE} \"$$@\"" >> ${WRKDIR}/${FILE}
.	endfor

do-install:
	@${MKDIR} ${UFO_DIR}/base/i18n
.	for FILE in ${UFO_FILES}
	@${SED} \
		-e 's|@UFODIR@|${UFO_DIR}|' \
		-e 's|@APP@|${FILE}|' \
		${FILESDIR}/run.sh.in > ${WRKDIR}/${FILE}
		${INSTALL_PROGRAM} ${WRKSRC}/release${ARCH}/${FILE} ${UFO_DIR}
		${INSTALL_SCRIPT} ${WRKDIR}/${FILE} ${PREFIX}/bin
.	endfor
.	for FILE in ${UFO_LIBS}
		${INSTALL_PROGRAM} ${WRKSRC}/release${ARCH}/${FILE}.so ${UFO_DIR}
.	endfor
		${INSTALL_PROGRAM} ${WRKSRC}/release${ARCH}/game.so ${UFO_DIR}/base

	@cd ${WRKSRC}/base/i18n && \
		${FIND} * -type d -exec ${MKDIR} "${UFO_DIR}/base/i18n/{}" \; && \
			${FIND} * -type f -exec ${INSTALL_DATA} "{}" "${UFO_DIR}/base/i18n/{}" \;
	${LN} -s ${PREFIX}/${DATADIR}/* ${UFO_DIR}/base

post-install:
	@${CAT} ${PKGMESSAGE}

.include <bsd.port.post.mk>