summaryrefslogtreecommitdiff
blob: aa17605dbb51e7508a9d39ddc1c868abb3a2a754 (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
80
81
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-strategy/freeciv/freeciv-1.14.2.ebuild,v 1.3 2005/05/16 21:59:21 yoswink Exp $

inherit games

MY_P=${PN}-${PV/_/-}
S="${WORKDIR}/${MY_P}"
DESCRIPTION="multiplayer strategy game (Civilization Clone)"
HOMEPAGE="http://www.freeciv.org/"
SRC_URI="ftp://ftp.freeciv.org/freeciv/stable/${MY_P}.tar.bz2
	http://www.freeciv.org/ftp/contrib/sounds/sets/stdsounds2.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ppc sparc amd64 ~alpha"
IUSE="X Xaw3d gtk gtk2 nls readline"

RDEPEND="X? ( virtual/x11 )
	Xaw3d? ( x11-libs/Xaw3d )
	readline? ( sys-libs/readline )
	sys-libs/zlib
	>=media-libs/libsdl-1.1.4
	media-libs/sdl-mixer
	media-libs/sdl-image
	gtk? (
			gtk2? (
				>=x11-libs/gtk+-2.0.0
				>=dev-libs/glib-2.0.0
				>=dev-libs/atk-1.0.3
				>=x11-libs/pango-1.0.5
			)
			!gtk2? (
				=x11-libs/gtk+-1*
				>=dev-libs/glib-1.2.5
				>=media-libs/imlib-1.9.2
			)
		)"
DEPEND="${RDEPEND}
	nls? ( sys-devel/gettext )
	>=sys-apps/sed-4"

src_compile() {
	local myclient="no"
	use X && myclient="xaw"
	use Xaw3d && myclient="xaw3d"
	if use gtk ; then
		use gtk2 \
			&& myclient="gtk-2.0" \
			|| myclient="gtk"
	fi
	egamesconf \
		--disable-dependency-tracking \
		--with-zlib \
		$(use_with readline) \
		$(use_enable nls) \
		--enable-client=${myclient} \
		|| die
	# Grrrr, the locale location is hard-coded in configure.in to be
	# '${prefix}/share/locale'.  That is so wrong. (Bug 40253)
	if use nls ; then
		sed -i \
			-e "/LOCALEDIR/ s:\".*:\"${GAMES_DATADIR}/locale\":" config.h \
				|| die "locale fixup failed"
	fi
	emake || die "emake failed"
}

src_install() {
	make DESTDIR="${D}" install || die "make install failed"

	insinto /usr/X11R6/lib/X11/app-defaults
	doins data/Freeciv || die "doins failed"

	dodoc ChangeLog INSTALL NEWS \
		doc/{BUGS,CodingStyle,HACKING,HOWTOPLAY,PEOPLE,README*,TODO} \
			|| die "dodoc failed"
	# install sounds
	cp -R ../stdsounds* "${D}${GAMES_DATADIR}/${PN}"
	prepgamesdirs
}