]> Pileus Git - ~andy/sunrise/blob - games-fps/prey/prey-20090219.ebuild
dev-util/qshaderedit: Properly fix qt deps
[~andy/sunrise] / games-fps / prey / prey-20090219.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils games
6
7 DESCRIPTION="First person shooter from 3D Realms"
8 HOMEPAGE="http://icculus.org/prey/ http://www.3drealms.com/prey/"
9 UPSTREAM_PV=${PV:4:2}${PV:6}${PV::4}
10 SRC_URI="http://icculus.org/prey/downloads/prey-installer-${UPSTREAM_PV}.bin"
11
12 LICENSE="PREY"
13 SLOT="0"
14 KEYWORDS="~amd64"
15 IUSE="cdinstall dedicated openal opengl"
16 PROPERTIES="interactive"
17
18 # mirror restriction might be needed as well
19 RESTRICT="strip"
20
21 UIDEPEND="virtual/opengl
22         openal? ( x86? ( media-libs/openal )
23                 amd64? ( app-emulation/emul-linux-x86-sdl ) )"
24 DEPEND="app-arch/unzip"
25 RDEPEND="
26         opengl? ( ${UIDEPEND} )
27         !dedicated? ( !opengl? ( ${UIDEPEND} ) )
28         cdinstall? ( games-fps/prey-data )"
29
30 S=${WORKDIR}
31
32 GAMES_CHECK_LICENSE="yes"
33 dir=${GAMES_PREFIX_OPT}/${PN}
34 Ddir=${D}/${dir}
35
36 QA_TEXTRELS="${dir:1}/pb/pbcl.so
37         ${dir:1}/pb/pbag.so
38         ${dir:1}/pb/pbsv.so"
39
40 pkg_setup() {
41         games_pkg_setup
42
43         # This is a binary x86 package => ABI=x86
44         has_multilib_profile && ABI="x86"
45 }
46
47 src_unpack() {
48         unzip "${DISTDIR}/prey-installer-${UPSTREAM_PV}.bin"
49 }
50
51 src_install() {
52         # installation of files that goes to ${dir}
53         insinto "${dir}"
54         exeinto "${dir}"
55
56         # >common (both dedicated and graphical client) files
57         doins -r data/punkbuster-linux-x86/pb || die "doins punkbuster"
58
59         # >graphical game client files
60         if use opengl || ! use dedicated ; then
61                 doexe data/prey-linux-x86/prey{,.x86} \
62                         data/prey-linux-x86/libNvidiaVidMemTest.so || \
63                         die "doexe client executables"
64
65                 dosym "/usr/$(get_libdir)/libSDL-1.2.so.0" "${dir}" || \
66                         die "dosym libSDL"
67
68                 if use openal; then
69                         dosym "/usr/$(get_libdir)/libopenal.so" "${dir}/openal.so" || \
70                                 die "dosym libopenal"
71                 fi
72
73                 newicon data/prey-linux-data/prey.png ${PN}.png
74
75                 games_make_wrapper ${PN} ./prey "${dir}" "${dir}"
76                 make_desktop_entry ${PN} "Prey"
77         fi
78
79         # >dedicated server files
80         if use dedicated ; then
81                 doexe data/prey-linux-x86/preyded{,.x86} || \
82                         die "doexe dedicated executables"
83
84                 games_make_wrapper ${PN}-ded ./preyded "${dir}" "${dir}"
85         fi
86
87         # installation of files that goes to ${dir}/base
88         insinto "${dir}/base"
89         exeinto "${dir}/base"
90         doexe data/prey-linux-x86/base/gamex86.so || die "doexe base/gamex86.so"
91         doins -r data/prey-linux-data/base/* || die "doins data"
92
93         # documentation files
94         dodoc data/prey_readme.txt || die "dodoc readme"
95
96         prepgamesdirs
97 }
98
99 pkg_postinst() {
100         games_pkg_postinst
101
102         if ! use cdinstall ; then
103                 elog "You need to copy pak000.pk4 through pak004.pk4 from either your"
104                 elog "installation media or your hard drive to ${dir}/base before"
105                 elog "running the game."
106                 echo
107         fi
108 }