# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games DESCRIPTION="Old school first-person-shooter with droves and droves of enemies." HOMEPAGE="http://www.serioussam.com/" SRC_URI=" \ http://icculus.org/betas/ssam/ssam-tfe-lnx-beta1a.run \ http://icculus.org/updates/ssam/ssamtfe-beta1b.sh.bin \ http://icculus.org/updates/ssam/ssamtfe-beta1b.sh.bin.md5 \ http://icculus.org/updates/ssam/ssamtfe-beta2.sh.bin \ http://icculus.org/updates/ssam/ssamtfe-beta2.sh.bin.md5 \ http://icculus.org/updates/ssam/ssamtfe-beta3.sh.bin \ http://icculus.org/updates/ssam/ssamtfe-beta3.sh.bin.md5 \ " LICENSE="as-is" SLOT="0" KEYWORDS="-* ~x86" IUSE="" RDEPEND=" \ virtual/libc \ X? ( virtual/x11 ) \ opengl? ( virtual/opengl ) \ " DEPEND=" \ ${RDEPEND} \ X? ( virtual/x11 ) \ opengl? ( virtual/opengl ) \ media-libs/libsdl \ app-arch/tar \ app-arch/gzip \ " S=${WORKDIR} # Convenience vars ssam_pkg_installer="ssam-tfe-lnx-beta1a.run" ssam_pkg_installer_ea="ssam-tfe-lnx-beta1a-embedded-archive.tar" # Embedded archive ssam_pkg_update_beta1b="ssamtfe-beta1b.sh.bin" ssam_pkg_update_beta1b_ea="ssamtfe-beta1b-embedded-archive.tar.gz" # Embedded archive ssam_pkg_update_beta2="ssamtfe-beta2.sh.bin" ssam_pkg_update_beta2_ea="ssamtfe-beta2-embedded-archive.tar.gz" # Embedded archive ssam_pkg_update_beta3="ssamtfe-beta3.sh.bin" ssam_pkg_update_beta3_ea="ssamtfe-beta3-embedded-archive.tar.gz" # Embedded archive #------------------------------------------------------------------------------- function pkg_setup() { #--- # License agreement check_license # Check for CD cdrom_get_cds Install/ # FIXME: What is this for? games_pkg_setup #--- } #------------------------------------------------------------------------------- function src_unpack() { #--- # Extract all embedded archives einfo "Extracting all embedded archives from fetched packages." einfo "\to Processing ${ssam_pkg_installer}..." && \ tail -n +266 ${DISTDIR}/${ssam_pkg_installer} > ${S}/${ssam_pkg_installer_ea} && \ einfo "\to Processing ${ssam_pkg_update_beta1b}..." && \ tail -n +266 ${DISTDIR}/${ssam_pkg_update_beta1b} > ${S}/${ssam_pkg_update_beta1b_ea} && \ einfo "\to Processing ${ssam_pkg_update_beta2}..." && \ tail -n +266 ${DISTDIR}/${ssam_pkg_update_beta2} > ${S}/${ssam_pkg_update_beta2_ea} && \ einfo "\to Processing ${ssam_pkg_update_beta3}..." && \ tail -n +266 ${DISTDIR}/${ssam_pkg_update_beta3} > ${S}/${ssam_pkg_update_beta3_ea} \ || die "Failed: Extracting all embedded archives from fetched packages." #--- } #------------------------------------------------------------------------------- function src_install() { local dir=${GAMES_PREFIX_OPT}/${PN} local Ddir=${D}/${dir} #--- # Create directory dodir ${dir} # 1. Copy cdrom mirror to destation directory einfo "Copying CDROM /Install/ image." cp -faxu ${CDROM_ROOT}/* ${Ddir} \ || die "Failed: Copying CDROM /Install/ image." # 2a. Extract and install ssam-tfe-lnx-beta1a-embedded-archive.tar einfo "Extracting and installing from sub-archive ${ssam_pkg_installer_ea}" mkdir ${T}/dir.${ssam_pkg_installer_ea} 2>&1 cd ${T}/dir.${ssam_pkg_installer_ea} && \ tar -xf ${S}/${ssam_pkg_installer_ea} \ || die "Failed: Extracting and installing from archive ssam-tfe-lnx-beta1a-embedded-archive.tar" # 2b. Extract and install SeriousSamPatch105_USA_linux.tar.bz2 einfo "Extracting and installing from sub-archive SeriousSamPatch105_USA_linux.tar.bz2" mkdir ${T}/dir.${ssam_pkg_installer_ea}/dir.SeriousSamPatch105_USA_linux.tar.bz2 2>&1 cd ${T}/dir.${ssam_pkg_installer_ea}/dir.SeriousSamPatch105_USA_linux.tar.bz2 && \ tar -jxf ${T}/dir.${ssam_pkg_installer_ea}/SeriousSamPatch105_USA_linux.tar.bz2 && \ cp -faxu * ${Ddir} \ || die "Failed: Extracting and installing from sub-archive SeriousSamPatch105_USA_linux.tar.bz2" # 2c. Extract and install bins.tar.bz2 einfo "Extracting and installing from sub-archive bins.tar.bz2" mkdir ${T}/dir.${ssam_pkg_installer_ea}/dir.bins.tar.bz2 2>&1 cd ${T}/dir.${ssam_pkg_installer_ea}/dir.bins.tar.bz2 && \ tar -jxf ${T}/dir.${ssam_pkg_installer_ea}/bins.tar.bz2 && \ cp -faxu * ${Ddir} \ || die "Failed: Extracting and installing from sub-archive bins.tar.bz2" # 2d. Extract and install files from setupstuff.tar.gz einfo "Extracting and installing from sub-archive setupstuff.tar.gz" mkdir ${T}/dir.${ssam_pkg_installer_ea}/dir.setupstuff.tar.gz 2>&1 cd ${T}/dir.${ssam_pkg_installer_ea}/dir.setupstuff.tar.gz && \ tar -zxf ${T}/dir.${ssam_pkg_installer_ea}/setupstuff.tar.gz && \ cp -faxu bin/ssamtfe ${Ddir} \ || die "Failed: Extracting and installing from sub-archive setupstuff.tar.gz" # 3a. Extract and install ssamtfe-beta1b-embedded-archive.tar.gz einfo "Extracting and installing from archive ${ssam_pkg_update_beta1b_ea}" mkdir ${T}/dir.${ssam_pkg_update_beta1b_ea} 2>&1 cd ${T}/dir.${ssam_pkg_update_beta1b_ea} && \ tar -zxf ${S}/${ssam_pkg_update_beta1b_ea} && \ bin/Linux/x86/loki_patch patch.dat ${Ddir} \ || die "Failed: Extracting and installing from archive ${ssam_pkg_update_beta1b_ea}" # 4a. Extract and install ssamtfe-beta2-embedded-archive.tar.gz einfo "Extracting and installing from archive ${ssam_pkg_update_beta2_ea}" mkdir ${T}/dir.${ssam_pkg_update_beta2_ea} 2>&1 cd ${T}/dir.${ssam_pkg_update_beta2_ea} && \ tar -zxf ${S}/${ssam_pkg_update_beta2_ea} && \ bin/Linux/x86/loki_patch patch.dat ${Ddir} \ || die "Failed: Extracting and installing from archive ${ssam_pkg_update_beta2_ea}" # 5a. Extract and install ssamtfe-beta3-embedded-archive.tar.gz einfo "Extracting and installing from archive ${ssam_pkg_update_beta3_ea}" mkdir ${T}/${ssam_pkg_update_beta3_ea} 2>&1 cd ${T}/${ssam_pkg_update_beta3_ea} && \ tar -zxf ${S}/${ssam_pkg_update_beta3_ea} && \ bin/Linux/x86/loki_patch patch.dat ${Ddir} \ || die "Failed: Extracting and installing from archive ${ssam_pkg_update_beta3_ea}" # 6. Create symlinks for binaries einfo "Creating symlinks for binaries." dodir ${GAMES_BINDIR} dosym ${dir}/ssamtfe ${GAMES_BINDIR}/ssamtfe # 7. From games-fps/unreal-tournament/unreal-tournament-451: # 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 # MJG: This apparently fixes ebuild's unmerge function NOT properly # unmerging all files find ${Ddir} -exec touch '{}' \; #--- } #------------------------------------------------------------------------------- function pkg_postinst() { #--- # FIXME: What is this for? games_pkg_postinst # Information for the user einfo "You can run the game by executing:" einfo "\to ${GAMES_BINDIR}/ssamtfe" #--- } #-------------------------------------------------------------------------------