summaryrefslogtreecommitdiff
path: root/games/crossfire/Makefile
blob: b45719ff36a9e77e818737a918d0ed9693e435de (plain)
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
# $NetBSD: Makefile,v 1.4 1999/04/05 17:23:02 mycroft Exp $
#

DISTNAME=	crossfire-0.94.2
CATEGORIES=	games x11
MASTER_SITES=	ftp://ftp.ifi.uio.no/pub/crossfire/
DISTFILES=	${CF_SRC} ${CF_MAPS} ${CF_SOUND}

MAINTAINER=	root@garbled.net
HOMEPAGE=	http://www.fak14.uni-muenchen.de/~h729ihqu/games/crossfire.html

DEPENDS+=	rplay-3.2.0b6:../../audio/rplay
DEPENDS+=	xpm-3.4k:../../graphics/xpm

EXTRACT_ONLY=	${CF_SRC}

CF_SRC=		crossfire-0.94.2.tar.gz
CF_MAPS=	crossfire-0.94.2.maps.tar.gz
CF_SOUND=	crossfire-0.92.7.sounds.tar.gz

USE_IMAKE=	yes
USE_PERL5=	yes
SCRIPTS_ENV+=	${SCRIPTSDIR}

INSTALL_FILE=	${WRKDIR}/.INSTALL
DEINSTALL_FILE=	${WRKDIR}/.DEINSTALL

post-patch:
	@${MV} ${WRKSRC}/config/crosssite.def \
		${WRKSRC}/config/crosssite.def-orig
	@${SED} -e 's|@X11BASE@|${X11BASE}|g' \
		-e 's|@LOCALBASE@|${LOCALBASE}|g' \
		${WRKSRC}/config/crosssite.def-orig \
		> ${WRKSRC}/config/crosssite.def
	@${MV} ${WRKSRC}/lib/sounds ${WRKSRC}/lib/sound_list
	@${SED} -e 's|XXXLOCALBASEXXX|${LOCALBASE}|' \
		-e 's|XXXDBXXX|${PKG_DBDIR}/${DISTNAME}|' \
		${PKGDIR}/deinstall > ${DEINSTALL_FILE}
	@${SED} -e 's|XXXLOCALBASEXXX|${LOCALBASE}|' \
		-e 's|XXXX11BASEXXX|${X11BASE}|' \
		${PKGDIR}/install > ${INSTALL_FILE}

post-install:
	cd ${X11BASE}/lib/crossfire && \
	    ${GZCAT} ${DISTDIR}/${CF_MAPS} | ${GTAR} xmf -
	cd ${X11BASE}/lib/crossfire && \
	    ${GZCAT} ${DISTDIR}/${CF_SOUND} | ${GTAR} xmf -
	@/usr/bin/find ${X11BASE}/lib/crossfire/sounds -name \*.au -type f \
		> ${WRKDIR}/.RPLAY
	@${CAT} ${WRKDIR}/.RPLAY >> ${LOCALBASE}/etc/rplay.conf
	@${CAT} ${WRKDIR}/.RPLAY >> ${DEINSTALL_FILE}
	@${CAT} ${WRKDIR}/.RPLAY >> ${INSTALL_FILE}
	@${ECHO} "EOF" >> ${INSTALL_FILE}
	@chown root:games ${X11BASE}/bin/crossfire
	@chmod 2755 ${X11BASE}/bin/crossfire
	@chown -R root:games ${X11BASE}/lib/crossfire
	@chmod 775 ${X11BASE}/lib/crossfire/players
	@chmod 775 ${X11BASE}/lib/crossfire
	@chmod 664 ${X11BASE}/lib/crossfire/highscore

pre-clean:
	@${RM} -f ${DEINSTALL_FILE} ${INSTALL_FILE} ${WRKDIR}/.RPLAY

.include "../../mk/bsd.pkg.mk"