# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit games distutils MY_PN=Dragon_Hunt DESCRIPTION="A simple graphical RPG." HOMEPAGE="http://www.geocities.com/evilmrhenry/dh.html" SRC_URI="http://www.geocities.com/evilmrhenry/${MY_PN}-${PV}.tar.gz" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="" RDEPEND="dev-lang/python dev-python/Imaging >=dev-lang/tk-8.4.6 >=dev-lang/tcl-8.4.6" DEPEND=">=sys-apps/sed-4" S=${WORKDIR}/${MY_PN}-${PV} IMAGES_DIR=${GAMES_DATADIR}/${PN}/images DATA_DIR=${GAMES_DATADIR}/${PN}/data LIB_DIR=${GAMES_LIBDIR}/${PN} src_unpack() { unpack ${A} cd ${S} # Setup where our images are stored. sed -i -e "s,../images/\?,${IMAGES_DIR}/," code/main.py code/g.py # Setup where our data is stored. sed -i -e "s,../data,${DATA_DIR}," code/g.py code/scripting.py # Save games in ~/.${PN}/. sed -i -e "s,^\(from os import.*\),\1\, environ," \ code/g.py code/loadgame.py sed -i -e "s,\"../saves/\?\",environ[\"HOME\"] + \"/.${PN}/\"," \ code/g.py code/loadgame.py # Make the launch script look in the right place for the code. sed -i -e '/^tempname/d' Dragon_Hunt_Linux sed -i -e "s,cd.*,cd ${LIB_DIR}," Dragon_Hunt_Linux } src_install() { distutils_python_tkinter # Fail if no tkinter support. dodir ${GAMES_DATADIR}/${PN} dodir ${IMAGES_DIR} cp images/* ${D}/${IMAGES_DIR} dodir ${DATA_DIR} cp -R data/* ${D}/${DATA_DIR} # Install the code for running the game, the compiled python isn't included # as I cannot safely change the directory paths in it. dodir ${LIB_DIR} cp code/*.py ${D}/${LIB_DIR} newgamesbin Dragon_Hunt_Linux ${PN} dodoc README.txt GPL.txt PKG-INFO }