aboutsummaryrefslogtreecommitdiff
path: root/games/quake2forge/Makefile
blob: 89288b07fbcecd9120103a3f7d466181d16b091e (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
121
122
123
124
125
126
127
128
129
130
# New ports collection makefile for:	quake2
# Date created:				20.01.2003
# Whom:					Ulrich Spoerlein <q@uni.de>
#
# $FreeBSD$
#

PORTNAME=	quake2forge
PORTVERSION=	0.3
PORTREVISION=	4
CATEGORIES=	games
MASTER_SITES=	http://www.galgenberg.net/distfiles/
DISTNAME=	quake2-${PORTVERSION}

MAINTAINER=	alepulver@FreeBSD.org
COMMENT=	First Person Shooter with many addons available

USE_AUTOTOOLS=	autoconf:259 libtool:15
USE_BZIP2=	yes

CONFIGURE_ARGS=	--program-transform-name='s/^quake2$$/${PORTNAME}/' \
		--disable-warn
CONFIGURE_TARGET=--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}

OPTIONS=	AO "Build libao sound module" off \
		CTF "Build the CTF (Capture The Flag) modification" off \
		GAME "Build a main game .so file" off \
		GL "Build OpenGL renderer" on \
		SDL "Build SDL renderers" off \
		SVGA "Build SVGA renderer" off \
		X11 "Build X11 renderer" on

LIBDIR=		${PREFIX}/lib/${PORTNAME}

.include "${.CURDIR}/../quake2-data/Makefile.include"

.include <bsd.port.pre.mk>

.if defined(WITH_AO)
LIB_DEPENDS+=	ao.3:${PORTSDIR}/audio/libao
CONFIGURE_ARGS+=--with-ao=${LOCALBASE}
PLIST_SUB+=	AO=""
.else
CONFIGURE_ARGS+=--without-ao
PLIST_SUB+=	AO="@comment "
.endif

.if defined(WITH_CTF)
PLIST_SUB+=	CTF=""
.else
Q2F_BADMODS+=	ctf
PLIST_SUB+=	CTF="@comment "
.endif

.if defined(WITH_GAME)
PLIST_SUB+=	GAME=""
.else
Q2F_BADMODS+=	baseq2
PLIST_SUB+=	GAME="@comment "
.endif

.if defined(WITH_GL)
USE_GL=		yes
CONFIGURE_ARGS+=--with-opengl=${X11BASE}
PLIST_SUB+=	GL=""
.else
CONFIGURE_ARGS+=--with-opengl=no
PLIST_SUB+=	GL="@comment "
.endif

.if defined(WITH_SDL)
USE_SDL=	yes
CONFIGURE_ARGS+=--with-sdl=${LOCALBASE}
PLIST_SUB+=	SDL=""
.else
CONFIGURE_ARGS+=--disable-sdl --disable-sdltest
PLIST_SUB+=	SDL="@comment "
.endif

.if defined(WITH_GL) && defined(WITH_SDL)
PLIST_SUB+=	SDLGL=""
.else
PLIST_SUB+=	SDLGL="@comment "
.endif

.if defined(WITH_SVGA)
LIB_DEPENDS+=	vga.1:${PORTSDIR}/graphics/svgalib
CONFIGURE_ARGS+=--with-svgalib=${LOCALBASE}
PLIST_SUB+=	SVGA=""
.else
CONFIGURE_ARGS+=--with-svgalib=no
PLIST_SUB+=	SVGA="@comment "
.endif

.if defined(WITH_X11)
USE_XLIB=	yes
CONFIGURE_ARGS+=--with-x
PLIST_SUB+=	X11=""
.else
CONFIGURE_ARGS+=--without-x
PLIST_SUB+=	X11="@comment "
.endif

post-patch:
	@${FIND} ${WRKSRC} -type f -name Makefile.in -print0 | \
		${XARGS} -0 ${REINPLACE_CMD} -e \
		's|\($$(libdir)/\)@PACKAGE@|\1${PORTNAME}|'
	@${REINPLACE_CMD} -e 's|\($$libdir/\)$$PACKAGE|\1${PORTNAME}|' \
			${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT}.in
.if ${OSVERSION} < 500000
	@${REINPLACE_CMD} -e 's/%zu/%u/g' ${WRKSRC}/src/main.c
.endif
.for f in ${Q2F_BADMODS}
	@${REINPLACE_CMD} -i "" -e 's/${f}//' ${WRKSRC}/src/Makefile.in
.endfor

post-install:
.if !defined(NOPORTDOCS)
	${MKDIR} ${DOCSDIR}
	${INSTALL_DATA} ${WRKSRC}/docs/README.* ${WRKSRC}/docs/*.txt ${DOCSDIR}
.if defined(WITH_CTF)
	${MKDIR} ${DOCSDIR}/ctf
.for f in *.html *.gif *.jpg
	${INSTALL_DATA} ${WRKSRC}/docs/ctf/${f} ${DOCSDIR}/ctf
.endfor
.endif
.endif
	@${ECHO_CMD}; ${CAT} ${PKGMESSAGE}; ${ECHO_CMD}

.include <bsd.port.post.mk>