summaryrefslogtreecommitdiff
blob: 21035972238238b780824a0490a1a24b9ef87a94 (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-strategy/xscorch/xscorch-0.1.16_rc2.ebuild,v 1.5 2004/06/24 23:30:56 agriffis Exp $

inherit eutils games

S="${WORKDIR}/xscorch-0.1.15"
DESCRIPTION="clone of the classic DOS game, 'Scorched Earth'"
HOMEPAGE="http://chaos2.org/xscorch/"
SRC_URI="http://chaos2.org/xscorch/${PN}-0.1.15.tar.gz
	http://utoxin.kydance.net/xscorch/${PN}-0.1.15.tar.gz
	http://chaos2.org/xscorch/xscorch-0.1.15-0.1.16pre2.patch.gz"

LICENSE="GPL-2"
KEYWORDS="~x86 ~ppc ~alpha ~amd64"
SLOT="0"

IUSE="gtk mikmod readline gnome"

RDEPEND="virtual/x11
	gtk? ( =x11-libs/gtk+-1* )
	mikmod? ( >=media-libs/libmikmod-3.1.5 )
	readline? ( sys-libs/readline )
	gnome? ( gnome-base/gnome-libs )"
DEPEND="${RDEPEND}
	>=sys-apps/sed-4"

src_unpack() {
	local HELPFILE="${GAMES_DATADIR}/${PN}/xscorch.help"

	unpack ${A}
	cd ${WORKDIR}
	epatch xscorch-0.1.15-0.1.16pre2.patch
	cp ${S}/doc/xscorch.6 ${S}/xscorch.help || \
		die "xscorch.help creation failed"
	sed -i \
		-e "/SC_GROFF_MANUAL_FILE/ s:@mandir@/man6/xscorch.6:${HELPFILE}:" \
			${S}/xscorch.h.in || die "sed xscorch.h.in failed"

}

src_compile() {
	local myconf=""
	use mikmod \
		&& myconf="--enable-sound=yes" \
		|| myconf="--enable-sound=no"
	egamesconf \
		--enable-network \
		--with-readline=maybe \
		`use_with gtk` \
		`use_with gnome` \
		${myconf} \
		|| die
	emake || die "emake failed"
}

src_install() {
	make DESTDIR=${D} install || die "make install failed"
	insinto "${GAMES_DATADIR}/${PN}"
	doins xscorch.help || die "doins failed"
	dodoc AUTHORS ChangeLog NEWS README TODO || die "dodoc failed"
	prepgamesdirs
}