summaryrefslogtreecommitdiff
blob: 12e9095c40124bb1cc72dc1e2d64adf865364d03 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/ut2004-data/ut2004-data-3186-r3.ebuild,v 1.1 2006/04/13 17:50:23 wolf31o2 Exp $

inherit games games-ut2k4mod

DESCRIPTION="Unreal Tournament 2004 - This is the data portion of UT2004"
HOMEPAGE="http://www.unrealtournament2004.com/"
SRC_URI=""

LICENSE="ut2003"
SLOT="0"
KEYWORDS="~amd64 ~x86"
RESTRICT="strip"
IUSE=""

DEPEND="games-util/uz2unpack"

S=${WORKDIR}

GAMES_LICENSE_CHECK="yes"
dir=${GAMES_PREFIX_OPT}/ut2004
Ddir=${D}/${dir}

grabdirs() {
	for d in {Music,Sounds,Speech,StaticMeshes,Textures} ; do
		if [[ -d "${CDROM_ROOT}/$1/${d}" ]] ; then
			echo "Copying ${CDROM_ROOT}$1${d}"
			cp -r "${CDROM_ROOT}/$1/${d}" "${Ddir}" || die "copying $1"
		fi
	done
}

pkg_setup() {
	ewarn "This is a huge package.  If you do not have at least 7GB of free"
	ewarn "disk space in ${PORTAGE_TMPDIR} and also in ${GAMES_PREFIX_OPT} then"
	ewarn "you should abort this installation now and free up some space."
	games_pkg_setup
	check_dvd

	if [[ "${USE_DVD}" -eq 1 ]]
	then
		DISK1="CD1/"
		DISK2="CD2/"
		DISK3="CD3/"
		DISK4="CD4/"
		DISK5="CD5/"
		DISK6="CD6/"
		if [[ "${USE_ECE_DVD}" -eq 1 ]]
		then
			cdrom_get_cds "${DISK1}"System/UT2004.ini \
				"${DISK2}"Textures/2K4Fonts.utx.uz2 \
				"${DISK3}"Textures/ONSDeadVehicles-TX.utx.uz2 \
				"${DISK4}"Textures/XGameShaders2004.utx.uz2 \
				"${DISK5}"Speech/ons.xml \
				"${DISK6}"/Sounds/TauntPack.det_uax.uz2
		else
			cdrom_get_cds "${DISK1}"/System/UT2004.ini \
				"${DISK2}"/Textures/2K4Fonts.utx.uz2 \
				"${DISK3}"/Textures/ONSDeadVehicles-TX.utx.uz2 \
				"${DISK4}"/StaticMeshes/AlienTech.usx.uz2 \
				"${DISK5}"/Speech/ons.xml \
				"${DISK6}"/Sounds/TauntPack.det_uax.uz2
		fi
	else
		cdrom_get_cds System/UT2004.ini \
			Textures/2K4Fonts.utx.uz2 \
			Textures/ONSDeadVehicles-TX.utx.uz2 \
			StaticMeshes/AlienTech.usx.uz2 \
			Speech/ons.xml \
			Sounds/TauntPack.det_uax.uz2
	fi
}

src_unpack() {
	unpack_makeself "${CDROM_ROOT}"/linux-installer.sh \
		|| die "unpacking linux installer"
	use x86 && tar -xf "${S}"/linux-x86.tar
	use amd64 && tar -xf "${S}"/linux-amd64.tar
}

