summaryrefslogtreecommitdiff
blob: 860ce0f7f1cb4a80208c41beb411471738d7d0d6 (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
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-arcade/cdogs-sdl/cdogs-sdl-0.4.ebuild,v 1.1 2009/02/26 21:47:21 mr_bones_ Exp $

EAPI=2
inherit eutils games

CDOGS_DATA="cdogs-data-2007-07-06"
DESCRIPTION="A port of the old DOS arcade game C-Dogs"
HOMEPAGE="http://lumaki.com/code/cdogs"
SRC_URI="http://icculus.org/cdogs-sdl/files/src/${P}.tar.bz2
	http://icculus.org/cdogs-sdl/files/data/${CDOGS_DATA}.tar.bz2"

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

DEPEND="media-libs/libsdl
	media-libs/sdl-mixer"

S=${WORKDIR}/${P}/src

src_unpack() {
	unpack ${A}
	mv ${CDOGS_DATA} ${P}/data || die "Failed moving data around"
}

src_prepare() {
	sed -i \
		-e "/^CF_OPT/d" \
		-e "/^CC/d" \
		Makefile \
		|| die "sed failed"
	sed -i \
		-e "/\bopen(/s/)/, 0666)/" \
		files.c \
		|| die "sed failed"
}

src_compile() {
	emake I_AM_CONFIGURED=yes \
		SYSTEM="\"linux\"" \
		STRIP=true \
		DATADIR="${GAMES_DATADIR}/${PN}" \
		cdogs || die "emake failed"
}

src_install() {
	dogamesbin cdogs || die "dogamesbin failed"
	insinto "${GAMES_DATADIR}/${PN}"
	doins -r ../data/*
	newicon ../data/cdogs_icon.png ${PN}.png
	dodoc ../doc/{README,AUTHORS,ChangeLog,README_DATA,TODO,original_readme.txt}
	make_desktop_entry "cdogs -fullscreen" C-Dogs
	prepgamesdirs
}