# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="4" inherit cdrom eutils games unpacker MY_PN="ssamtfe" SH_FILE="" DESCRIPTION="Serious Sam: The First Encounter" HOMEPAGE="http://icculus.org/betas/ssam/ http://www.croteam.com/ http://www.seriouszone.com/" SRC_URI="http://icculus.org/betas/ssam/ssam-tfe-lnx-beta1a.run http://icculus.org/updates/ssam/${MY_PN}-beta1b.sh.bin http://icculus.org/updates/ssam/${MY_PN}-beta2.sh.bin http://icculus.org/updates/ssam/${MY_PN}-beta3.sh.bin" LICENSE="LOKI-EULA" SLOT="0" KEYWORDS="-* ~amd64 ~x86" RESTRICT="strip" IUSE="alsa" # x86 dependencies almost certainly not correct RDEPEND="amd64? ( app-emulation/emul-linux-x86-opengl app-emulation/emul-linux-x86-sdl ) x86? ( alsa? ( media-libs/libsdl[alsa,audio] media-libs/libvorbis ) media-libs/libsdl media-libs/libvorbis[X,joystick,opengl,video] )" DEPEND="app-arch/unzip games-util/loki_patch" S=${WORKDIR} pkg_setup() { games_pkg_setup cdrom_get_cds "Install/1_00c.gro" } src_unpack() { mkdir Mods Levels unpack_makeself ssam-tfe-lnx-beta1a.run || die "unpack_makeself failed" # Copy files during unpack as the patches below apply to some of them echo "Copying from ${CDROM_ROOT}" cp -r "${CDROM_ROOT}/Install"/* . || die "doins CD failed" unpack ./SeriousSamPatch105_USA_linux.tar.bz2 unpack ./setupstuff.tar.gz unpack ./bins.tar.bz2 mv bin/${MY_PN} . # Apply the Icculus patches local v for v in 1b 2 3 ; do echo "Unpacking version ${v}" unpack_makeself "${MY_PN}-beta${v}.sh.bin" loki_patch patch.dat . || die "loki patch ${v} failed" rm patch.dat done } src_prepare() { # Switch to dynamic executable - runs at sane speeds on modern hardware sed -i -e 's;exec "./ssam_lnx";exec "./ssam_lnx.dynamic";' ${MY_PN} \ || die "dynamic binary update failed" } src_install() { local dir=${GAMES_PREFIX_OPT}/${MY_PN} # Remove bundled libs rm -f Bin/{lib{ogg,vorbis,vorbisfile}.so} # Remove unneeded files rm *.{bin,bz2,cab,exe,ex_,ini,gz,sh} rm -r CVS data setup* Players Temp mv bin/* Bin/ && rmdir bin # Install icon newicon ssam.xpm ${MY_PN}.xpm && rm ssam.xpm || die "newicon failed" # Install executables exeinto "${dir}" doexe ${MY_PN} && rm ${MY_PN} || die "install binary wrapper failed" exeinto "${dir}"/Bin doexe Bin/ssam_lnx* && rm Bin/ssam_lnx* || die "install binaries failed" # Install documentation dodoc README* && rm README* # Install all other files insinto "${dir}" doins -r * || die "doins main failed" games_make_wrapper ${MY_PN} ./${MY_PN} "${dir}" "${dir}" make_desktop_entry ${MY_PN} "Serious Sam - First Encounter" ${MY_PN} # Ensure that file datestamps from the CD are sane find "${D}/${dir}" -exec touch '{}' \; prepgamesdirs } pkg_postinst() { games_pkg_postinst elog "The warning regarding 'XiG-SUNDRY-NONSTANDARD missing' is harmless" echo }