summaryrefslogtreecommitdiff
blob: f4a4215adc686d7d9f5c8b5a424788ebc6e7db36 (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
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-action/maelstrom/maelstrom-3.0.6-r1.ebuild,v 1.2 2003/12/12 09:31:27 avenj Exp $

inherit eutils games

MY_P=Maelstrom-${PV}
S="${WORKDIR}/${MY_P}"
DESCRIPTION="An asteroids battle game"
SRC_URI="http://www.devolution.com/~slouken/Maelstrom/src/${MY_P}.tar.gz"
HOMEPAGE="http://www.devolution.com/~slouken/Maelstrom/"

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

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

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

	epatch ${FILESDIR}/${P}-security.patch

	# Install the data into $(datadir)/..., not $(prefix)/games/...
	sed -i \
		-e "s:(prefix)/games/:(datadir)/:" configure || \
			die "sed configure failed"
	# Install the high scores file in ${GAMES_STATEDIR}
	sed -i \
		-e "s:path.Path(MAELSTROM_SCORES):\"${GAMES_STATEDIR}/\"MAELSTROM_SCORES:" scores.cpp || \
			die "sed scores.cpp failed"
}

src_install() {
	egamesinstall || die
	dodoc Changelog README* Docs/{Maelstrom-Announce,*FAQ,MaelstromGPL_press_release,*.Paper,Technical_Notes*} || \
		die "dodoc failed"
	insinto /usr/share/pixmaps
	newins ${D}${GAMES_DATADIR}/Maelstrom/icon.xpm maelstrom.xpm || \
		die "newins failed"
	make_desktop_entry Maelstrom "Maelstrom" maelstrom.xpm

	# Put the high scores file in the right place
	insinto ${GAMES_STATEDIR}
	doins ${D}${GAMES_DATADIR}/Maelstrom/Maelstrom-Scores || die "doins failed"
	rm -f ${D}${GAMES_DATADIR}/Maelstrom/Maelstrom-Scores

	# clean up some cruft
	rm -f ${D}${GAMES_DATADIR}/Maelstrom/Images/Makefile*
	prepgamesdirs

	# make sure we can update the high scores
	fperms 664 ${GAMES_STATEDIR}/Maelstrom-Scores         || die "fperms failed"
}