# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games DESCRIPTION="Viking hack and slay game" HOMEPAGE="http://www.humanheadstudios.com" SRC_URI="runelinuxfiles.tar.gz" LICENSE="as-is" SLOT="0" KEYWORDS="-* x86" IUSE="nls" RDEPEND="virtual/x11 =media-libs/libsdl-1.2* opengl? ( virtual/opengl )" DEPEND="${RDEPEND}" S="${WORKDIR}" src_install() { dir=${GAMES_PREFIX_OPT}/rune Ddir=${D}/${dir} dodir ${dir} insinto ${dir} exeinto ${dir} CDROM_NAME="Rune CD" USE_LINUX= USE_WINDOWS= if [ -n "${CD_ROOT}" ] then [ -f "${CD_ROOT}/System/rune-bin" ] && USE_LINUX=1 [ -f "${CD_ROOT}/System/Rune.exe" ] && USE_WINDOWS=1 else local mline="" for mline in `mount | egrep -e '(iso|cdrom)' | awk '{print $3}'` do [ -f "${mline}/System/rune-bin" ] && USE_LINUX=1 [ -f "${mline}/System/Rune.exe" ] && USE_WINDOWS=1 done fi if [[ ${USE_WINDOWS} -eq 1 ]] then cdrom_get_cds System/Rune.exe # copy the data files doins -r "${CDROM_ROOT}"/{Maps,Sounds,Web} || die "Could not copy Maps, Sounds, Textures and Web" # make linux texturefiles from windows texturefiles dodir ${dir}/Textures for x in `find "${CDROM_ROOT}"/Textures/ -type f -printf '%f '` ; do echo -ne '\271\325\036\214' |cat - ${CDROM_ROOT}/Textures/$x |sed -e '1 s/\(....\)..../\1/' >${Ddir}/Textures/$x || die "Could not modify and copy Textures" done # System folder dodir ${dir}/System || die "Could not create System folder" # copy language and .u files use nls && doins "${CDROM_ROOT}"/System/*.{est,frt,itt} ${dir}/System/ || eerror "Could not copy language specific data" insinto ${dir}/System doins "${CDROM_ROOT}"/System/*.{int,u,url} || die "Could not copy System data" # modify the files mv ${Ddir}/System/OpenGlDrv.int ${Ddir}/System/OpenGLDrv.int || die "Could not modify System file OpenGlDrv.int" mv ${Ddir}/Textures/bloodFX.utx ${Ddir}/Textures/BloodFX.utx || die "Could not modify Texture file bloodFX.utx" mv ${Ddir}/Textures/RUNESTONES.UTX ${Ddir}/Textures/RUNESTONES.utx || die "Could not modify Texture file RUNESTONES.UTX" mv ${Ddir}/Textures/tedd.utx ${Ddir}/Textures/Tedd.utx || die "Could not modify Texture file tedd.utx" mv ${Ddir}/Textures/UNDERANCIENT.utx ${Ddir}/Textures/UnderAncient.utx || die "Could not modify Texture file UNDERANCIENT.utx" rm ${Ddir}/System/{Setup.int,SGLDrv.int,MeTaLDrv.int,Manifest.int,D3DDrv.int,Galaxy.int,SoftDrv.int,WinDrv.int,Window.int} || die "Could not delete not needed System files" # patch the windows files insinto ${dir} doins -r ${S}/patch/* || die "Could not copy Patch data" # copy linux specific files doins -r ${S}/System || die "Could not copy Linux specific files" doins -r ${S}/Help || die "Could not copy Help data" # the most important things: rune and ucc :) doexe ${S}/bin/x86/rune || die "Could not install rune executable" fperms 750 ${dir}/System/{ucc,ucc-bin,rune-bin} || die "Could not make executables executable" # export some symlinks so ppl can run dodir ${GAMES_BINDIR} games_make_wrapper rune ${dir}/rune ${dir} || die "Could not symlink rune" # installing documentation/icon dodoc ${S}/README || die "Could not dodoc README.linux" doins ${S}/README ${S}/rune.{xpm,bmp} || die "Could not copy readme and icon" doicon ${S}/rune.xpm || die "Could not copy pixmap" make_desktop_entry rune "Rune" rune.xpm "Game;ActionGame" || eerror "Could not create Gnome/KDE Menu entries" elif [[ ${USE_LINUX} -eq 1 ]] then cdrom_get_cds System/rune-bin # unpack the data files tar -C ${Ddir} -xzf "${CDROM_ROOT}"/data.tar.gz || die "Could not unpack data.tar.gz" # copy linux specific files doins -r "${CDROM_ROOT}"/System || die "Could not copy Linux specific files" # the most important things: rune and ucc :) doexe "${CDROM_ROOT}"/bin/x86/rune || die "Could not install rune executable" fperms 750 ${dir}/System/{ucc,ucc-bin,rune-bin} || die "Could not make executables executable" # export some symlinks so ppl can run dodir ${GAMES_BINDIR} games_make_wrapper rune ${dir}/rune ${dir} || die "Could not symlink rune" # installing documentation/icon dodoc "${CDROM_ROOT}"/README || die "Could not dodoc README.linux" cp "${CDROM_ROOT}"/icon.xpm ${S}/rune.xpm cp "${CDROM_ROOT}"/icon.bmp ${S}/rune.bmp doins "${CDROM_ROOT}"/README ${S}/rune.{xpm,bmp} || die "Could not copy readme and icon" doicon ${S}/rune.xpm || die "Could not copy pixmap" make_desktop_entry rune "Rune" rune.xpm "Game;ActionGame" || eerror "Could not create Gnome/KDE Menu entries" fi find ${Ddir} -exec touch '{}' \; prepgamesdirs }