summaryrefslogtreecommitdiff
blob: 69368153b0f1b168ce65f6a6d9017fb4aa1ae51b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-board/pysol/pysol-4.82-r2.ebuild,v 1.2 2007/04/05 01:20:53 nyhm Exp $

inherit eutils python games

PNX=pysol-cardsets
PVX=4.40
DESCRIPTION="An exciting collection of more than 200 solitaire card games"
HOMEPAGE="http://www.pysol.org/"
SRC_URI="mirror://gentoo/${P}.tar.bz2
	http://www.pysol.org/download/pysol/${P}-src.tar.bz2
	extra-cardsets? (
		http://ftp.debian.org/debian/pool/main/p/${PNX}/${PNX}_${PVX}.orig.tar.gz
	)"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 mips ppc ppc64 x86"
IUSE="extra-cardsets"

DEPEND="virtual/python"
RDEPEND="virtual/python
	>=games-board/pysol-sound-server-3.0
	>=dev-lang/tk-8.0"

pkg_setup() {
	python_tkinter_exists
	games_pkg_setup
}

src_unpack() {
	unpack ${A}
	cd "${S}"
	rm -f Makefile data/*.pyc
	epatch "${FILESDIR}"/${P}-sound-ok.patch #94234
	if use extra-cardsets; then
		mv ../${PNX}-${PVX}/README{,.extra}
		mv ../${PNX}-${PVX}/NEWS{,.extra}
		# Removing cardsets already shipped with pysol tar
		local cardset
		for cardset in cardset-2000 cardset-colossus cardset-hard-a-port \
			cardset-hexadeck cardset-kintengu cardset-oxymoron \
			cardset-tuxedo cardset-vienna-2k ; do
			rm -rf ../${PNX}-${PVX}/data/${cardset}
		done
	fi
}

src_install() {
	insinto "$(games_get_libdir)"/${PN}
	doins -r src/* || 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 data/pysol.xpm
	make_desktop_entry pysol PySol pysol.xpm 'Game;CardGame'

	doman pysol.6
	dodoc NEWS README

	if use extra-cardsets; then
		doins -r ../${PNX}-${PVX}/data/* || die "Installing extra cardsets failed"
		dodoc ../${PNX}-${PVX}/{NEWS,README}.extra
	fi

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	python_mod_optimize "${ROOT}$(games_get_libdir)"/${PN}
}

pkg_postrm() {
	python_mod_cleanup "${ROOT}$(games_get_libdir)"/${PN}
}