# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils versionator games # MY_PV will be e.g. "beta1" MY_PV=$(get_version_component_range 2-2) SZ="ftp://ftp.planetmirror.com/pub/seriouszone" SH_FILE="${PN}-${MY_PV}.sh.bin" DESCRIPTION="Serious Sam: The Second Encounter" HOMEPAGE="http://www.croteam.com/ http://www.seriouszone.com/" SRC_URI="${SZ}/${SH_FILE} http://icculus.org/betas/ssam/${SH_FILE} maps? ( ${SZ}/ssse/maps/militarydecay.zip ${SZ}/ssse/maps/alpineii.zip ${SZ}/ssse/maps/otmosis.zip ) models? ( ${SZ}/ssse/models/SeriousSamantha.zip ${SZ}/ssse/models/ronaldmcdonald.zip ${SZ}/ssse/models/smoothsam.zip ${SZ}/ssse/models/sleepysam.zip ${SZ}/ssse/models/adventurousash.zip )" LICENSE="LOKI-EULA" SLOT="0" KEYWORDS="~x86" RESTRICT="mirror strip" IUSE="maps models" RDEPEND="virtual/opengl media-libs/libsdl" DEPEND="maps? ( app-arch/unzip ) models? ( app-arch/unzip )" # unshield is not used. # >=app-arch/unshield-0.5 S=${WORKDIR} pkg_setup() { games_pkg_setup cdrom_get_cds "Install/SE1_00.gro" } src_unpack() { mkdir Levels Mods unpack_makeself "${SH_FILE}" unpack ./setupstuff.tar.gz unpack ./bins.tar.bz2 local f if use maps ; then for f in otmosis alpineii militarydecay ; do unpack "${f}.zip" done fi if use models ; then for f in adventurousash sleepysam smoothsam ronaldmcdonald SeriousSamantha ; do unpack "${f}.zip" done fi } src_install() { local dir=${GAMES_PREFIX_OPT}/${PN} einfo "Copying from ${CDROM_ROOT}" insinto "${dir}" doins -r "${CDROM_ROOT}"/Install/* || die "doins CD failed" # Data CABs local n for n in 1 2 ; do f=${D}/${dir}/data${n}.cab # unshield-0.5 fails part-way through the extract. # Hopefully a new version in the future will work. # The CABs contain optional multiplayer maps in the "Levels" directory. einfo "Ignoring data${n}.cab - unshield cannot extract it" #unshield x "${f}" || die "unshield ${f} failed" #rm "${f}" done doins -r Bin Data Levels Mods *.txt README* \ || die "doins main failed" if use maps || use models ; then doins *.gro || die fi if use models ; then doins -r Models || die fi # Install bins last to ensure they are marked executable exeinto "${dir}" doexe bin/${PN} || die exeinto "${dir}"/Bin doexe Bin/{ssam_lnx*,*.so} || die # Remove useless Windows files rm -rf "${D}/${dir}/Bin"/{*.exe,*.dll,*.DLL,GameSpy} newicon ssam.xpm ${PN}.xpm || die games_make_wrapper ${PN} ./${PN} "${dir}" "${dir}" make_desktop_entry ${PN} "Serious Sam - Second Encounter" ${PN}.xpm # 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." elog "Important information about the Linux port is at:" elog " http://files.seriouszone.com/download.php?fileid=616" echo }