# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games DESCRIPTION="Futuristic FPS" HOMEPAGE="http://www.unrealtournament.com/ http://utpg.org/" SRC_URI="mirror://lokigames/../patches/ut/ut-install-436.run http://utpg.org/patches/UTPGPatch${PV}.tar.bz2" LICENSE="as-is" SLOT="0" KEYWORDS="-* amd64 x86" IUSE="3dfx opengl" RESTRICT="strip" RDEPEND="!amd64? ( || ( ( x11-libs/libXext x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp ) virtual/x11 ) opengl? ( virtual/opengl ) =media-libs/libsdl-1.2* ) amd64? ( app-emulation/emul-linux-x86-sdl app-emulation/emul-linux-x86-baselibs app-emulation/emul-linux-x86-xlibs )" DEPEND="${RDEPEND} !games-fps/unreal-tournament-goty" S=${WORKDIR} dir=${GAMES_PREFIX_OPT}/${PN/-goty/} Ddir=${D}/${dir} pkg_setup() { games_pkg_setup cdrom_get_cds System/ } src_unpack() { unpack_makeself ut-install-436.run mkdir UTPG && cd UTPG unpack UTPGPatch${PV}.tar.bz2 rm checkfiles.sh patch.md5 } src_install() { unpack ./{Credits,data,NetGamesUSA.com}.tar.gz dodir "${dir}"/{Maps,Sounds,System} # Help, Logs, Music, Textures, Web cp -rf "${CDROM_ROOT}"/{Help,Logs,Music,Textures,Web} "${Ddir}" \ || die "copy Help, Logs, Music, Textures, Web" # Sounds cp -rf "${CDROM_ROOT}"/Sounds/*.uax "${Ddir}"/Sounds || die "copy Sounds" # System if use 3dfx ; then unpack ./Glide.ini.tar.gz || die "install Glide ini" else unpack ./OpenGL.ini.tar.gz || die "install OpenGL ini" fi cp "${CDROM_ROOT}"/System/*.u "${Ddir}"/System || die "copy System data" # Install a few random files exeinto "${dir}"/System doexe System/u{cc,t}-bin && rm System/u{cc,t}-bin || die "doexe System" insinto "${dir}" doins -r README icon.{bmp,xpm} NetGamesUSA.com System Textures \ || die "install random files" # Scripts exeinto "${dir}" doexe bin/x86/u{cc,t} || die "install ucc/ut" dosed "s:\`FindPath \$0\`:${dir}:" "${dir}"/u{cc,t} # Apply Loki patch cd setup.data cp patch.dat{,.orig} || die "cp patch.dat failed" sed -e 's:sh uz-maps.sh:echo:' patch.dat.orig > patch.dat \ || die "sed patch.dat failed" ./bin/Linux/x86/loki_patch patch.dat "${Ddir}" cd "${S}" # Apply UTPG patch cp -rf UTPG/* "${Ddir}" || die "cp UTPG failed" # Fix server vulnerability - part of bug #44351 dosed "/^LoadClassMismatch/s:%s.%s:%s:" "${dir}"/System/Core.int # Uncompress maps (GOTY edition installs maps as .uz) echo "Uncompressing Maps... this may take some time" cd "${Ddir}" export HOME=${T} export UT_DATA_PATH=${Ddir}/System for f in $(find ${CDROM_ROOT}/Maps -name '*.uz' -printf '%f ') ; do ./ucc decompress "${CDROM_ROOT}/Maps/${f}" -nohomedir \ || die "uncompress map ${f}" mv "System/${f:0:${#f}-3}" Maps || die "copy map ${f}" done # Some CDs contain uncompressed maps? cp -rf "${CDROM_ROOT}"/Maps/*.unr "${Ddir}"/Maps cd "${S}" # Desktop games_make_wrapper ut ./ut "${dir}" games_make_wrapper ucc ./ucc "${dir}" newicon icon.xpm ut.xpm make_desktop_entry ut "Unreal Tournament" ut.xpm # Update file datestamps find "${Ddir}" -exec touch '{}' \; prepgamesdirs } pkg_postinst() { games_pkg_postinst einfo "You might also want to install the bonus packs." 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 }