summaryrefslogtreecommitdiff
path: root/games-fps/redeclipse/redeclipse-1.3.1.ebuild
blob: dfab85bea6fe6f78964b85a800ec50d170853907 (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
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3

inherit eutils games

DESCRIPTION="First-person ego-shooter, built as a total conversion of Cube Engine 2"
HOMEPAGE="http://www.redeclipse.net/"
SRC_URI="mirror://sourceforge/${PN}/${PN}_${PV}_all.tar.bz2"

LICENSE="as-is ZLIB CCPL-Attribution-ShareAlike-3.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="dedicated"

DEPEND="!dedicated? (
		media-libs/libsdl[opengl]
		media-libs/sdl-image[jpeg,png]
		media-libs/sdl-mixer[mp3,vorbis]
		virtual/opengl
		x11-libs/libX11
	)
	net-libs/enet:1.3
	sys-libs/zlib
"
RDEPEND="${DEPEND}"

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

src_prepare() {
	cd "${S}" || die
	sed -i -e "s:\(addpackagedir(\"\)data:\1${GAMES_DATADIR}/${PN}/data:" \
		src/engine/server.cpp || die "Sed failed"

	sed -i \
		-e "s:\(client\)\: libenet:\1\::" \
		-e   "s:\(server\)\: libenet:\1\::" \
		src/Makefile || die "Sed failed"

	sed -i "/STRIP=strip/d" src/Makefile || die "Sed failed"
}

src_compile() {
	cd src || die
	if ! use dedicated ; then
		emake CXXFLAGS="${CXXFLAGS}" client server || die
	else
		emake CXXFLAGS="${CXXFLAGS}" server || die
	fi
}

src_install() {
	newgamesbin src/reserver ${PN}-server || die
	dodir "${GAMES_DATADIR}"/${PN}/ || die 
	insinto "${GAMES_DATADIR}"/${PN}/ || die
	doins -r "${S}"/data || die

	dodoc readme.txt
	if ! use dedicated ; then
		newgamesbin src/reclient "${PN}" || die
	fi
	prepgamesdirs
}