# New ports collection makefile for: teewars # Date created: 17 Feb 2008 # Whom: Dmitry Marakasov # # $FreeBSD$ # PORTNAME= teewars PORTVERSION= 0.3.4 CATEGORIES= games MASTER_SITES= http://www.teewars.com/files/ \ http://www.amdmi3.ru/distfiles/ DISTNAME= ${PORTNAME}-${PORTVERSION}-src DISTFILES= ${DISTNAME}${EXTRACT_SUFX} bam${EXTRACT_SUFX} MAINTAINER= amdmi3@amdmi3.ru COMMENT= Platform game featuring buggers equipped with weapons USE_ZIP= yes USE_PYTHON_BUILD= yes BAM= ${WRKDIR}/bam.bin BAM_TARGET= release OPTIONS= TEEWARS_SERVER_ONLY "Build dedicated server only" off .include .if defined(WITH_TEEWARS_SERVER_ONLY) BAM_TARGET= server_release PLIST_SUB+= CLIENT="@comment " .else LIB_DEPENDS+= portaudio.2:${PORTSDIR}/audio/portaudio2 USE_GL= yes PLIST_SUB+= CLIENT="" .endif post-patch: @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/default.bam @${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|g' ${WRKSRC}/default.bam @${REINPLACE_CMD} -e 's|\(s.cc.c_compiler = \).*|\1"${CC}"|; \ s|\(s.cc.cxx_compiler = \).*|\1"${CXX}"|; \ s|\(s.cc.flags = \).*|\1"${CFLAGS}"|; \ s|\(s.linker.linker = \).*|\1"${CXX}"|' \ ${WRKDIR}/bam/src/base.bam @${FIND} ${WRKSRC}/src -name "*.c" -o -name "*.cpp" | \ ${XARGS} ${REINPLACE_CMD} -e 's|"data/|"${DATADIR}/|g' @${REINPLACE_CMD} -e 's|"data/|"${DATADIR}/|g' ${WRKSRC}/datasrc/* # build bam executable - teewars own build system pre-build: cd ${WRKDIR}/bam && ${CC} ${CFLAGS} src/tools/txt2c.c -o src/tools/txt2c cd ${WRKDIR}/bam && src/tools/txt2c < src/base.bam > src/internal_base.h cd ${WRKDIR}/bam && ${CC} ${CFLAGS} src/lua/src/*.c src/lua/src/lib/*.c \ src/*.c -Isrc/lua/include -o ${BAM} -lm ${PTHREAD_LIBS} # build teewars do-build: cd ${WRKSRC} && ${BAM} ${BAM_TARGET} do-install: .if !defined(WITH_TEEWARS_SERVER_ONLY) ${INSTALL_PROGRAM} ${WRKSRC}/teewars ${PREFIX}/bin .endif ${INSTALL_PROGRAM} ${WRKSRC}/teewars_srv ${PREFIX}/bin ${MKDIR} ${DATADIR} @cd ${WRKSRC}/data && ${COPYTREE_SHARE} . ${DATADIR}/ .include