summaryrefslogtreecommitdiff
blob: df3c352074efbf3bcaa892e28efcc17ba40bdece (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
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-arcade/njam/njam-1.00.ebuild,v 1.7 2004/06/24 22:09:24 agriffis Exp $

inherit eutils games

MY_P="${P}-src"
S="${WORKDIR}/${MY_P}"
DESCRIPTION="Multi or single-player network Pacman-like game in SDL"
HOMEPAGE="http://njam.sourceforge.net/"
SRC_URI="mirror://sourceforge/njam/${MY_P}.tar.gz"

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

RDEPEND=">=media-libs/sdl-mixer-1.2.5
	>=media-libs/sdl-image-1.2.2
	>=media-libs/libsdl-1.2.5
	>=media-libs/sdl-net-1.2.4"
DEPEND="${RDEPEND}
	>=sys-apps/sed-4"

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

	# store the conf file in the user's home directory.
	epatch ${FILESDIR}/${P}-conf.patch

	sed -i \
		-e "s:\"data:\"${GAMES_DATADIR}/${PN}/data:" njam.cpp njamgame.cpp \
		|| die "sed njam.cpp and njamgame.cpp failed"
	sed -i \
		-e "s:\"hiscore.dat:\"${GAMES_STATEDIR}/${PN}/hiscore.dat:" \
		-e "s:\"skins:\"${GAMES_DATADIR}/${PN}/skins:" njam.cpp \
		|| die "sed njam.cpp failed"
	sed -i \
		-e "s:\"levels:\"${GAMES_DATADIR}/${PN}/levels:" njamedit.cpp \
		|| die "sed njamedit.cpp failed"
	sed -i \
		-e "s:\"log.txt:\"/dev/null:" njamutils.cpp \
		|| die "sed njamutils.cpp failed"
	sed -i \
		-e "s:-O3:${CFLAGS}:" Makefile \
		|| die "sed Makefile failed"
}

src_compile() {
	emake PREFIX="/usr/share" || die "emake failed"
}

src_install() {
	dogamesbin njam || die "dogamesbin failed"
	dodoc CHANGES README TODO
	dohtml html/*
	insinto ${GAMES_DATADIR}/njam/data
	doins data/* || die "doins failed (data)"
	insinto ${GAMES_DATADIR}/njam/skins
	doins skins/* || die "doins failed (skins)"
	insinto ${GAMES_DATADIR}/njam/levels
	doins levels/* || die "doins failed (levels)"
	dodir ${GAMES_STATEDIR}/${PN}
	touch ${D}/${GAMES_STATEDIR}/${PN}/hiscore.dat
	fperms 664 ${GAMES_STATEDIR}/${PN}/hiscore.dat
	prepgamesdirs
}