summaryrefslogtreecommitdiff
path: root/games/linux-nwnclient/Makefile
blob: bac03bbbce1d71e874376d2aea552cffb9467bc3 (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
# New ports collection makefile for:    linux_nwnclient
# Date created:         1 April 2003
# Whom:                 Erik Olson <erikolson@olsonexpress.com>
#
# $FreeBSD$
#

PORTNAME=	nwnclient
PORTVERSION=	1.68
CATEGORIES=	games linux
MASTER_SITES=	http://bioware.vo.llnwd.net/o1/neverwinternights/updates/linux/${PORTVERSION:S/.//}/ \
		http://nwdownloads.bioware.com/neverwinternights/linux/129/
PKGNAMEPREFIX=	linux-
DISTFILES=	nwclient129.tar.gz \
		English_linuxclient${PORTVERSION:S/.//}_orig.tar.gz

MAINTAINER=	sean-freebsd@farley.org
COMMENT=	Neverwinter Nights Linux (x86) Client

RUN_DEPENDS=	${LOCALBASE}/share/nwndata/NWNv129.txt:${PORTSDIR}/games/nwndata

.ifdef WITH_NVIDIA_GL
RUN_DEPENDS+=	${LINUXBASE}/usr/lib/libGL.so.1:${PORTSDIR}/x11/nvidia-driver \
		${LINUXBASE}/usr/X11R6/lib/libGLU.so.1:${PORTSDIR}/graphics/linux-libGLU
.else
RUN_DEPENDS+=	${LINUXBASE}/usr/X11R6/lib/libGL.so.1:${PORTSDIR}/graphics/linux_dri
.endif

NO_BUILD=	yes
ONLY_FOR_ARCHS=	i386
USE_LINUX=	yes
USE_LINUX_APPS=	sdl12 xorglibs
NWNDATADIR=	${LOCALBASE}/share/nwndata

PLIST_SUB+=	NWNVERSION="${PORTVERSION:S/.//}"

do-extract:
	${MKDIR} ${WRKSRC}
.for _distfile in ${DISTFILES}
	(cd ${WRKSRC} && ${EXTRACT_CMD} ${EXTRACT_BEFORE_ARGS} \
		${DISTDIR}/${_distfile} ${EXTRACT_AFTER_ARGS})
.endfor
	${RM} ${WRKSRC}/lib/libSDL* ${WRKSRC}/fixinstall ${WRKSRC}/nwn

do-configure:
	${SED} -e 's|%%NWNDATADIR%%|${NWNDATADIR}|' \
		-e 's|%%NWNCLIENTDIR%%|${DATADIR}|' \
		<${FILESDIR}/nwn.sh >${WRKDIR}/nwn

do-install:
	${MKDIR} ${DATADIR}
	(cd ${WRKSRC} && ${FIND} . -print | \
	    ${CPIO} -pdmuv -R${SHAREOWN}:${SHAREGRP} ${DATADIR})
	${LN} -s ${LINUXBASE}/usr/lib/libstdc++-2-libc6.1-1-2.9.0.so \
		${DATADIR}/lib/libstdc++-libc6.1-2.so.3
	${FIND} ${DATADIR} -type d -print0 | ${XARGS} -0 ${CHMOD} 0755
	${FIND} ${DATADIR} -type f -print0 | ${XARGS} -0 ${CHMOD} 0644
	(cd ${DATADIR} && ${CHMOD} 0755 dmclient nwmain nwserver)
	${INSTALL_SCRIPT} ${WRKDIR}/nwn ${PREFIX}/bin/

.include <bsd.port.mk>