*/*: [QA] Remove redundant `|| die` guards
[gentoo.git] / games-fps / ut2003-data / ut2003-data-2107.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 inherit eutils unpacker cdrom games
6
7 DESCRIPTION="Unreal Tournament 2003 - Sequel to the 1999 multi-player first-person shooter"
8 HOMEPAGE="http://www.unrealtournament2003.com/"
9 SRC_URI="http://download.factoryunreal.com/mirror/UT2003CrashFix.zip"
10
11 LICENSE="ut2003"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE=""
15 RESTRICT="strip"
16
17 RDEPEND=""
18 DEPEND="app-arch/unzip
19         games-util/uz2unpack"
20
21 S=${WORKDIR}
22
23 dir=${GAMES_PREFIX_OPT}/ut2003
24 Ddir=${D}/${dir}
25
26 pkg_setup() {
27         games_pkg_setup
28         ewarn "The installed game takes about 2.7GB of space!"
29 }
30
31 src_unpack() {
32         cdrom_get_cds System/Packages.md5 StaticMeshes/AWHardware.usx.uz2 \
33                 Extras/MayaPLE/Maya4PersonalLearningEditionEpic.exe
34         unzip "${DISTDIR}"/UT2003CrashFix.zip || die
35 }
36
37 src_install() {
38         insinto "${dir}"
39         # Disk 1
40         einfo "Copying files from Disk 1..."
41         doins -r "${CDROM_ROOT}"/{Animations,ForceFeedback,KarmaData,Maps,Sounds,Textures,Web}
42         insinto "${dir}"/System
43         doins -r "${CDROM_ROOT}"/System/{editorres,*.{bmp,dat,det,est,frt,ini,int,itt,md5,u,upl,url}}
44         insinto "${dir}"/Benchmark/Stuff
45         doins -r "${CDROM_ROOT}"/Benchmark/Stuff/*
46         cdrom_load_next_cd
47
48         # Disk 2
49         insinto "${dir}"
50         einfo "Copying files from Disk 2..."
51         doins -r "${CDROM_ROOT}"/{Music,Sounds,StaticMeshes,Textures}
52         cdrom_load_next_cd
53
54         # Disk 3
55         einfo "Copying files from Disk 3..."
56         doins -r "${CDROM_ROOT}"/Sounds
57
58         # TODO: move this to src_unpack, where it belongs
59         unpack_makeself "${CDROM_ROOT}"/linux_installer.sh || die
60         tar xf "${S}"/ut2003lnxbins.tar || die
61
62         # create empty files in Benchmark
63         for j in {CSVs,Logs,Results} ; do
64                 mkdir -p "${Ddir}"/Benchmark/${j} || die
65                 touch "${Ddir}"/Benchmark/${j}/DO_NOT_DELETE.ME || die
66         done
67
68         # Cleaning up our installation
69         rm "${Ddir}"/System/{Build,Def{ault,User},Manifest,UT2003,User}.ini || die
70         rm -f "${Ddir}"/System/{Core,Engine,Setup,UnrealGame,Window,XGame,XInterface,XWeapons}.{det,est,frt,int,itt,u} || die
71         rm -rf "${Ddir}"/Web/ServerAdmin || die
72         rm -f "${Ddir}"/System/{Editor,Fire,IpDrv,UnrealEd,Vehicles,XEffects,XPickups,XWebAdmin}.u || die
73         rm -f "${Ddir}"/System/{UWeb,XAdmin}.{int,u} || die
74         rm -f "${Ddir}"/System/GamePlay.{det,itt,u} || die
75         rm -f "${Ddir}"/System/XMaps.{det,est} "${Ddir}"/System/Xweapons.itt || die
76         rm -f "${Ddir}"/System/Manifest.int "${Ddir}"/System/Packages.md5 || die
77
78         # install extra help files
79         insinto "${dir}"/Help
80         doins "${S}"/Help/Unreal.bmp
81
82         # install Default and DefUser ini files
83         insinto "${dir}"/System
84         doins "${S}"/System/Def{ault,User}.ini
85
86         # install eula
87         insinto "${dir}"
88         doins "${S}"/eula/License.int
89
90         # copying extra/updater
91         doins -r "${S}"/{extras,updater}
92         rm -f "${Ddir}"/updater/update || die
93
94         # copy libraries
95         exeinto "${dir}"/System
96         doexe "${S}"/System/libSDL-1.2.so.0
97
98         # uncompressing files
99         einfo "Uncompressing files... this may take a while..."
100         for j in {Animations,Maps,Sounds,StaticMeshes,Textures} ; do
101                 games_ut_unpack "${Ddir}"/${j} || die "uncompressing files"
102         done
103
104         # installing documentation/icon
105         dodoc "${S}"/README.linux
106         newicon "${S}"/Unreal.xpm ut2003.xpm || die "copying icon"
107         doins "${S}"/README.linux "${S}"/Unreal.xpm
108         # copy ut2003/ucc
109         exeinto "${dir}"
110         doexe "${S}"/bin/ut2003 "${S}"/ucc
111
112         # Here we apply DrSiN's crash patch
113         cp "${S}"/CrashFix/System/crashfix.u "${Ddir}"/System
114
115         ed "${Ddir}"/System/Default.ini >/dev/null 2>&1 <<EOT
116 $
117 ?Engine.GameInfo?
118 a
119 AccessControlClass=crashfix.iaccesscontrolini
120 .
121 w
122 q
123 EOT
124
125         # Here we apply fix for bug #54726
126         sed -i -e "s:UplinkToGamespy=True:UplinkToGamespy=False:" \
127                 "${Ddir}"/System/Default.ini || die
128
129         # now, since these files are coming off a cd, the times/sizes/md5sums wont
130         # be different ... that means portage will try to unmerge some files (!)
131         # we run touch on ${D} so as to make sure portage doesnt do any such thing
132         find "${Ddir}" -exec touch '{}' + || die
133
134         prepgamesdirs
135 }