# ChangeLog for games-fps/cube
-# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/games-fps/cube/ChangeLog,v 1.9 2004/11/12 16:02:04 blubb Exp $
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/games-fps/cube/ChangeLog,v 1.10 2005/09/25 01:14:19 vapier Exp $
+
+*cube-20050829 (25 Sep 2005)
+
+ 25 Sep 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/cube-20050829-gentoo-paths.patch, +cube-20050829.ebuild:
+ Version bump #104292 by a bunch of peeps.
11 Nov 2004; Simon Stelling <blubb@gentoo.org> cube-20040522.ebuild:
added ~amd64
-MD5 5eb42817dca0dde3c39764a4d9d8c7f5 cube-20040522.ebuild 2806
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 9d31d7c92bd530d524f47be584e37432 cube-20050829.ebuild 2818
MD5 f17b9b8fa07a38914fe1c03268f51678 metadata.xml 158
-MD5 05596d9f616656a13f2261463bb1a0b8 ChangeLog 1465
-MD5 0065c156760f7881f90a23993a89343d files/20040522-compile-fixes.patch 518
-MD5 f57600187e8eaa8d782ffd82c4aca198 files/20040522-gentoo-paths.patch 1423
+MD5 5eb42817dca0dde3c39764a4d9d8c7f5 cube-20040522.ebuild 2806
+MD5 aa2da7274b69b14df99ba4ebb3552a5c ChangeLog 1658
MD5 d27138da021db62a9bf34a7ed5cc4cbb files/cube_client-bin 64
MD5 fa21f6283022cf16fb521d15cd55b52d files/cube_server-bin 64
+MD5 fc22170f4e66a9c100254a281c8871a8 files/digest-cube-20050829 142
MD5 aeaa776eba3ed9e2b7938d190a8361b1 files/digest-cube-20040522 69
+MD5 f57600187e8eaa8d782ffd82c4aca198 files/20040522-gentoo-paths.patch 1423
+MD5 0065c156760f7881f90a23993a89343d files/20040522-compile-fixes.patch 518
+MD5 7ea8bd7da2fe80fdf9628413c1c1ac09 files/cube-20050829-gentoo-paths.patch 1282
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDNfoZgIKl8Uu19MoRAsggAJsFMyxUeEy1rM0Klm52ZxmX0+JvKwCfTcrd
+d3e2OXjXKorTLYFsMrdQq2I=
+=pcT8
+-----END PGP SIGNATURE-----
--- /dev/null
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/games-fps/cube/cube-20050829.ebuild,v 1.1 2005/09/25 01:14:19 vapier Exp $
+
+inherit eutils games
+
+MY_PV=${PV:0:4}_${PV:4:2}_${PV:6:2}
+MY_P=${PN}_${MY_PV}
+DESCRIPTION="Landscape-style engine that pretends to be an indoor first person shooter engine"
+HOMEPAGE="http://www.cubeengine.com/"
+SRC_URI="mirror://sourceforge/cube/${MY_P}_unix.tar.gz
+ mirror://sourceforge/cube/${MY_P}_src.zip"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~ppc ~x86"
+IUSE="dedicated"
+
+RDEPEND="virtual/opengl
+ virtual/glu
+ media-libs/libsdl
+ media-libs/sdl-mixer
+ media-libs/sdl-image
+ sys-libs/zlib
+ media-libs/libpng"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ >=sys-apps/sed-4"
+
+S=${WORKDIR}/cube_source
+S_BIN=${WORKDIR}/cube
+CUBE_DATADIR=${GAMES_DATADIR}/${PN}/
+
+src_unpack() {
+ unpack ${A}
+
+ cd "${S}"/src
+ epatch "${FILESDIR}"/${P}-gentoo-paths.patch
+ echo "#define GAMES_DATADIR \"${CUBE_DATADIR}\"" >> tools.h
+ echo "#define GAMES_DATADIR_LEN ${#CUBE_DATADIR}" >> tools.h
+ sed -i \
+ -e "s:packages/:${CUBE_DATADIR}packages/:" \
+ renderextras.cpp rendermd2.cpp sound.cpp worldio.cpp \
+ || die "fixing data path failed"
+ # enable parallel make
+ sed -i \
+ -e 's/make -C/$(MAKE) -C/' \
+ Makefile \
+ || die "sed Makefile failed"
+ edos2unix *.cpp
+ chmod a+x "${S}"/enet/configure
+}
+
+src_compile() {
+ cd enet
+ egamesconf || die "egamesconf failed"
+ emake || die "emake failed"
+ cd ../src
+ einfo "Compiling in $(pwd)"
+ emake CXXOPTFLAGS="-DHAS_SOCKLEN_T=1 -fpermissive ${CXXFLAGS}" \
+ || die "emake failed"
+}
+
+src_install() {
+ dogamesbin src/cube_client || die "dogamesbin client failed"
+ if use dedicated ; then
+ dogamesbin src/cube_server "${S_BIN}"/bin_unix/linux_server \
+ || die "dogamesbin server failed"
+ fi
+ dodoc src/CUBE_TODO.txt
+
+ cd "${S_BIN}"
+ insinto "${CUBE_DATADIR}"
+ doins -r *.cfg data packages || die "cp failed"
+ dohtml -r docs readme.html
+
+ if [[ ${ARCH} == "x86" ]] ; then
+ exeinto "${GAMES_LIBDIR}"/${PN}
+ newexe bin_unix/linux_client cube_client || die "newexe server failed"
+ games_make_wrapper cube_client-bin \
+ "${GAMES_LIBDIR}"/${PN}/cube_client "${GAMES_DATADIR}"/${PN} \
+ || die "games_make_wrapper client failed"
+ make_desktop_entry cube_client-bin "Cube Client"
+ else
+ make_desktop_entry cube_client "Cube Client"
+ fi
+
+ prepgamesdirs
+}
+
+pkg_postinst() {
+ games_pkg_postinst
+ if [[ ${ARCH} == "x86" ]] ; then
+ einfo "You now have 2 clients and 2 servers:"
+ einfo "cube_client-bin prebuilt version (needed to play on public multiplayer servers)"
+ else
+ einfo "You only have 1 client and 1 server:"
+ fi
+ einfo "cube_client custom client built from source"
+ use dedicated && \
+ einfo "Parallel versions of the server have been installed"
+}
--- /dev/null
+--- tools.cpp
++++ tools.cpp
+@@ -100,8 +100,19 @@
+ \r
+ ///////////////////////// misc tools ///////////////////////\r
+ \r
++char *addfullpath(char *s) {\r
++ static char ret[256]; // choose a reasonable max buffer size\r
++ if (s[0] == '/') { return s; }\r
++ int slen = strlen(s);\r
++ memset(ret, 0x00, 256);\r
++ memcpy(ret, GAMES_DATADIR, GAMES_DATADIR_LEN);\r
++ memcpy(ret+GAMES_DATADIR_LEN, s, slen);\r
++ return ret;\r
++ }\r
++\r
+ char *path(char *s)\r
+ {\r
++ s = addfullpath(s);\r
+ for(char *t = s; t = strpbrk(t, "/\\"); *t++ = PATHDIV);\r
+ return s;\r
+ };\r
+--- rendergl.cpp.origin 2005-08-30 17:07:30.000000000 +0200
++++ rendergl.cpp 2005-08-30 17:12:52.000000000 +0200
+@@ -69,6 +69,7 @@
+ \r
+ bool installtex(int tnum, char *texname, int &xs, int &ys, bool clamp)\r
+ {\r
++ texname = addfullpath(texname);\r
+ SDL_Surface *s = IMG_Load(texname);\r
+ if(!s) { conoutf("couldn't load texture %s", texname); return false; };\r
+ if(s->format->BitsPerPixel!=24) { conoutf("texture must be 24bpp: %s", texname); return false; };\r
+--- tools.h
++++ tools.h
+@@ -110,6 +110,7 @@
+ \r
+ \r
+ \r
++extern char *addfullpath(char *s);
+ extern char *path(char *s);\r
+ extern char *loadfile(char *fn, int *size);\r
+ extern void endianswap(void *, int, int);\r
--- /dev/null
+MD5 e376c49ac209b095cb6d29490834d060 cube_2005_08_29_src.zip 482335
+MD5 e77f3cf85292bf61100d2f8511a254cc cube_2005_08_29_unix.tar.gz 30412318