/[gentoo-x86]/games-rpg/eternal-lands/eternal-lands-1.9.2.ebuild
Gentoo

Contents of /games-rpg/eternal-lands/eternal-lands-1.9.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Jun 18 18:26:02 2011 UTC (2 years, 9 months ago) by rich0
Branch: MAIN
CVS Tags: HEAD
version bump - 372181

(Portage version: 2.1.9.42/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/games-rpg/eternal-lands/eternal-lands-1.9.1.ebuild,v 1.2 2011/03/19 19:33:05 rich0 Exp $
4
5 EAPI=2
6 inherit eutils flag-o-matic games
7
8 DESCRIPTION="An online MMORPG written in C and SDL"
9 HOMEPAGE="http://www.eternal-lands.com"
10 SRC_URI="http://dev.gentoo.org/~rich0/distfiles/elc_1.9.2-20110618.tar.bz2
11 http://dev.gentoo.org/~rich0/distfiles/eternal-lands.png"
12
13 LICENSE="eternal_lands"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86 ~x86-fbsd"
16 IUSE="debug doc kernel_linux"
17
18 RDEPEND="x11-libs/libX11
19 x11-libs/libXau
20 x11-libs/libXdmcp
21 x11-libs/libXext
22 virtual/opengl
23 virtual/glu
24 media-libs/libsdl[X]
25 media-libs/sdl-net
26 media-libs/sdl-image
27 media-libs/openal
28 media-libs/freealut
29 media-libs/libvorbis
30 dev-libs/libxml2
31 media-libs/cal3d[-16bit-indices]
32 media-libs/libpng
33 >=games-rpg/eternal-lands-data-1.9.2"
34
35 DEPEND="${RDEPEND}
36 >=app-admin/eselect-opengl-1.0.6-r1
37 app-arch/unzip
38 doc? ( app-doc/doxygen
39 media-gfx/graphviz )"
40
41 #ECVS_SERVER="cvs.elc.berlios.de:/cvsroot/elc"
42 #ECVS_MODULE="elc"
43 #ECVS_USER="anonymous"
44 #ECVS_LOCALNAME="elc"
45 #ECVS_PASS=""
46 #ECVS_CVS_OPTIONS="-dP -z3"
47 #ECVS_BRANCH="elc_1_8_0"
48
49 #S="${WORKDIR}/${ECVS_MODULE}"
50 S="${WORKDIR}/elc"
51
52 src_unpack() {
53 # cvs_src_unpack
54 OPTIONS="-DDATA_DIR="\\\\\"${GAMES_DATADIR}/${PN}/\\\\\"""
55 S_CLIENT="${WORKDIR}/elc"
56 BROWSER="firefox"
57 unpack ${A}
58 cd "${S}"
59 }
60
61 src_prepare() {
62 # Add debugging options
63 if use debug ; then
64 OPTIONS="${OPTIONS} -DMEMORY_DEBUG"
65 append-flags -ggdb
66 fi
67
68 # Clean compile flags (make Gentoo friendly)
69 sed -i \
70 -e "s@CFLAGS=\$(PLATFORM) \$(CWARN) -O0 -ggdb -pipe@CFLAGS = ${CFLAGS} ${OPTIONS} @g" \
71 -e "s@CXXFLAGS=\$(PLATFORM) \$(CXXWARN) -O0 -ggdb -pipe@CXXFLAGS = ${CXXFLAGS} ${OPTIONS} @g" \
72 -e 's/lopenal/lopenal -l alut/' \
73 Makefile.linux || die "sed failed"
74
75 sed -i \
76 -e 's/#browser/browser/g' \
77 -e "s/browser = mozilla/#browser = ${BROWSER}/g" \
78 -e "s@#data_dir = /usr/local/games/el/@#data_dir = ${GAMES_DATADIR}/${PN}/@g" \
79 el.ini || die "sed failed"
80
81 # Support BSD in the Linux makefile - it's easier
82 use kernel_linux || sed -i \
83 -e 's/^CFLAGS=.*/& -DBSD/' \
84 Makefile.linux || die "sed failed"
85
86 # Clean up library flag order for --as-needed
87 # sed -i -e 's/@$(LINK) $(CFLAGS) $(LDFLAGS) -o $(EXE) $(OBJS)/@$(LINK) $(CFLAGS) -o $(EXE) $(OBJS) $(LDFLAGS)/' Makefile.linux
88
89 # Finally, update the server
90 sed -i -e '/#server_address =/ s/.*/#server_address = game.eternal-lands.com/' \
91 el.ini || die "sed failed"
92
93 sed -i -e 's:FEATURES:EL_FEATURES:' make.defaults
94 sed -i -e 's:FEATURES:EL_FEATURES:' Makefile.linux
95
96 if use debug; then
97 sed -i -e 's/#\(EL_FEATURES += MEMORY_DEBUG\)/\1/' make.defaults
98 sed -i -e 's/#\(EL_FEATURES += MEMORY_DEBUG\)/\1/' Makefile.linux
99 fi
100
101 cp Makefile.linux Makefile
102
103 epatch "${FILESDIR}/${PN}-1.9.2-glext.patch"
104 # epatch "${FILESDIR}/${PN}-1.9.1-libpng.patch"
105 }
106
107 src_compile() {
108 emake || die "make failed"
109
110 if use doc; then
111 emake docs || die "Failed to create documentation, try with USE=-doc"
112 mv ./docs/html/ ../client || die "Failed to move documentation directory"
113 fi
114 }
115
116 src_install() {
117 doicon "${DISTDIR}/eternal-lands.png" ${PN}.png
118
119 newgamesbin el.x86.linux.bin el \
120 || die "newgamesbin failed"
121 make_desktop_entry el "Eternal Lands" \
122 || die "make_desktop_entry failed"
123 insopts -m 0660
124 insinto "${GAMES_DATADIR}/${PN}"
125
126 doins -r *.ini *.txt commands.lst \
127 || die "doins failed"
128
129 if use doc ; then
130 dohtml -r client/*
131 fi
132
133 prepgamesdirs
134 }
135
136 pkg_postinst() {
137 games_pkg_postinst
138 elog "Auto Update is now enabled in Eternal Lands"
139 elog "If an update occurs then the client will suddenly exit"
140 elog "Updates only happen when the game first loads"
141 elog "Please don't report this behaviour as a bug"
142
143 # Ensure that the files are writable by the game group for auto
144 # updating.
145 chmod -R g+rw "${ROOT}/${GAMES_DATADIR}/${PN}"
146
147 # Make sure new files stay in games group
148 find "${ROOT}/${GAMES_DATADIR}/${PN}" -type d -exec chmod g+sx {} \;
149
150 }

  ViewVC Help
Powered by ViewVC 1.1.20