aboutsummaryrefslogtreecommitdiffstats
path: root/games/quake2-relay/Makefile
blob: 7f4ecc40f594d5b3939028f84bc84676eb7f215a (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
# New ports collection makefile for:    Q2 Relay
# Date created:             23 Mar 2006
# Whom:                 Alexey Dokuchaev <danfe@FreeBSD.org>
#
# $FreeBSD$
#

PORTNAME=   relay
PORTVERSION=    0.4
CATEGORIES= games
MASTER_SITES=   ${MASTER_SITE_LOCAL} http://freebsd.nsu.ru/distfiles/
MASTER_SITE_SUBDIR= danfe
PKGNAMEPREFIX=  ${Q2PKGNAMEPREFIX}
DISTNAME=   relay-${PORTVERSION}.src

MAINTAINER= danfe@FreeBSD.org
COMMENT=    Quake II multi-view demo recording facility

USE_GMAKE=  yes
MAKE_ARGS=  MODE=release OBJ_DIR=. OUT_DIR=. Q2MODULE=game.so \
        QUAKE2_DIR="${Q2DIR}" BIN_DIR="${PREFIX}/bin" \
        CC="${CC}" CFLAGS="${CFLAGS}"

WRKSRC=     ${WRKDIR}/relay-${PORTVERSION}

PLIST_FILES=    bin/democonv bin/dm2server \
        %%Q2DIR%%/release/game.so \
        %%Q2DIR%%/proxy/relay/game.so \
        %%Q2DIR%%/proxy/replay/game.so
PLIST_DIRS= %%Q2DIR%%/proxy/replay %%Q2DIR%%/proxy/relay \
        %%Q2DIR%%/proxy %%Q2DIR%%/release
PORTDOCS=   FAQ README

.include <bsd.port.pre.mk>

.if ${ARCH} == "amd64" || ${ARCH} == "ia64"
CFLAGS+=    -fPIC
.endif

post-patch: .SILENT
    ${REINPLACE_CMD} -e 's/-ldl// ; /^include/d ; \
        s/cp -p/${INSTALL_PROGRAM}/' ${WRKSRC}/Makefile
    ${REINPLACE_CMD} -e '/random/d' ${WRKSRC}/replay/rp_local.h
    ${REINPLACE_CMD} -e 's,<malloc\.h>,<stdlib\.h>,' \
        ${WRKSRC}/common/mem.c
    cd ${WRKSRC}/common && ${SH} -c 'for i in *.h; do \
        ${ECHO_CMD} >> $${i}; done'
    # Reorganize #include's (use /bin/ed to avoid a patch)
    ${ECHO_CMD} -e '35t30\n36d\nwq' | ${ED} -s ${WRKSRC}/common/net.h
    ${ECHO_CMD} -e '9t7\n10d\nwq' | ${ED} -s ${WRKSRC}/common/net.c

post-install:
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/FAQ ${WRKSRC}/README ${DOCSDIR}
.endif

ED?=    /bin/ed

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

.include <bsd.port.post.mk>