summaryrefslogtreecommitdiff
path: root/games/pvpgn/Makefile
blob: 42eb93dad784f85af7481c843c1af751f4dab86a (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Created by: mek
# $FreeBSD$

PORTNAME=	pvpgn
PORTVERSION=	1.8.5
CATEGORIES=	games
MASTER_SITES=	${MASTER_SITE_BERLIOS}
MASTER_SITE_SUBDIR=	pvpgn
DISTFILES=	${EXTRACT_ONLY} pvpgn-support-1.2.tar.gz
DIST_SUBDIR=	pvpgn
EXTRACT_ONLY=	${DISTNAME}${EXTRACT_SUFX}

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Free Blizzard Battle.net emulation software

PKGINSTALL?=	${WRKDIR}/pkg-install
PKGDEINSTALL?=	${WRKDIR}/pkg-deinstall
USES=		gmake tar:bzip2
SED_SCRIPT=	-e 's|%%PREFIX%%|${PREFIX}|g'

USERS=		bnetd
GROUPS=		${USERS}

RC_DIR=		${PREFIX}/etc/rc.d
RC_SUFX=	.sh
SED_SCRIPT+=	-e 's|%%RC_DIR%%|${RC_DIR}|g' \
		-e 's|%%RC_SUFX%%|${RC_SUFX}|g'

PLIST_SUB+=	RC_SUFX=${RC_SUFX}

WRKSRC=		${WRKDIR}/${DISTNAME}/src

GNU_CONFIGURE=	yes
CONFIGURE_ARGS=	--sysconfdir=${PREFIX}/etc/pvpgn \
		--localstatedir=${DATADIR} \
		--with-libraries=${LOCALBASE}/lib

USE_RC_SUBR=	bnetd

MAN1=		bnbot.1 bnchat.1 bnetd.1 bnftp.1 bni2tga.1 bnibuild.1 \
		bniextract.1 bnilist.1 bnpass.1 bnstat.1 bntrackd.1 tgainfo.1
MAN5=		bnetd.conf.5 bntext.5

OPTIONS_DEFINE=	MYSQL PGSQL SQLITE3 D2
D2_DESC=	Diablo II server (D2CS/D2DBS)

OPTIONS_DEFAULT=	D2

NO_STAGE=	yes
.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MMYSQL}
USE_MYSQL=	yes
CONFIGURE_ARGS+=--with-mysql
.endif

.if ${PORT_OPTIONS:MPGSQL}
USE_PGSQL=	yes
CONFIGURE_ARGS+=--with-pgsql
.endif

.if ${PORT_OPTIONS:MSQLITE3}
USE_SQLITE=	3
CONFIGURE_ARGS+=--with-sqlite3
.endif

.if ${PORT_OPTIONS:MD2}
PLIST_SUB+=	WITH_D2=""
.else
CONFIGURE_ARGS+=	--disable-d2cs --disable-d2dbs
PLIST_SUB+=	WITH_D2="@comment "
.endif

## support files

SUPPORT_SUFFX=	.tar.gz
SUPPORT_FILES=	pvpgn-support-1.2

post-extract:
	@${MKDIR} ${WRKSRC}/${SUPPORT_FILES}
	@${TAR} -C ${WRKSRC} -xzf ${DISTDIR}/${DIST_SUBDIR}/${SUPPORT_FILES}${SUPPORT_SUFFX}

post-build:
	@${SED} "s|%%PVPGN_DIR%%|${DATADIR}|g" ${PKGDIR}/pkg-install > ${WRKDIR}/pkg-install
	@${SED} "s|%%PVPGN_DIR%%|${DATADIR}|g" ${PKGDIR}/pkg-deinstall > ${WRKDIR}/pkg-deinstall

post-install:
	@${ECHO_MSG} ">>>   installing support files ..."
.for i in IX86ver1.mpq PMACver1.mpq XMACver1.mpq bnserver-D2DV.ini \
	bnserver-D2XP.ini bnserver-WAR3.ini bnserver.ini icons-WAR3.bni \
	icons.bni icons_STAR.bni ver-ix86-1.mpq

	${INSTALL_DATA} ${WRKSRC}/${SUPPORT_FILES}/${i} ${DATADIR}/files
.endfor

## Additional documentation

.if ${PORT_OPTIONS:MDOCS}
	${MKDIR} ${DOCSDIR}
.for i in INSTALL.unix PORTS README.fdwatch README.storage bnmotd.txt
	${INSTALL_MAN} ${WRKSRC}/../docs/${i} ${DOCSDIR}
.endfor
.endif

	@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL

.include <bsd.port.mk>