# 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="~amd64" 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} MODULE_DIR=${GAMES_DATADIR}/${PN}/ LIB_DIR=${GAMES_LIBDIR}/${PN}/ src_unpack() { unpack ${A} cd ${S} # Where to look for modules to load. sed -i -e "s:\.\./modules/:${MODULE_DIR}:" \ code/rpg.py code/new_game.py code/map_editor.py code/load_map.py # Save games in ~/.${PN}/. sed -i \ -e "s:^\(from os import.*\):\1\, environ:" \ -e "s:g.mod_dir.*\"/saves/\?\":environ[\"HOME\"] + \"/.${PN}/\":" \ code/g.py code/loadgame.py # Save maps in ~/. sed -i \ -e "s:^\(from os import.*\):\1\, environ:" \ -e "s:g.mod_dir.*\"map\.txt\":environ[\"HOME\"]\ +\ \"/dh_map.txt\":" \ code/map_editor.py # Make the launch scripts look in the right place for the code. sed -i \ -e '/^tempname/d' \ -e "s:^cd.*:cd ${LIB_DIR}:" \ Dragon_Hunt_Linux Map_Editor } src_install() { distutils_python_tkinter # Fail if no tkinter support. dodir ${MODULE_DIR} cp -R modules/* ${D}/${MODULE_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} insinto ${LIB_DIR} doins code/*.py newgamesbin Dragon_Hunt_Linux ${PN} newgamesbin Map_Editor ${PN}-mapeditor dodoc README.txt GPL.txt PKG-INFO tiles.txt } pkg_postinst() { einfo "" einfo "If you use the map editor then note that maps will be saved as" einfo "~/dh_map.txt and must be move to the correct module directory" einfo "(within ${MODULE_DIR}) by hand." einfo "" }