# Distributed under the terms of the GNU General Public License v2 EAPI=2 inherit eutils games DESCRIPTION="Steel Storm Episode I" HOMEPAGE="http://www.steel-storm.com/" RESTRICT="mirror" SRC_URI="http://download2.steel-storm.com/${PN}-ep1-v${PV}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="alsa dedicated" RDEPEND=">=media-libs/libsdl-1.2 >=media-libs/freetype-2.3.11 >=media-libs/libogg-1.1.4 >=media-libs/libvorbis-1.2.3 >=net-misc/curl-7.19.7 >=media-libs/libmodplug-0.8.7 virtual/opengl =games-arcade/steelstorm-data-${PV}" src_unpack() { unpack ${PN}-ep1-v${PV}.tar.gz mv "${WORKDIR}/${PN}/engine_source.zip" "${DISTDIR}" unpack engine_source.zip } src_prepare() { cd engine_source sed -i \ -e "/^CC=/d" \ -e "s:-O2:${CFLAGS}:" \ -e "/-lm/s:$: ${LDFLAGS}:" \ -e '/^STRIP/s/strip/true/' \ -e "s/darkplaces-dedicated/${PN}-dedicated/" \ -e "s/darkplaces-sdl/${PN}/" \ makefile.inc \ || die "sed failed" sed -i \ -e '1i DP_LINK_TO_LIBJPEG=1' \ -e "s:ifdef DP_FS_.*:DP_FS_BASEDIR=${GAMES_DATADIR}/${PN}\n&:" \ makefile \ || die "sed failed" if ! use alsa ; then sed -i \ -e "/DEFAULT_SNDAPI/s:ALSA:OSS:" \ makefile \ || die "sed failed" fi } src_compile() { cd engine_source if use dedicated ; then emake sv-release || die "emake sv-release failed" else emake sdl-release || die "emake sdl-release failed" fi } src_install() { dodoc ${PN}/README.txt cd engine_source if use dedicated ; then dogamesbin ${PN}-dedicated || die "dogamesbin ${PN}-dedicated failed" else dogamesbin ${PN} || die "dogamesbin ${PN} failed" fi }