summaryrefslogtreecommitdiff
blob: 8923990be40c8cb0642d810e8c48c99b4dc06380 (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
69
70
71
72
73
74
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-rpg/eternal-lands/eternal-lands-1.0.0.ebuild,v 1.5 2005/01/28 19:59:14 mr_bones_ Exp $

inherit games

DESCRIPTION="An online MMORPG written in C and SDL"
HOMEPAGE="http://www.eternal-lands.com"
TMP_PV=${PV%_p*}
SRC_URI="http://el.tfm.ro/el_${TMP_PV//.}.zip
	ftp://ftp.berlios.de/pub/elc/elc_${PV//.}.tgz"

LICENSE="eternal_lands"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE=""

RDEPEND="virtual/x11
	virtual/opengl
	>=media-libs/libsdl-1.2.5
	>=media-libs/sdl-net-1.2.5
	>media-libs/openal-20020127
	media-libs/libvorbis
	>=dev-libs/libxml2-2.6.7"
DEPEND="${RDEPEND}
	app-arch/unzip"

S="${WORKDIR}/elc"

src_unpack() {
	unpack ${A}
	cd "${S}"
	sed \
		-e "s@CFLAGS=\$(PLATFORM) -Wall -ggdb -pipe@CFLAGS=${CFLAGS}@g" \
		-e 's@OPTIONS=@OPTIONS=-DDATA_DIR="\\"${GAMES_DATADIR}/${PN}/\\"" @g' \
		Makefile.linux > Makefile \
		|| die "sed failed"
	sed \
		-e 's/#browser/browser/g' \
		-e 's/browser = mozilla/#browser = mozilla/g' \
		-e "s@data_dir = /usr/local/games/el/@#data_dir = ${GAMES_DATADIR}/${PN}/@g" \
		el.ini > ../el.ini \
		|| die "sed failed"
	cd ..
	cp license.txt EULA || die "cp failed"
	rm -fr Encyclopedia/images/.xvpics
}

src_compile() {
	emake || die "emake failed"
	cp el.x86.linux.bin ../el.x86.linux.bin || die "cp failed"
}

src_install () {
	cd "${WORKDIR}"
	insinto "${GAMES_DATADIR}/${PN}"
	newgamesbin el.x86.linux.bin el
	dodoc changes.txt faq.txt readme.txt EULA
	doins el.ini *.lst el_icon.png icon.bmp global_filters.txt global_ignores.txt \
		|| die "Files failed to be installed"
	cp -R 2dobjects 3dobjects Encyclopedia maps md2 sound textures tiles \
		"${D}/${GAMES_DATADIR}/${PN}" \
		|| die "copy failed"
	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst
	echo
	einfo "To run the game: el"
	einfo "Copy ${GAMES_DATADIR}/${PN}/el.ini to ~/.elc/"
	einfo "to make per-user changes."
	echo
}