# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils games MY_PN=ttp MY_PV=${PV//./_} DESCRIPTION="Brake down and Burn up! original:Torus Trooper (ABA)" HOMEPAGE="http://www.mb.ccnw.ne.jp/hiz/game/tt/index_en.html" SRC_URI="http://www.mb.ccnw.ne.jp/hiz/game/tt//${MY_PN}${MY_PV}.zip" LICENSE="BSD" SLOT="0" KEYWORDS="~ppc ~x86" IUSE="" DEPEND="media-libs/libsdl media-libs/mesa media-libs/sdl-mixer dev-libs/bulletss" RDEPEND="" S=${WORKDIR}/${MY_PN}${MY_PV} pkg_setup() { games_pkg_setup # gcc must be built with "d" USE-FLAG if ! built_with_use sys-devel/gcc:4.1 d; then ewarn "sys-devel/gcc must be built with d for this package" ewarn "to function." die "recompile gcc with USE=\"d\"" fi if [ "$(gcc-major-version)" == "4" ] && [ "$(gcc-minor-version)" == "2" ] ; then die "gdc doesn't work with sys-devel/gcc-4.2 currently - use 4.1 instead" fi } src_unpack(){ unpack ${A} epatch "${FILESDIR}"/${P}.diff sed -i \ -e 's:"\(images/[^"]*\)":"'${GAMES_DATADIR}'/'${PN}'/\1":g' -i ttp0_2/src/abagames/util/sdl/texture.d \ -e 's:"\(sounds/[^"]*\)":"'${GAMES_DATADIR}'/'${PN}'/\1":g' -i ttp0_2/src/abagames/util/sdl/sound.d \ -e 's:"\(barrage[^"]*\)":"'${GAMES_DATADIR}'/'${PN}'/\1":g' -i ttp0_2/src/abagames/tt/barrage.d \ -e 's:"\(tt.prf[^"]*\)":"'${GAMES_STATEDIR}'/'${PN}'/\1":g' -i ttp0_2/src/abagames/tt/prefmanager.d \ || die "sed failed" } src_install() { dogamesbin ${PN} dodir "${GAMES_STATEDIR}/${PN}" "${GAMES_STATEDIR}/${PN}/replay" local statedir="${GAMES_STATEDIR}"/${PN} if [ ! -e ${D}"${GAMES_STATEDIR}"/${PN}/tt.prf ]; then touch ${D}"${GAMES_STATEDIR}"/${PN}/tt.prf chmod ug+rw ${D}"${GAMES_STATEDIR}"/${PN}/tt.prf fperms 660 ${D}"${GAMES_STATEDIR}"/${PN}/tt.prf fi local datadir="${GAMES_DATADIR}"/${PN} dodir ${datadir} insinto "${GAMES_DATADIR}"/${PN} doins -r barrage images sounds || die newicon "${FILESDIR}"/${PN}.png ${PN}.png make_desktop_entry ${PN} ${PN} dodoc readme* prepgamesdirs } pkg_postinst() { games_pkg_postinst }