summaryrefslogtreecommitdiff
blob: 796769ddee443af516f758d8f89e251b0d4b249b (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/americas-army/americas-army-250.ebuild,v 1.17 2007/08/20 22:34:00 mr_bones_ Exp $

inherit eutils games

DED_PV="0.2"
DED_FILE="${PN}-all-${DED_PV}.tar.bz2"
MY_P="armyops${PV}-linux.run"

DESCRIPTION="military simulations by the U.S. Army to provide civilians with insights on soldiering"
HOMEPAGE="http://www.americasarmy.com/"
SRC_URI="mirror://3dgamers/${PN/-/}/${MY_P}
	dedicated? (
		http://dev.gentoo.org/~wolf31o2/sources/dump/${DED_FILE}
		mirror://gentoo/${DED_FILE} )"

LICENSE="Army-EULA"
SLOT="0"
KEYWORDS="amd64 x86"
RESTRICT="mirror strip"
IUSE="dedicated opengl"

UIDEPEND="virtual/opengl
		amd64? (
			app-emulation/emul-linux-x86-xlibs
			|| (
				>=app-emulation/emul-linux-x86-xlibs-7.0
				x11-drivers/nvidia-drivers
				>=x11-drivers/ati-drivers-8.8.25-r1 ) )
		x86? (
			x11-libs/libXext
			x11-libs/libX11 )"
RDEPEND="sys-libs/glibc
	opengl? ( ${UIDEPEND} )
	!opengl? ( !dedicated? ( ${UIDEPEND} ) )
	amd64? ( app-emulation/emul-linux-x86-compat )
	x86? ( =virtual/libstdc++-3.3 )"

S=${WORKDIR}

pkg_setup() {
	games_pkg_setup
	einfo "The installed game takes about 1.6GB of space when installed and"
	einfo "2.4GB of space in ${PORTAGE_TMPDIR} to build!"
	echo
}

src_unpack() {
	unpack_makeself "${DISTDIR}/${MY_P}" || die "unpacking game"
	unpack ./setupstuff.tar.gz
	if use dedicated ; then
		unpack "${DED_FILE}"
	fi
}

src_install() {
	local dir=${GAMES_PREFIX_OPT}/${PN}
	local Ddir=${D}/${dir}

	einfo "This will take a while... go get a pizza or something."

	dodir "${dir}"
	tar -jxf armyops${PV}.tar.bz2 -C "${Ddir}"/ || die "armyops untar failed"
	tar -jxf binaries.tar.bz2 -C "${Ddir}"/ || die "binaries untar failed"

	dodoc README.linux
	insinto "${dir}"
	doins ArmyOps.xpm README.linux ArmyOps${PV}_EULA.txt || die "doins failed"
	newicon ArmyOps.xpm armyops.xpm || die "newicon failed"
	exeinto "${dir}"
	doexe bin/armyops || die "doexe failed"
	fperms ug+x "${dir}"/System/pb/pbweb.x86

	if use dedicated ; then
		newinitd "${S}"/armyops-ded.rc armyops-ded || die
		newconfd "${S}"/armyops-ded.conf.d armyops-ded || die
		games_make_wrapper armyops-ded ./server-bin "${dir}"/System
	fi

	if use opengl || ! use dedicated ; then
		games_make_wrapper armyops ./armyops "${dir}" "${dir}"
		make_desktop_entry armyops "America's Army" armyops.xpm
	fi

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst

	if use dedicated ; then
		elog "To start a dedicated server, run:"
		elog "   /etc/init.d/armyops-ded start"
		echo
	fi
	if use opengl || ! use dedicated ; then
		elog "To play the game, run:  armyops"
		echo
	fi
}