summaryrefslogtreecommitdiff
blob: d6fe5333202ea88b5a38d38a84f018a36adb33e7 (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
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-strategy/attal/attal-0.9.3.ebuild,v 1.1 2005/06/03 05:36:12 mr_bones_ Exp $

inherit eutils flag-o-matic games

MY_P="${PN}-src-${PV}"
DESCRIPTION="turn-based strategy game project"
HOMEPAGE="http://www.attal-thegame.org/"
SRC_URI="mirror://sourceforge/attal/${MY_P}.tar.bz2
	mirror://sourceforge/attal/themes-${PV}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="ppc x86"
IUSE=""

DEPEND=">=x11-libs/qt-3*"

S=${WORKDIR}/${MY_P}

src_unpack() {
	unpack ${A}
	cd "${S}"
	sed -i \
		-e "s:\"\./:\"${GAMES_BINDIR}/:" \
		server/serverInterface.cpp \
		client/clientInterface.cpp \
		|| die "sed failed"
	sed -i \
		-e "s:\"\./:\"${GAMES_DATADIR}/${PN}/:" \
		libCommon/displayHelp.cpp \
		|| die "sed failed"
	qmake -o Makefile Makefile.pro || die "qmake failed"
	sed -i \
		"s:\./themes/:${GAMES_DATADIR}/${PN}/themes/:" \
		`grep -Rl '\./themes/' *` \
		|| die "fixing theme loc"
	find "${WORKDIR}"/themes-${PV} -name .cvsignore -print0 | xargs -0 rm -f
}

src_compile() {
	# broken deps in the makefiles ...
	append-flags -fPIC
	emake \
		CFLAGS="${CFLAGS}" \
		CXXFLAGS="${CXXFLAGS}" \
		sub-libCommon || die "emake sub-libCommon failed"
	emake \
		CFLAGS="${CFLAGS}" \
		CXXFLAGS="${CXXFLAGS}" \
		sub-{libFight,libClient,libServer} || die "emake libs failed"
	emake \
		CFLAGS="${CFLAGS}" \
		CXXFLAGS="${CXXFLAGS}" \
		|| die "emake failed"
}

src_install() {
	dogamesbin attal-* || die "dogamesbin failed"
	into "${GAMES_PREFIX}"
	dolib.so lib*.so* || die "dolib.so failed"
	insinto "${GAMES_DATADIR}"/${PN}
	doins HOWTOPLAY.html
	insinto "${GAMES_DATADIR}"/${PN}/themes
	doins -r "${WORKDIR}"/themes-${PV}/* || die "doins themes failed"
	dodoc AUTHORS NEWS README TODO
	prepgamesdirs
}