summaryrefslogtreecommitdiff
blob: 6a1341b4205fa0353e090d3af5cdcf165fb27417 (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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-fps/unreal-tournament/unreal-tournament-451.ebuild,v 1.2 2003/09/09 23:44:19 msterret Exp $

inherit games eutils

DESCRIPTION="Futuristic FPS"
HOMEPAGE="http://www.unrealtournament.com/ http://utpg.org/"
SRC_URI="ftp://ftp.lokigames.com/pub/patches/ut/ut-install-436.run
	http://utpg.org/patches/UTPGPatch${PV}.tar.bz2"

LICENSE="as-is"
SLOT="0"
KEYWORDS="-* x86"
IUSE="3dfx X"

DEPEND="app-arch/unzip
	!games-fps/unreal-tournament-goty"
DEPEND="X? ( virtual/x11 )
	opengl? ( virtual/opengl )"

S=${WORKDIR}

pkg_setup() {
	games_get_cd System/
	games_verify_cd ${PN}
	games_pkg_setup
}

src_unpack() {
	unpack_makeself ut-install-436.run
	mkdir UTPG && cd UTPG
	unpack UTPGPatch${PV}.tar.bz2
	rm checkfiles.sh patch.md5
}

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

	# Help, Logs, Music, Textures, Web
	cp -rf ${GAMES_CD}/{Help,Logs,Music,Textures,Web} ${Ddir}/ || die "copy Help, Logs, Music, Textures, Web"
	tar -zxf Credits.tar.gz -C ${Ddir} || die "extract credits texture"
	# NetGamesUSA.com
	tar -zxf NetGamesUSA.com.tar.gz -C ${Ddir}/ || die "extract NetGamesUSA.com"
	# Sounds
	dodir ${dir}/Sounds
	cp -rf ${GAMES_CD}/Sounds/*.uax ${Ddir}/Sounds/ || die "copy Sounds"

	# System
	if [ `use 3dfx` ] ; then
		tar -zxf Glide.ini.tar.gz -C ${Ddir} || die "install Glide ini"
	else
		tar -zxf OpenGL.ini.tar.gz -C ${Ddir} || die "install OpenGL ini"
	fi
	tar -zxf data.tar.gz -C ${Ddir} || die "extract System data"
	cp ${GAMES_CD}/System/*.u ${Ddir}/System/ || die "copy System data"

	# the most important things, ucc & ut :)
	exeinto ${dir}
	doexe bin/x86/{ucc,ut} || die "install ucc/ut"
	dosed "s:\`FindPath \$0\`:${dir}:" ${dir}/ucc

	# install a few random files
	insinto ${dir}
	doins README icon.{bmp,xpm} || die "installing random files"

	# install a menu item (closes bug #27542)
	insinto /usr/share/pixmaps
	newins icon.xpm ut.xpm
	make_desktop_entry ut "Unreal Tournament" ut.xpm

	# first apply any patch remaints loki has for us
	cd setup.data
	./bin/Linux/x86/loki_patch patch.dat ${Ddir} >& /dev/null
	cd ${S}

	# finally, unleash the UTPG patch
	cp -rf UTPG/* ${Ddir}/
	# fix a small bug until next official release
	dosed "/^LoadClassMismatch/s:%s.%s:%s:" ${dir}/System/Core.int

	# now we uncompress the maps (GOTY edition installs maps as .uz)
	einfo "Uncompressing Maps ... this may take some time"
	dodir ${dir}/Maps
	cd ${Ddir}
	export HOME=${T}
	export UT_DATA_PATH=${Ddir}/System
	for f in `find ${GAMES_CD}/Maps/ -name '*.uz' -printf '%f '` ; do
		./ucc decompress ${GAMES_CD}/Maps/${f} -nohomedir || die "uncompressing map ${f}"
		mv System/${f:0:${#f}-3} Maps/ || die "copy map ${f}"
	done
	cp -rf ${GAMES_CD}/Maps/*.unr ${Ddir}/Maps/ # some cd's have uncompressed maps ??

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

	# export some symlinks so ppl can run
	dodir ${GAMES_BINDIR}
	dosym ${dir}/ucc ${GAMES_BINDIR}/ucc
	dosym ${dir}/ut ${GAMES_BINDIR}/ut

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	echo
	einfo "You might want to install the bonus packs too."
	einfo "Many servers on the internet use them, and the"
	einfo "majority of players do too."
	echo
	einfo "Just run: emerge unreal-tournament-bonuspacks"
	echo
}