# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 inherit eutils games MY_ARCH=${ARCH/x86/i386} MY_PN=${PN/-/_} MY_UPN="CortexCommand" MY_PV=${PV/0./b} MY_REV="-1" DESCRIPTION="a 2-dimensional side-scrolling action game developed by Data Realms" HOMEPAGE="http://www.datarealms.com/games.php" SRC_URI="${MY_PN}-${MY_ARCH}-installer-${MY_PV}${MY_REV}.bin" LICENSE="DetaRealms" SLOT="0" KEYWORDS="-* amd64 ~x86" IUSE="+system-libs" RESTRICT="fetch strip" BUNDLED_LIBS="dev-libs/openssl media-libs/libogg media-libs/libvorbis media-libs/openal net-misc/curl" RDEPEND="sys-apps/util-linux sys-libs/zlib x11-libs/libSM x11-libs/libXcursor x11-libs/libXext x11-libs/libXxf86vm x11-libs/libxcb system-libs? ( ${BUNDLED_LIBS} )" DEPEND="app-arch/unzip" S="${WORKDIR}/data/${MY_PN}_linux" GAMEDIR=${GAMES_PREFIX_OPT}/${PN} pkg_nofetch() { echo elog "Please purchase and download '${SRC_URI}'" elog "then copy to: '${DISTDIR}'" echo } src_unpack() { local a="${DISTDIR}/${A}" unzip -q "${a}" 2>/dev/null [ $? -gt 1 ] && die "unpack failed" } src_prepare() { einfo $PWD } src_install() { insinto "${GAMEDIR}" exeinto "${GAMEDIR}" # install game files doins -r *.rt? || die "install resources" doins Credits.txt || die "install credits" doexe ${MY_UPN}.bin || die "install bin" # install bundled libraries exeinto "${GAMEDIR}/libs" if use system-libs; then # the following are not available in portage doexe libs/{liballeg.so.4.4,libcAudio.so,libluabindd.so.0.9.0} || die "install libraries" # game crashes without the following, even if system library installed doexe libs/libopenal.so.1 || die "install libraries" else # install everything doexe libs/* || die "install libraries" fi # install documentation dodoc readme.txt || die "install doc" # install shortcuts newicon ${MY_UPN}.png ${PN}.png || die "install icon" games_make_wrapper ${PN} ./${MY_UPN}.bin "${GAMEDIR}" "${GAMEDIR}" \ || die "install shortcuts" make_desktop_entry ${PN} "Cortex Command" prepgamesdirs } pkg_postinst() { echo einfo "To play the game, run:" einfo "${PN}" echo games_pkg_postinst }