summaryrefslogtreecommitdiff
blob: c9fe8207277053e2a1d1e62601ee7558a585a0e8 (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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-roguelike/zangband/zangband-2.7.3.ebuild,v 1.1 2003/09/10 04:59:58 vapier Exp $

inherit games

DESCRIPTION="An enhanced version of the Roguelike game Angband"
HOMEPAGE="http://www.zangband.org/"
SRC_URI="ftp://clockwork.dementia.org/angband/Variant/ZAngband/${P}.tar.gz"

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

DEPEND=">=sys-libs/ncurses-5
	>=sys-apps/sed-4
	X? ( >=x11-base/xfree-4.0 )"

S=${WORKDIR}/${PN}

src_compile() {
	# Version 2.7.3 won't configure without this
	export WANT_AUTOCONF_2_5=1

	local myconf="--with-setgid=${GAMES_GROUP}"
	use X || myconf="${myconf} --without-x"

	# Bootstrap and configure Zangband
	./bootstrap || die "bootstrapping failed"
	egamesconf ${myconf} || die

	# This fixes the games/games bug
	sed -i "s:${GAMES_DATADIR}:/usr/share:" makefile
	emake || die
}

src_install() {
	# Keep some important dirs we want to chmod later
	keepdir ${GAMES_DATADIR}/zangband/lib/apex
	keepdir ${GAMES_DATADIR}/zangband/lib/user
	keepdir ${GAMES_DATADIR}/zangband/lib/save

	# Install the basic files but remove unneeded crap
	make DESTDIR=${D}/${GAMES_DATADIR}/zangband/ installbase || die
	rm ${D}/${GAMES_DATADIR}/zangband/{angdos.cfg,readme,z_faq.txt,z_update.txt}

	# Install everything else and fix the permissions
	exeinto /usr/games/bin
	doexe zangband
	dodoc readme z_faq.txt z_update.txt

	prepgamesdirs
	# All users in the games group need write permissions to some important dirs
	chmod -R g+w ${D}/${GAMES_DATADIR}/zangband/lib/{apex,save,user}
}