summaryrefslogtreecommitdiff
blob: 534bf57128c82dfbb67cdd3ac412ef50c067d76f (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
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-board/xscrabble/xscrabble-2.10-r1.ebuild,v 1.6 2006/09/29 22:04:45 wolf31o2 Exp $

inherit eutils multilib games

DESCRIPTION="An X11 clone of the well-known Scrabble"
HOMEPAGE="http://freshmeat.net/projects/xscrabble/?topic_id=80"
SRC_URI="ftp://ftp.ac-grenoble.fr/ge/educational_games/${P}.tgz
	linguas_fr? ( ftp://ftp.ac-grenoble.fr/ge/educational_games/xscrabble_fr.tgz )
	ftp://ftp.ac-grenoble.fr/ge/educational_games/xscrabble_en.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 ~ppc-macos x86"
IUSE="linguas_fr"

RDEPEND="x11-libs/libXaw
	x11-libs/libXp"
DEPEND="${RDEPEND}
	x11-misc/gccmakedep
	x11-misc/imake"

src_unpack() {
	unpack ${P}.tgz
	cp "${DISTDIR}"/xscrabble_en.tgz .
	use linguas_fr && cp "${DISTDIR}"/xscrabble_fr.tgz .
	cd "${S}"
	epatch "${FILESDIR}"/${P}-path-fixes.patch
	sed -i '/install/s/-s //' build || die "sed failed"
}

src_compile() {
	./build bin || die "build failed"
}

src_install() {
	local f
	export DESTDIR="${D}" LIBDIR="$(get_libdir)"
	./build install || die "install failed"
	if use linguas_fr ; then
		./build lang fr || die "fr failed"
	fi
	./build lang en || die "en failed"
	for f in "${D}"/usr/"${LIBDIR}"/X11/app-defaults/* ; do
		[[ -L ${f} ]] && continue
		sed -i \
			-e "s:/usr/games/lib/scrabble/:${GAMES_DATADIR}/${PN}/:" \
			-e "s:fr/eng:fr/en:" \
			${f} || die "sed ${f} failed"
	done
	dodoc CHANGES README
	prepgamesdirs
}