summaryrefslogtreecommitdiff
blob: b090ff66288a5020e892a3244b07ba499ced7418 (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
102
103
104
# Copyright 1999-2006 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.12 2006/10/05 11:53:08 wolf31o2 Exp $

inherit eutils games

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="http://treefort.icculus.org/armyops/${MY_P}
	http://0day.icculus.org/armyops/${MY_P}
	mirror://3dgamers/${PN/-/}/${MY_P}
	dedicated? (
		http://dev.gentoo.org/~wolf31o2/sources/dump/${PN}-all-0.1.tar.bz2
		mirror://gentoo/${PN}-all-0.1.tar.bz2 )"

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

IUSE="opengl dedicated"

DEPEND="app-arch/unzip"

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

S=${WORKDIR}
dir=${GAMES_PREFIX_OPT}/${PN}
Ddir=${D}/${dir}

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

src_unpack() {
	unpack_makeself ${DISTDIR}/${MY_P} || die "unpacking game"
	tar -zxf setupstuff.tar.gz || die
	if use dedicated; then
		unpack ${PN}-all-0.1.tar.bz2 || die
	fi
}

src_install() {
	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 "doins 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
		newconfd ${S}/armyops-ded.conf. armyops-ded
		games_make_wrapper armyops-ded ./server-bin ${dir}/System
	fi

	games_make_wrapper armyops ./armyops "${dir}" "${dir}"

	prepgamesdirs
	make_desktop_entry armyops "America's Army" armyops.xpm
}

pkg_postinst() {
	games_pkg_postinst
	if use dedicated; then
		einfo "To start a dedicated server, run"
		einfo "	/etc/init.d/armyops-ded start"
		echo
	fi
	if use opengl; then
		einfo "To play the game run:"
		einfo " armyops"
		echo
	fi
}