diff options
author | Roy Marples <uberlord@gentoo.org> | 2006-07-04 22:50:25 +0000 |
---|---|---|
committer | Roy Marples <uberlord@gentoo.org> | 2006-07-04 22:50:25 +0000 |
commit | 3749b5ff294aaeab88deabefc812cba6f27a51ca (patch) | |
tree | f050155a149dc1f42e410c45ed4f4c671264e0e2 /games-rpg | |
parent | Version bump. (diff) | |
download | gentoo-2-3749b5ff294aaeab88deabefc812cba6f27a51ca.tar.gz gentoo-2-3749b5ff294aaeab88deabefc812cba6f27a51ca.tar.bz2 gentoo-2-3749b5ff294aaeab88deabefc812cba6f27a51ca.zip |
Version bump.
(Portage version: 2.1.1_pre2-r2)
Diffstat (limited to 'games-rpg')
4 files changed, 258 insertions, 1 deletions
diff --git a/games-rpg/eternal-lands/ChangeLog b/games-rpg/eternal-lands/ChangeLog index f4caf41e545f..bf0f159c0077 100644 --- a/games-rpg/eternal-lands/ChangeLog +++ b/games-rpg/eternal-lands/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for games-rpg/eternal-lands # Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-rpg/eternal-lands/ChangeLog,v 1.18 2006/07/03 07:02:39 uberlord Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-rpg/eternal-lands/ChangeLog,v 1.19 2006/07/04 22:50:25 uberlord Exp $ + +*eternal-lands-1.3.0 (04 Jul 2006) + + 04 Jul 2006; Roy Marples <uberlord@gentoo.org> + +files/eternal-lands-1.3.0-update-createdir.patch, + +eternal-lands-1.3.0.ebuild: + Version bump. *eternal-lands-1.2.0_p1-r4 (03 Jul 2006) diff --git a/games-rpg/eternal-lands/eternal-lands-1.3.0.ebuild b/games-rpg/eternal-lands/eternal-lands-1.3.0.ebuild new file mode 100644 index 000000000000..b9c73c5902c5 --- /dev/null +++ b/games-rpg/eternal-lands/eternal-lands-1.3.0.ebuild @@ -0,0 +1,110 @@ +# Copyright 1999-2006 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.3.0.ebuild,v 1.1 2006/07/04 22:50:25 uberlord Exp $ + +inherit eutils games + +MY_PV="${PV//_/}" +MY_PV="${MY_PV//./}" +S="${WORKDIR}/elc" +DESCRIPTION="An online MMORPG written in C and SDL" +HOMEPAGE="http://www.eternal-lands.com" +SRC_URI="mirror://gentoo/elc_${MY_PV}.tar.bz2 + mirror://gentoo/eternal-lands.png" + +# NOTE: Sometimes you'll have to roll your own elc tarball from their CVS +# tree as they don't always release one. +# If they do then use this in SRC_URI instead +# ftp://ftp.berlios.de/pub/elc/elc_${MY_PV}.tgz + +LICENSE="eternal_lands" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="doc" + +RDEPEND=" + || ( ( + x11-libs/libX11 + x11-libs/libXau + x11-libs/libXdmcp + x11-libs/libXext ) + virtual/x11 ) + virtual/opengl + >=media-libs/libsdl-1.2.5 + >=media-libs/sdl-net-1.2.5 + ~media-libs/openal-0.0.8 + media-libs/freealut + media-libs/libvorbis + >=dev-libs/libxml2-2.6.7 + =media-libs/cal3d-0.10.0 + >=media-libs/libpng-1.2.8 + ~games-rpg/${PN}-data-${PV}" + +DEPEND="${RDEPEND} + app-arch/unzip + sys-apps/findutils + doc? ( >=app-doc/doxygen-1.3.8 + >=media-gfx/graphviz-1.10 )" + +src_unpack() { + OPTIONS="OPTIONS=-DDATA_DIR="\\\\\"${GAMES_DATADIR}/${PN}/\\\\\""" + S_CLIENT="${WORKDIR}/elc" + BROWSER="konqueror" + + unpack ${A} + cd "${S}" + + # Remove CVS entries + find . -type d -name CVS -exec rm -rf {} \; 2>/dev/null + + # Allow compiled vertex arrays to be togglable as they don't seem to work + # with xorg drivers on IGP style cards. + epatch "${FILESDIR}/${PN}-${PV}-update-createdir.patch" + + use amd64 && OPTIONS="${OPTIONS} -DX86_64" + sed \ + -e "s@CFLAGS=\$(PLATFORM) \$(CWARN) -O -ggdb -pipe@CFLAGS=${CFLAGS} @g"\ + -e "s@CXXFLAGS=\$(PLATFORM) \$(CXXWARN) -O -ggdb -pipe@CXXFLAGS=${CXXFLAGS} @g"\ + -e "s@OPTIONS=@${OPTIONS} @g" \ + -e 's/lopenal/lopenal -l alut/' \ + Makefile.linux > Makefile \ + || die "sed failed" + sed -i \ + -e 's/#browser/browser/g' \ + -e "s/browser = mozilla/#browser = ${BROWSER}/g" \ + -e "s@#data_dir = /usr/local/games/el/@#data_dir = ${GAMES_DATADIR}/${PN}/@g" \ + el.ini || die "sed failed" +} + +src_compile() { + emake || die "emake failed" + if use doc; then + emake docs || die "Failed to create documentation, try with USE=-doc" + mv ./docs/html/ ../client || die "Failed to move documentation directory" + fi +} + +src_install() { + newgamesbin el.x86.linux.bin el || die "newgamesbin failed" + doicon "${DISTDIR}/eternal-lands.png" + make_desktop_entry el "Eternal Lands" + + insopts -m 0660 + insinto "${GAMES_DATADIR}/${PN}" + doins *.ini *.txt commands.lst || die "doins failed" + + if use doc ; then + dohtml -r client/* + fi + + prepgamesdirs +} + +pkg_postinst() { + # Ensure that the files are writable by the game group for auto + # updating. + chmod -R g+rw "${ROOT}/${GAMES_DATADIR}/${MY_PN}" + + # Make sure new files stay in games group + find "${ROOT}/${GAMES_DATADIR}/${MY_PN}" -type d -exec chmod g+sx {} \; +} diff --git a/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0 b/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0 new file mode 100644 index 000000000000..2be8e9ed82f7 --- /dev/null +++ b/games-rpg/eternal-lands/files/digest-eternal-lands-1.3.0 @@ -0,0 +1,6 @@ +MD5 f83902ed603926a9611ace5914a3fdc0 elc_130.tar.bz2 849004 +RMD160 e5dc66b2db5203a13707170046874392e1908a06 elc_130.tar.bz2 849004 +SHA256 ffcd5779a0516e5ec3f6c1add718653284689023a92fcb9dfa3917076d8be140 elc_130.tar.bz2 849004 +MD5 059df8128b11b19a76b54e9907072f00 eternal-lands.png 9955 +RMD160 2f9c8acd96214577cf8b8027f0d20fb1fe7574ff eternal-lands.png 9955 +SHA256 dd7d45cd9948fe7875ebd0bfcd1925d9b34e7606a223faf61d37a6dd2cd433fb eternal-lands.png 9955 diff --git a/games-rpg/eternal-lands/files/eternal-lands-1.3.0-update-createdir.patch b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-update-createdir.patch new file mode 100644 index 000000000000..56217d7016c1 --- /dev/null +++ b/games-rpg/eternal-lands/files/eternal-lands-1.3.0-update-createdir.patch @@ -0,0 +1,134 @@ +--- elc/update.c 2006-07-04 20:03:48.000000000 +0100 ++++ elc/update.c 2006-07-04 23:34:01.000000000 +0100 +@@ -17,6 +17,18 @@ + #include <sys/stat.h> + #endif //WINDOWS + ++#ifndef S_ISDIR ++#define S_ISDIR(x) ((x) & S_IFMT) == S_IFDIR) ++#endif // S_ISDIR ++ ++#ifdef WINDOWS ++#define CHMOD(file) 0 ++#define MKDIR(file) mkdir(file) ++#else ++#define CHMOD(file) chmod(file, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP) ++#define MKDIR(file) (mkdir(file, S_IRWXU | S_IRWXG) || chmod(file, S_IRWXU | S_IRWXG | S_ISGID)) ++#endif //WINDOWS ++ + int update_attempt_count; // count how many update attempts have been tried (hopefully diff servers) + int temp_counter; // collision prevention during downloads just incase more then one ever starts + int update_busy; // state & lockout control to prevent two updates running at the saem rime +@@ -165,18 +177,15 @@ + strcpy(update_server, update_servers[0]); + } + // failsafe, try to make sure the directory is there +- if(mkdir_res < 0){ +-#ifdef WINDOWS +- mkdir_res= mkdir("./tmp"); +-#else //WINDOWS +- mkdir_res= mkdir("./tmp", 0777); +-#endif //WINDOWS +- } ++ if(mkdir_res < 0) ++ mkdir_res= MKDIR("./tmp"); + sprintf(filename, "./tmp/temp000.dat"); + ++temp_counter; + fp= my_fopen(filename, "wb+"); + if(fp){ ++ CHMOD(filename); + sprintf(filename, "http://%s/updates%d%d%d/files.lst", update_server, VER_MAJOR, VER_MINOR, VER_RELEASE); ++ + http_threaded_get_file(update_server, filename, fp, NULL, EVENT_UPDATES_DOWNLOADED); + } + // and keep running until we get a response +@@ -288,6 +297,7 @@ + buffer[sizeof(buffer)-1]= '\0'; + fp= my_fopen(download_temp_file, "wb+"); + if(fp){ ++ CHMOD(download_temp_file); + // build the prope URL to download + download_cur_file= download_queue[--download_queue_size]; + download_cur_md5= download_MD5s[download_queue_size]; +@@ -305,8 +315,6 @@ + // finish up on one file that just downloaded + void handle_file_download(struct http_get_struct *get) + { +- int sts; +- + if(!get){ // huh? what are you doing? + return; + } +@@ -317,26 +325,51 @@ + // the download was successful + // replace the current file + // TODO: check for remove/rename errors +- remove(download_cur_file); +- sts= rename(download_temp_file, download_cur_file); + +- // check for errors +- if(!sts){ +- // TODO: make the restart more intelligent +- if(allow_restart){ +- restart_required++; +- } +- } else { ++ // First, check directory exists ++ char *dir = (char *) malloc (strlen (download_cur_file) + 1); ++ char *slash; ++ struct stat stats; ++ ++ strcpy (dir, download_cur_file); ++ slash = dir; ++ ++ // Skip over leading slashes. ++ while (*slash == '/') ++ slash++; ++ ++ while (1){ ++ slash = strchr (slash, '/'); ++ if (slash == NULL) ++ break; ++ ++ *slash = '\0'; ++ if (! (stat (dir, &stats) == 0 && S_ISDIR (stats.st_mode) ) ) ++ if (MKDIR(dir)!= 0) { ++ log_error("cannot create directory %s", dir); ++ break; ++ } ++ *slash++ = '/'; ++ ++ // Avoid unnecessary calls to mkdir when given ++ // file names containing multiple adjacent slashes. ++ while (*slash == '/') ++ slash++; ++ } ++ ++ remove(download_cur_file); ++ if (rename(download_temp_file, download_cur_file)){ ++ remove(download_temp_file); + log_error("Unable to finish processing of %d (%d)", download_cur_file, errno); + // the final renamed failed, no restart permitted + allow_restart= 0; + restart_required= 0; ++ } else { ++ if(allow_restart) ++ restart_required++; + } +- } else { +- // and make sure we can't restart since we had a total failure +- allow_restart= 0; +- restart_required= 0; + } ++ + // release the filename + free(download_cur_file); + free(download_cur_md5); +@@ -358,6 +391,7 @@ + sprintf(download_temp_file, "./tmp/temp%03d.dat", ++temp_counter); + fp= my_fopen(download_temp_file, "wb+"); + if(fp){ ++ CHMOD(download_temp_file); + // build the prope URL to download + download_cur_file= download_queue[--download_queue_size]; + download_cur_md5= download_MD5s[download_queue_size]; |