# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games DESCRIPTION="Game data for FreeSpace - The Great War. Requires CDs or previous installation." HOMEPAGE="http://www.volition-inc.com/fs/" SRC_URI="http://icculus.org/~taylor/freespace/updates/fs-${PV}-us-x86.run http://icculus.org/~taylor/freespace/updates/fs-${PV}-uk-x86.run http://icculus.org/~taylor/freespace/updates/fs-${PV}-german-x86.run" LICENSE="freespace1" SLOT="0" KEYWORDS="~x86" IUSE="videos" DEPEND="games-util/loki_patch" pkg_setup() { if [[ -z "${FS_PATCH_LANG}" ]]; then echo ewarn "FreeSpace - The Great War needs to be patched to version ${PV}. There" ewarn "are patches available for the American, British and German versions." ewarn "You need to select one of these patches using the FS_PATCH_LANG" ewarn "environment variable like so." ewarn ewarn " FS_PATCH_LANG=us emerge ${PN}" ewarn " FS_PATCH_LANG=uk emerge ${PN}" ewarn " FS_PATCH_LANG=de emerge ${PN}" ewarn ewarn "It seems that you can even use these patches on language versions" ewarn "that they were not intended for but only some of the text is replaced," ewarn "resulting in a mix of the two languages. This isn't recommended." ewarn ewarn "Since you did not specify FS_PATCH_LANG, the installation will" ewarn "continue without patching. Unless you know that you already have" ewarn "version ${PV}, it is recommended that you stop Portage now and" ewarn "start the installation again with FS_PATCH_LANG set." echo fi } src_unpack() { mkdir "${S}" "${S}/Data" cd "${S}" X=${FS_PATCH_LANG} [[ "${X}" == "de" ]] && X=german FSDIR="${GAMES_DATADIR}/freespace1" CDROM_NAME_1="FreeSpace - The Great War (Disc 1)" CDROM_NAME_2="FreeSpace - The Great War (Disc 2)" if use videos; then cdrom_get_cds Data/movies/ancients1.mve data/movies/ancients2.mve install -m 0640 "${CDROM_ROOT}/readme.txt" .. install -m 0640 "${CDROM_ROOT}"/*.vp . install -m 0640 "${CDROM_ROOT}/Data"/*.vp Data install -m 0640 "${CDROM_ROOT}/Data/movies"/* . cdrom_load_next_cd install -m 0640 "${CDROM_ROOT}/data/movies"/* . else cdrom_get_cds Data/freespace.vp install -m 0640 "${CDROM_ROOT}/readme.txt" .. install -m 0640 "${CDROM_ROOT}"/*.vp . install -m 0640 "${CDROM_ROOT}/Data"/*.vp Data fi # Has a patch been requested? if [[ -n "${X}" ]]; then # Unpack the patch. mkdir "${WORKDIR}/patch" cd "${WORKDIR}/patch" tail -n +$(sed -n "s:^skip=::p" "${DISTDIR}/fs-${PV}-${X}-x86.run") "${DISTDIR}/fs-${PV}-${X}-x86.run" | tar zx # Try to apply it. ebegin "Attempting to apply the ${PV} (${FS_PATCH_LANG}) patch" loki_patch patch.dat "${S}" &> /dev/null STATUS=$? eend $STATUS # Oh no! [[ "${STATUS}" != "0" ]] && ewarn "Patch failed. You may experience problems with the game." # The patches add this file but it is no longer needed. rm -f "${S}/fs1.vp" fi } src_compile() { einfo "Nothing to compile!" } src_install() { dodoc "${WORKDIR}/readme.txt" # Might as well move the files since it's quicker. mkdir -p "${D}${GAMES_DATADIR}" mv "${S}" "${D}${FSDIR}" prepgamesdirs }