summaryrefslogtreecommitdiff
blob: 90a2aad91d221f490b6fa8d8dd60055f3f669f58 (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-misc/bsd-games-non-free/bsd-games-non-free-2.13.ebuild,v 1.5 2004/06/24 22:53:24 agriffis Exp $

inherit games

DESCRIPTION="collection of games from NetBSD"
HOMEPAGE="http://www.advogato.org/proj/bsd-games/"
SRC_URI="ftp://metalab.unc.edu/pub/Linux/games/${P}.tar.gz"

# See /usr/share/doc/${P}/COPYRIGHT.hack and CHANGES.rogue
LICENSE="BSD | free-noncomm"
SLOT="0"
KEYWORDS="x86"
IUSE=""

DEPEND="sys-libs/ncurses
	sys-apps/miscfiles
	sys-apps/less
	sys-devel/bison
	sys-devel/flex"

# Set GAMES_TO_BUILD variable to whatever you want
export GAMES_TO_BUILD=${GAMES_TO_BUILD:="hack rogue"}

src_unpack() {
	unpack ${A} ; cd ${S}

	cp ${FILESDIR}/config.params-gentoo config.params
	echo bsd_games_cfg_build_dirs=\"${GAMES_TO_BUILD}\" >> ./config.params
}

src_compile() {
	./configure || die
	make OPTIMIZE="${CFLAGS}" || die
}

build_game() { has ${1} ${GAMES_TO_BUILD}; }
do_statefile() {
	touch ${D}/${GAMES_STATEDIR}/${1}
	chmod ug+rw ${D}/${GAMES_STATEDIR}/${1}
}
src_install() {
	dodir ${GAMES_BINDIR} ${GAMES_STATEDIR} /usr/share/man/man{1,6}
	make DESTDIR=${D} install-strip || die

	dodoc AUTHORS BUGS COPYING ChangeLog ChangeLog.0 INSTALL NEWS \
		  PACKAGING README README.non-free SECURITY THANKS TODO YEAR2000 \
		  bsd-games-non-free.lsm

	# set some binaries to run as games group (+S)
	[ `build_game rogue` ] && fperms g+s ${GAMES_BINDIR}/rogue

	# state files
	[ `build_game hack` ] && keepdir ${GAMES_STATEDIR}/hack && chmod ug+rw ${GAMES_STATEDIR}/hack
	[ `build_game rogue` ] && do_statefile rogue.scores

	# extra docs
	[ `build_game hack` ] && { docinto hack ; dodoc hack/{COPYRIGHT,OWNER,Original_READ_ME,READ_ME,help}; }
	[ `build_game rogue` ] && { docinto rogue ; dodoc rogue/{CHANGES,USD.doc/rogue.me; }

	prepalldocs
	prepgamesdirs
}