# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=3 inherit eutils games MY_PN="OilRush" DESCRIPTION="A real-time strategy game based on control of oil platforms and naval/air units." HOMEPAGE="http://oilrush-game.com" SRC_URI="${MY_PN}-${PV}.run" LICENSE="" SLOT="0" KEYWORDS="amd64 x86" IUSE="doc" RDEPEND="media-libs/openal x11-libs/libX11 x11-libs/libXau x11-libs/libXdmcp x11-libs/libXext x11-libs/libXinerama x11-libs/libXrandr x11-libs/libXrender virtual/opengl" S="${WORKDIR}" GAMEDIR="${GAMES_PREFIX_OPT}/${PN}" pkg_nofetch() { einfo "" einfo "Please buy and download \"${SRC_URI}\" from:" einfo " ${HOMEPAGE}" einfo "and move it to \"${DISTDIR}\"" einfo "" } src_unpack() { unpack_makeself || die "unpack_makeself failed" } src_prepare() { #Prepare a wrapper based upon provided ones: touch "${PN}" || die "touch \"${PN}\" failed" #Take version specific params from one of the sh scripts: local PARAMS="" for script in *.sh do for param in console_command system_script extern_plugin do local PARAMS="$(grep -oe "\-${param}\ .*\ " "${script}") ${PARAMS}" done break done cat << EOF >> "${PN}" || die "echo \"${PN}\" failed" #!/bin/sh cd "${GAMEDIR}" export LD_LIBRARY_PATH="${GAMEDIR}/lib:\${LD_LIBRARY_PATH}" ./bin/${PN} -data_path ../ -engine_config ../${PN}.cfg ${PARAMS//\ \ / } EOF } src_install() { # Install data insinto "${GAMEDIR}" || die "insinto \"${GAMEDIR}\" failed" einfo " Installing game data files ..." doins -r "data" || die "doins game data files failed" # Changing config name allow us to keep settings through versions in an easy way. newins "${P}.cfg" "${PN}.cfg" || die "newins \"${P}.cfg\" failed" # Install libraries and executables einfo " Installing libraries and executables ..." if use amd64 then local suff="x64d" fi if use x86 then local suff="x86d" fi exeinto "${GAMEDIR}/lib" || die "exeinto \"lib\" failed" doexe bin/*${suff}*.so || die "doexe \"lib\" failed" exeinto "${GAMEDIR}/bin" || die "exeinto \"bin\" failed" newexe bin/${MY_PN}*${suff}* "${PN}" || die "newexe \"bin\" failed" exeinto "${GAMES_BINDIR}" || die "exeinto \"wrapper\" failed" doexe "${PN}" || die "doexe \"${PN}\" failed" # Install icon and desktop file local icon="${PN}.png" doicon "${FILESDIR}/${icon}" || die "newicon \"${icon}\" failed" make_desktop_entry "${PN}" "${MY_PN}" "/usr/share/pixmaps/${icon}" || die "make_desktop_entry failed" # Install documentation if use doc then docinto "${PN}" dodoc documentation/* || die "dodoc failed" fi # Setting permissions. einfo " Setting permissions ..." prepgamesdirs }