# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit eutils python games PNX="${PN}-Cardsets" PVX=1.1 DESCRIPTION="PySolFC is a collection of more than 1000 solitaire card games. It is a fork of PySol Solitaire." HOMEPAGE="http://pysolfc.sourceforge.net/" SRC_URI="mirror://gentoo/${PF}.tar.bz2 http://downloads.sourceforge.net/pysolfc/${PF}.tar.bz2 extra-cardsets? ( http://downloads.sourceforge.net/pysolfc/${PNX}-${PVX}.tar.bz2 mirror://debian/pool/main/p/${PNX}/${PNX}-${PVX}.tar.bz2 )" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86" IUSE="extra-cardsets" DEPEND="virtual/python" RDEPEND="virtual/python >=dev-lang/tk-8.4" pkg_setup() { python_tkinter_exists games_pkg_setup } src_unpack() { unpack ${A} cd "${S}" rm -f Makefile # skip compilation mv data/pysol.xpm . # save the useful icon rm -f data/{PySol.icns,pysol.ico,pysol.xbm} # and remove the rest find ${S} -name "*.py[co]" -delete # these will be recreated later mv data/html/ . # this should not be installed with data # put a valid search path for data on the settings sed -i "s:/usr/share/PySolFC:${GAMES_DATADIR}/${PN}/:g" pysollib/settings.py if use extra-cardsets; then # remove the cardsets that come in the main tar # but only if they come on the extra tar as well local cardset for cardset in `ls ../${PNX}-${PVX}/`; do rm data/${cardset##*/} -rf done # and put the extra cardsets in its place mv ../${PNX}-${PVX}/* data/ fi } src_install() { insinto "$(games_get_libdir)"/${PN} doins -r pysol.py pysollib || die "src failed" games_make_wrapper ${PN} "python ./pysol.py" "$(games_get_libdir)"/${PN} insinto "${GAMES_DATADIR}"/${PN} doins -r data/* || die "data failed" doicon pysol.xpm make_desktop_entry PySolFC PySolFC pysol.xpm 'Game;CardGame' doman docs/pysol.6 dodoc README dohtml html/* domo po/ru.po #the html dir needs to appear in the data dir as well dosym "../../doc/${PF}"/html/ "${GAMES_DATADIR}"/${PN} prepgamesdirs } pkg_postinst() { python_mod_optimize "$(games_get_libdir)"/${PN} games_pkg_postinst } pkg_postrm() { python_mod_cleanup "$(games_get_libdir)"/${PN} }