summaryrefslogtreecommitdiff
blob: 1732f621030cf090d9f5d6f95a4ce7c21acb4965 (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-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-roguelike/angband/angband-3.0.9e.ebuild,v 1.4 2010/01/07 22:04:12 josejx Exp $

EAPI=2
inherit eutils flag-o-matic games

DESCRIPTION="A roguelike dungeon exploration game based on the books of J.R.R.Tolkien"
HOMEPAGE="http://rephial.org/"
SRC_URI="http://rephial.org/downloads/3.0/${P}.tar.gz"

LICENSE="Moria"
SLOT="0"
KEYWORDS="amd64 ppc x86 ~x86-fbsd"
IUSE="X gtk ncurses sdl"

DEPEND="gtk? ( >=gnome-base/libglade-2.6 )
	X? ( x11-libs/libSM
		 x11-libs/libX11 )
	sdl? ( media-libs/sdl-ttf
		   media-libs/sdl-image )"

PATCHES=( "${FILESDIR}"/${P}-gentoo.patch )

src_configure() {
	local myConf;
	if ! use ncurses && ( use gtk || use X || use sdl); then
		myConf=--disable-curses
	fi
	append-ldflags -Wl,-z,now
	egamesconf \
		--disable-dependency-tracking \
		--bindir="${GAMES_BINDIR}" \
		--with-setgid="${GAMES_GROUP}" \
		--with-libpath="${GAMES_DATADIR}"/${PN} \
		$myConf \
		$(use_enable gtk) \
		$(use_enable X x11) \
		$(use_enable sdl)
}

src_install() {
	emake DESTDIR="${D}" install || die "emake install failed"
	insinto "${GAMES_DATADIR}"/${PN}/xtra
	doins lib/xtra/angband.glade || die "doins angband.glade failed"
	dodoc changes.txt faq.txt readme.txt thanks.txt
	rm -rf "${D}/${GAMES_PREFIX}"/{lib,include}
	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	chmod -R g+w "${ROOT}${GAMES_DATADIR}"/angband/{apex,data,save,user}
}