mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-07 06:40:06 +00:00
9385619205
- Use enet from ports collection rather than from cube distribution to benefit from local patches [1] - Fix OPTIONS checking to allow BATCH building - Fix PLIST_SUB to generate correct pkg-plist when SERVER or CLIENT not selected - Add KNOB to build with optimized CFLAGS, also guarantee CFLAGS safety - CXX safety - Guarantee permissions safety by using INSTALL instead of CP [2] - Bump up PORTREVISION because of [1] and [2] Approved by: sem (mentor)
92 lines
2.3 KiB
Makefile
92 lines
2.3 KiB
Makefile
# New ports collection makefile for: cube
|
|
# Date created: 17 October 2002
|
|
# Whom: Arjan van Leeuwen
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
PORTNAME= cube
|
|
PORTVERSION= 2005.08.29
|
|
PORTREVISION= 2
|
|
CATEGORIES= games
|
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
|
MASTER_SITE_SUBDIR= ${PORTNAME}
|
|
DISTFILES= ${CUBE_DATA} ${CUBE_SRC}
|
|
EXTRACT_ONLY= ${CUBE_SRC}
|
|
|
|
MAINTAINER= ports@FreeBSD.org
|
|
COMMENT= An OpenGL 3D First Person Shooter game
|
|
|
|
BUILD_DEPENDS= ${LOCALBASE}/lib/libenet.a:${PORTSDIR}/net/enet
|
|
|
|
USE_ZIP= yes
|
|
USE_DOS2UNIX= yes
|
|
USE_GMAKE= yes
|
|
WRKSRC= ${WRKDIR}/${PORTNAME}_source/src
|
|
MAKE_ENV+= CXX="${CXX}"
|
|
CFLAGS+= -fsigned-char
|
|
ALL_TARGET= #empty
|
|
|
|
OPTIONS= CLIENT "Build client" on \
|
|
DEDICATED "Build dedicated server" on \
|
|
OPT "Optimized CFLAGS" off
|
|
|
|
SUB_FILES= cube_client cube_server
|
|
|
|
CUBE_DATA= ${PORTNAME}_${PORTVERSION:S/./_/g}_unix.tar.gz
|
|
CUBE_SRC= ${PORTNAME}_${PORTVERSION:S/./_/g}_src.zip
|
|
|
|
# XXX: exists untill it will be committed to bsd.port.mk
|
|
COPYTREE_SHARE= ${SH} -c '(${FIND} -d $$0 $$2 | ${CPIO} -dumpl $$1 >/dev/null \
|
|
2>&1) && \
|
|
${CHOWN} -R ${SHAREOWN}:${SHAREGRP} $$1 && \
|
|
${FIND} $$1/ -type d -exec ${CHMOD} 755 {} \; && \
|
|
${FIND} $$1/ -type f -exec ${CHMOD} ${SHAREMODE} {} \;' --
|
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
.if defined(WITHOUT_CLIENT) && defined(WITHOUT_DEDICATED)
|
|
IGNORE= needs at least one executable (CLIENT and DEDICATED)
|
|
.endif
|
|
|
|
.if !defined(WITHOUT_CLIENT)
|
|
USE_GL= yes
|
|
USE_SDL= image mixer sdl
|
|
ALL_TARGET+= client
|
|
PLIST_SUB+= CLIENT=""
|
|
CUBE_BIN+= client
|
|
.else
|
|
PLIST_SUB+= CLIENT="@comment "
|
|
.endif
|
|
|
|
.if !defined(WITHOUT_DEDICATED)
|
|
ALL_TARGET+= server
|
|
PLIST_SUB+= DEDICATED=""
|
|
CUBE_BIN+= server
|
|
.else
|
|
PLIST_SUB+= DEDICATED="@comment "
|
|
.endif
|
|
|
|
.if defined(WITH_OPT)
|
|
CFLAGS+= -O3 -fomit-frame-pointer
|
|
.endif
|
|
|
|
post-extract:
|
|
@${TAR} zxf ${DISTDIR}/${CUBE_DATA} -C ${WRKDIR}
|
|
|
|
do-install:
|
|
.for f in ${CUBE_BIN}
|
|
${INSTALL_SCRIPT} ${WRKDIR}/cube_${f} ${PREFIX}/bin
|
|
${INSTALL_PROGRAM} ${WRKSRC}/cube_${f} ${PREFIX}/libexec
|
|
.endfor
|
|
${MKDIR} ${DATADIR}
|
|
@(cd ${WRKDIR}/cube && ${COPYTREE_SHARE} "data packages" ${DATADIR}/)
|
|
${INSTALL_DATA} ${WRKDIR}/cube/autoexec.cfg ${DATADIR}
|
|
.if !defined(NOPORTDOCS)
|
|
${MKDIR} ${DOCSDIR}
|
|
${INSTALL_DATA} ${WRKDIR}/cube/readme.html ${DOCSDIR}
|
|
@(cd ${WRKDIR}/cube/docs && ${COPYTREE_SHARE} \* ${DOCSDIR}/)
|
|
.endif
|
|
|
|
.include <bsd.port.post.mk>
|