summaryrefslogtreecommitdiff
blob: 4b097ae6c2649371c9f6d9a95b772a992419a3b9 (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
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-action/cs2d/cs2d-0119.ebuild,v 1.1 2011/09/18 12:53:25 maksbotan Exp $

EAPI=2

inherit eutils games

DESCRIPTION="Counter-Strike 2D is freeware clone of Counter-Strike with some added features in gameplay."
HOMEPAGE="http://www.cs2d.com/"
SRC_URI="http://dev.gentoo.org/~maksbotan/cs2d/cs2d_${PV}_linux.zip
	http://dev.gentoo.org/~maksbotan/cs2d/cs2d_${PV}_win.zip"
LICENSE="freedist"

SLOT="0"
KEYWORDS="-* ~amd64 ~x86"
IUSE=""

DEPEND=""
RDEPEND="x86? (
		media-libs/openal )
	amd64? (
		app-emulation/emul-linux-x86-sdl
	)"

QA_PRESTRIPPED="opt/cs2d/CounterStrike2D"
QA_EXECSTACK="opt/cs2d/CounterStrike2D"

S="${WORKDIR}"

src_unpack() {
	unpack ${A}

	# removing windows files
	rm -f *.exe *.bat
}

src_install() {
	insinto "${GAMES_PREFIX_OPT}/${PN}"
	doins -r . || die

	doicon "${FILESDIR}/cs2d.png"

	make_desktop_entry CounterStrike2D "Counter Strike 2D"
	make_desktop_entry "CounterStrike2D -fullscreen -24bit" "Counter Strike 2D - FULLSCREEN"
	games_make_wrapper CounterStrike2D ./CounterStrike2D \
		"${GAMES_PREFIX_OPT}"/${PN} "${GAMES_PREFIX_OPT}"/${PN}

	prepgamesdirs

	# OpenAL is default sound driver
	sed -i 's:FreeAudio DirectSound:OpenAL Default:' "${D}/${GAMES_PREFIX_OPT}/${PN}/sys/config.cfg"

	# fixing permissions
	chmod -R g+w "${D}/${GAMES_PREFIX_OPT}/${PN}/maps"
	chmod -R g+w "${D}/${GAMES_PREFIX_OPT}/${PN}/screens"
	chmod -R g+w "${D}/${GAMES_PREFIX_OPT}/${PN}/sys"
	fperms ug+x "${GAMES_PREFIX_OPT}/${PN}/CounterStrike2D"
}