summaryrefslogtreecommitdiff
blob: 83ea43cc57d3378bd85883e3218879bdd048e436 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/alienarena/alienarena-20100726.ebuild,v 1.2 2010/09/10 10:48:08 fauli Exp $

EAPI=2
inherit eutils games

MY_PN=alienarena7_45
DESCRIPTION="Fast-paced multiplayer deathmatch game"
HOMEPAGE="http://red.planetarena.org/"
SRC_URI="http://icculus.org/alienarena/Files/${MY_PN}-Linux${PV}.zip"

LICENSE="GPL-2 free-noncomm"
SLOT="0"
KEYWORDS="~amd64 x86"
IUSE="dedicated opengl"

UIRDEPEND="media-libs/jpeg
	media-libs/openal
	media-libs/libvorbis
	virtual/glu
	virtual/opengl
	x11-libs/libXxf86dga
	x11-libs/libXxf86vm"
RDEPEND="opengl? ( ${UIRDEPEND} )
	!opengl? ( !dedicated? ( ${UIRDEPEND} ) )
	net-misc/curl"
UIDEPEND="x11-proto/xf86dgaproto
	x11-proto/xf86vidmodeproto"
DEPEND="${RDEPEND}
	opengl? ( ${UIDEPEND} )
	!opengl? ( !dedicated? ( ${UIDEPEND} ) )
	dev-util/pkgconfig
	app-arch/unzip"

S=${WORKDIR}/${MY_PN}/source

src_prepare() {
	rm -f ../*/*.so
	sed -i \
		-e 's:\($(SHLIBLDFLAGS)\):$(LDFLAGS) \1:' \
		Makefile \
		|| die "sed failed"
}

src_compile() {
	emake \
		ARCH="unknown" \
		OSTYPE="linux" \
		OPTIMIZED_CFLAGS=no \
		WITH_DATADIR=yes \
		WITH_LIBDIR=yes \
		DATADIR="${GAMES_DATADIR}"/${PN} \
		LIBDIR="$(games_get_libdir)"/${PN} \
		$(use opengl && ! use dedicated && echo BUILD=CLIENT) \
		$(! use opengl && use dedicated && echo BUILD=DEDICATED) \
		$(use opengl && use dedicated && echo BUILD=ALL) \
		$(use opengl || use dedicated || echo BUILD=CLIENT) \
		|| die "emake failed"
}

src_install() {
	cd release
	exeinto "$(games_get_libdir)"/${PN}
	doexe game.so || die "doexe failed"
	dosym . "$(games_get_libdir)"/${PN}/arena
	dosym . "$(games_get_libdir)"/${PN}/data1

	if use opengl || ! use dedicated ; then
		newgamesbin crx ${PN} || die "newgamesbin crx failed"
		make_desktop_entry ${PN} "Alien Arena"
	fi

	if use dedicated ; then
		newgamesbin crded ${PN}-ded || die "newgamesbin crded failed"
	fi

	cd "${WORKDIR}"/${MY_PN}
	insinto "${GAMES_DATADIR}"/${PN}
	doins -r arena botinfo data1 || die "doins failed"
	newicon aa.png ${PN}.png || die "newicon failed"
	dodoc docs/README.txt

	prepgamesdirs
}