aboutsummaryrefslogtreecommitdiffstats
path: root/games/quetoo/Makefile
blob: 4016272faf8ee033644e6a32e829843aa355039f (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
# New ports collection makefile for:    Quetoo
# Date created:             10 Apr 2006
# Whom:                 Alexey Dokuchaev <danfe@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   quetoo
PORTVERSION=    0.3.4
CATEGORIES= games
MASTER_SITES=   http://jdolan.dyndns.org/jaydolan/files/

MAINTAINER= danfe@FreeBSD.org
COMMENT=    Fast, stable, compatible, and secure Quake II client

USE_AUTOTOOLS=  autoconf:259
USE_BZIP2=  yes
USE_SDL=    sdl
USE_GL=     yes
GNU_CONFIGURE=  yes
CONFIGURE_ENV=  CPPFLAGS="-I${LOCALBASE}/include -I${X11BASE}/include \
        ${PTHREAD_CFLAGS}" LDFLAGS="-L${LOCALBASE}/lib \
        -L${X11BASE}/lib ${PTHREAD_LIBS}" \
        OPENGL_CFLAGS="-I${X11BASE}/include" \
        OPENGL_LIBS="-L${X11BASE}/lib" \

LIBDIR=     ${PREFIX}/lib/${PORTNAME}
PLIST_SUB+= LIBDIR="${LIBDIR:S/${PREFIX}\///}"

OPTIONS=    QMASS       "Build QMass deathmatch mod"        on \
        MYSQL       "Enable MySQL frag logging"     off \
        OPTIMIZED_CFLAGS "Enable extra optimization options"    off

.include <bsd.port.pre.mk>

.if !defined(WITHOUT_QMASS)
Q2GAMES=    baseq2 ctf qmass
CONFIGURE_ARGS+=    --enable-qmass
PLIST_SUB+= QMASS=""
.else
Q2GAMES=    baseq2 ctf
PLIST_SUB+= QMASS="@comment "
.endif

.if defined(WITH_MYSQL)
USE_MYSQL=  yes
CONFIGURE_ARGS+=    --with-mysql
CONFIGURE_ENV+= MYSQL_LIBS="-L${LOCALBASE}/lib/mysql -lmysqlclient" \
        MYSQL_CFLAGS="-I${LOCALBASE}/include"
.else
CONFIGURE_ARGS+=    --without-mysql
.endif

.if !defined(WITH_OPTIMIZED_CFLAGS)
CONFIGURE_ARGS+=    --disable-opt --disable-sse
.endif

post-extract: .SILENT
    ${REINPLACE_CMD} -E 's,^(eval PKGDATADIR=).*$$,\1"${Q2DIR}",' \
        ${WRKSRC}/configure
    ${REINPLACE_CMD} -E 's,-ldl,,' ${WRKSRC}/src/Makefile.in
    ${REINPLACE_CMD} 's,alsa,sdl,' ${WRKSRC}/src/snd_dma.c

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/src/quetoo ${PREFIX}/bin/quetoo
    @${MKDIR} ${LIBDIR}
    ${INSTALL_PROGRAM} ${WRKSRC}/src/.libs/*.so ${LIBDIR}
.for g in ${Q2GAMES}
    @${MKDIR} ${LIBDIR}/${g}
    ${INSTALL_PROGRAM} ${WRKSRC}/src/${g}/.libs/game.so ${LIBDIR}/${g}
.endfor
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
.   if !defined(WITHOUT_QMASS)
    ${INSTALL_DATA} ${WRKSRC}/src/qmass/README ${DOCSDIR}/qmass-README
.   endif
.endif

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

.include <bsd.port.post.mk>