summaryrefslogtreecommitdiff
blob: 76dca6dfaae453a262780bf14d4d7f0802629a6f (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-strategy/attal/attal-0.7.2.ebuild,v 1.4 2004/06/24 23:26:06 agriffis Exp $

inherit 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="x86"
IUSE=""

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

S="${WORKDIR}/${MY_P}"

src_unpack() {
	unpack ${A}
	cd ${S}
	for lib in Client Common Fight Server ; do
		sed -i \
			-e "/^TARGET/s:= ${lib}:= ${PN}${lib}:" \
			-e "s:lib${lib}\.so:lib${PN}${lib}.so:g" \
			-e "s:-l${lib}:-l${PN}${lib}:g" \
			*/*.pro \
			|| die "renaming ${lib}"
	done
	qmake -o Makefile Makefile.pro || die "qmake failed"
	sed -i \
		"s:\./themes/:${GAMES_DATADIR}/${PN}/themes/:" \
		`grep -Rl '\./themes/' *` \
		|| die "fixing theme loc"
}

src_compile() {
	emake -j1 \
		CFLAGS="${CFLAGS} -fPIC" \
		CXXFLAGS="${CXXFLAGS} -fPIC" \
		|| die
}

src_install() {
	exeinto ${GAMES_LIBDIR}
	local lib=""
	local nlib=""
	for lib in lib*.so.${PV} ; do
		doexe ${lib}
		nlib=${lib/.${PV}}
		for v in ${PV//./ } ; do
			dosym ${lib} ${GAMES_LIBDIR}/${nlib}.${v}
		done
		dosym ${lib} ${GAMES_LIBDIR}/${nlib}
	done
	dogamesbin attal-*
	newgamesbin scenario-editor attal-scenario-editor
	newgamesbin theme-editor attal-theme-editor
	dodir ${GAMES_DATADIR}/${PN}
	cp -r ${WORKDIR}/themes-${PV} ${D}/${GAMES_DATADIR}/${PN}/themes
	dodoc AUTHORS NEWS README TODO
	prepgamesdirs
}