summaryrefslogtreecommitdiff
blob: 25c611380fd473d753b222ef4778adf96f0a4a0b (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
86
87
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/tremulous-bin/tremulous-bin-1.1.0.ebuild,v 1.5 2008/02/29 19:19:05 carlo Exp $

inherit eutils games

MY_PN=${PN%-bin}
MY_P=${MY_PN}-${PV}

DESCRIPTION="Team-based aliens vs humans FPS with buildable structures"
HOMEPAGE="http://tremulous.net/"
SRC_URI="mirror://sourceforge/${MY_PN}/${MY_P}.zip
	http://0day.icculus.org/mirrors/${MY_PN}/${MY_P}.zip
	ftp://ftp.wireplay.co.uk/pub/quake3arena/mods/${MY_PN}/${MY_P}.zip"

LICENSE="GPL-2
	CCPL-Attribution-ShareAlike-2.5"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="dedicated sdl"

UIDEPEND="virtual/opengl
	x86? (
		media-libs/alsa-lib
		media-libs/openal
		media-libs/libogg
		media-libs/libvorbis
		media-libs/libsdl
		x11-libs/libX11
		x11-libs/libXau
		x11-libs/libXdmcp
		x11-libs/libXext
		x11-libs/libXxf86dga
		x11-libs/libXxf86vm )
	amd64? (
		app-emulation/emul-linux-x86-sdl
		app-emulation/emul-linux-x86-medialibs )"
RDEPEND="sdl? ( ${UIDEPEND} )
	!sdl? ( !dedicated? ( ${UIDEPEND} ) )
	sys-libs/glibc
	!games-fps/tremulous"
DEPEND="${RDEPEND}
	app-arch/unzip"

S=${WORKDIR}/${MY_PN}
dir=${GAMES_PREFIX_OPT}/${MY_PN}

install_client() {
	if use sdl || ! use dedicated ; then
		return 0
	fi
	return 1
}

src_install() {
	insinto "${dir}"
	doins -r base || die "doins -r base failed"
	doins ChangeLog COPYING manual.pdf || die "doins failed"

	# The executables must be in the same tree as the game data
	exeinto "${dir}"
	if install_client ; then
		# Install client
		newexe ${MY_PN}.x86 ${MY_PN}.bin \
			|| die "newexe ${MY_PN}.x86 failed"
		doicon ${MY_PN}.xpm || die "doicon failed"
		games_make_wrapper ${MY_PN} ./${MY_PN}.bin "${dir}"
		make_desktop_entry ${MY_PN} "Tremulous" ${MY_PN}
	fi

	if use dedicated ; then
		# Install server
		newexe tremded.x86 ${MY_PN}-ded.bin \
			|| die "newexe tremded.x86 failed"
		games_make_wrapper ${MY_PN}-ded ./${MY_PN}-ded.bin "${dir}"
	fi

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst

	elog "Read instructions:  http://tremulous.net/manual/"
	elog "or:  ${dir}/manual.pdf"
	echo
}