src_install() {
	dodir "${dir}"/System/editorres

	# Disk 1
	einfo "Copying files from Disk 1..."
	cp -r "${CDROM_ROOT}/${DISK1}"{Animations,ForceFeedback,Help,KarmaData,Maps,Sounds,Web} "${Ddir}" \
		|| die "copying files"
	cp -r "${CDROM_ROOT}/${DISK1}"System/{editorres,*.{bat,bmp,dat,det,est,frt,ini,int,itt,kot,md5,smt,tmt,u,ucl,upl,url}} \
		"${Ddir}"/System || die "copying files"
	mkdir -p "${Ddir}"/Manual || die "creating manual folder"
	cp "${CDROM_ROOT}/${DISK1}"Manual/Manual.pdf "${Ddir}"/Manual \
		|| die "copying manual"
	mkdir -p "${Ddir}"/Benchmark/Stuff || die "creating benchmark folders"
	cp -r "${CDROM_ROOT}/${DISK1}"Benchmark/Stuff/* "${Ddir}"/Benchmark/Stuff \
		|| die "copying benchmark files"
	cdrom_load_next_cd

	# Disk 2
	einfo "Copying files from Disk 2..."
	grabdirs "${DISK2}"
	cdrom_load_next_cd

	# Disk 3
	einfo "Copying files from Disk 3..."
	grabdirs "${DISK3}"
	cdrom_load_next_cd

	# Disk 4
	einfo "Copying files from Disk 4..."
	grabdirs "${DISK4}"
	cdrom_load_next_cd

	# Disk 5
	einfo "Copying files from Disk 5..."
	grabdirs "${DISK5}"
	cdrom_load_next_cd

	# Disk 6
	einfo "Copying files from Disk 6..."
	grabdirs "${DISK6}"

	# Create empty files in Benchmark
	for j in {CSVs,Logs,Results}
	do
		mkdir -p "${Ddir}/Benchmark/${j}" || die "creating folders"
		touch "${Ddir}/Benchmark/${j}"/DO_NOT_DELETE.ME || die "creating files"
	done

	# Install extra help files
	insinto "${dir}"/Help
	doins "${S}"/Unreal.bmp

	# Install EULA
	insinto "${dir}"
	doins "${S}"/UT2004_EULA.txt

	# Install System.inis
	insinto "${dir}"/System
	doins "${S}"/ini-{det,est,frt,int,itt,kot,smt,tmt}.tar

	# Copy ut2004
	exeinto "${dir}"
	doexe "${S}"/bin/ut2004 || die "copying ut2004"

	exeinto "${dir}"/System
	# We install the provided libraries because upstream wants it that way.
	# If you want to use your own system binaries, then feel free to uncomment
	# the following.  You will also want to comment the doexe lines below that
	# installs the libraries.
#	newexe "${S}"/System/openal.so openal.so-binary
#	newexe "${S}"/System/libSDL-1.2.so.0 libSDL-1.2.so.0-binary
	doexe ${S}/System/{libSDL-1.2.so.0,openal.so} \
		|| die "copying libraries"
	doexe "${S}"/System/{u{cc,t2004}-bin} \
		|| die "copying libs/ucc/ut2004"

	# Uncompressing files
	einfo "Uncompressing files... this *will* take a while..."
	for j in {Animations,Maps,Sounds,StaticMeshes,Textures}
	do
		chmod -R u+w "${Ddir}/${j}" || die "chmod in uncompress"
		games_ut_unpack "${Ddir}/${j}" || die "uncompressing files"
	done

	# Removing unneccessary files
	rm -f "${Ddir}"/Help/{InstallerLogo.bmp,SAPI-EULA.txt,{Unreal,UnrealEd}.ico}
	rm -rf "${Ddir}"/Speech/Redist
	rm -f "${Ddir}"/System/*.tar
	rm -f "${Ddir}"/System/{{License,Manifest}.smt,{ucc,StdOut}.log}
	rm -f "${Ddir}"/System/{User,UT2004,Manifest}.ini
	rm -f "${Ddir}"/System/{Manifest.int,Packages.md5}

	# Removing file collisions with ut2004-bonuspack-ece
	rm -f "${Ddir}"/Animations/{MechaSkaarjAnims,MetalGuardAnim,NecrisAnim,ONSBPAnimations}.ukx
	rm -f "${Ddir}"/Help/BonusPackReadme.txt
	rm -f "${Ddir}"/Maps/ONS-{Adara,IslandHop,Tricky,Urban}.ut2
	rm -f "${Ddir}"/Sounds/{CicadaSnds,DistantBooms,ONSBPSounds}.uax
	rm -f "${Ddir}"/StaticMeshes/{BenMesh02,BenTropicalSM01,HourAdara,ONS-BPJW1,PC_UrbanStatic}.usx
	rm -f "${Ddir}"/System/{ONS-Adara.int,ONS-IslandHop.int,ONS-Tricky.int,ONS-Urban.int,OnslaughtBP.int,xaplayersl3.upl}
	rm -f "${Ddir}"/Textures/{AW-2k4XP,BenTex02,BenTropical01,BonusParticles,CicadaTex,Construction_S}.utx
	rm -f "${Ddir}"/Textures/{HourAdaraTexor,ONSBPTextures,ONSBP_DestroyedVehicles,PC_UrbanTex,UT2004ECEPlayerSkins}.utx

	# Installing documentation/icon
	dodoc "${S}"/README.linux || die "dodoc README.linux"
	insinto /usr/share/pixmaps
	doins "${S}"/ut2004.xpm || die "copying pixmap"
	insinto "${dir}"
	doins "${S}"/{README.linux,ut2004.xpm} || die "copying readme/icon"

	# Now, since these files are coming off a CD, the times/sizes/md5sums won't
	# be different ... that means portage will try to unmerge some files (!)
	# We run touch on ${D} so as to make sure portage doesn't do any such thing
	find "${Ddir}" -exec touch '{}' \;

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst

	echo
	einfo "This is only the data portion of the game.  To play UT2004, you"
	einfo "still need to emerge ut2004."
	echo
}