diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-10-18 03:03:00 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-10-18 03:03:00 +0000 |
commit | 71a8ab18197a1a4c5583f824a0a0df72bc0b83e6 (patch) | |
tree | 228a2a998a6f4653b512125a463c3084b043cb44 | |
parent | Version bump (diff) | |
download | gentoo-2-71a8ab18197a1a4c5583f824a0a0df72bc0b83e6.tar.gz gentoo-2-71a8ab18197a1a4c5583f824a0a0df72bc0b83e6.tar.bz2 gentoo-2-71a8ab18197a1a4c5583f824a0a0df72bc0b83e6.zip |
Version bump #58858 Patrick Dawson and egore.
(Portage version: 2.0.53_rc5)
-rw-r--r-- | games-action/raptor2/ChangeLog | 10 | ||||
-rw-r--r-- | games-action/raptor2/files/digest-raptor2-1.2.0 | 1 | ||||
-rw-r--r-- | games-action/raptor2/files/raptor2-1.2.0-gentoo-paths.patch | 87 | ||||
-rw-r--r-- | games-action/raptor2/raptor2-1.2.0.ebuild | 41 |
4 files changed, 137 insertions, 2 deletions
diff --git a/games-action/raptor2/ChangeLog b/games-action/raptor2/ChangeLog index e8de9b192003..ae0508e1b597 100644 --- a/games-action/raptor2/ChangeLog +++ b/games-action/raptor2/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for games-action/raptor2 -# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-action/raptor2/ChangeLog,v 1.11 2005/08/25 18:57:07 agriffis Exp $ +# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/raptor2/ChangeLog,v 1.12 2005/10/18 03:02:59 vapier Exp $ + +*raptor2-1.2.0 (18 Oct 2005) + + 18 Oct 2005; Mike Frysinger <vapier@gentoo.org> + +files/raptor2-1.2.0-gentoo-paths.patch, +raptor2-1.2.0.ebuild: + Version bump #58858 Patrick Dawson and egore. 25 Aug 2005; Aron Griffis <agriffis@gentoo.org> raptor2-1.0.0-r1.ebuild: stable on ia64 diff --git a/games-action/raptor2/files/digest-raptor2-1.2.0 b/games-action/raptor2/files/digest-raptor2-1.2.0 new file mode 100644 index 000000000000..d5e108a60f5e --- /dev/null +++ b/games-action/raptor2/files/digest-raptor2-1.2.0 @@ -0,0 +1 @@ +MD5 d6b5cddfd5fc21c5199d7d3e3089b245 raptor-1.2.0.tar.gz 6171815 diff --git a/games-action/raptor2/files/raptor2-1.2.0-gentoo-paths.patch b/games-action/raptor2/files/raptor2-1.2.0-gentoo-paths.patch new file mode 100644 index 000000000000..453c9281c62d --- /dev/null +++ b/games-action/raptor2/files/raptor2-1.2.0-gentoo-paths.patch @@ -0,0 +1,87 @@ +--- src/defs.cpp ++++ src/defs.cpp +@@ -183,7 +183,7 @@ + //char * file_place = new char[ 6 ]; + char file_place[ 30 ]; + //file_place = strdup( "data" ); +- sprintf( file_place, "data" ); ++ sprintf( file_place, "GENTOO_DATADIR" ); + put_backslash( file_place ); + char * final = append( file_place, file_name ); + //delete[] file_place; +--- src/loadsave.h ++++ src/loadsave.h +@@ -4,5 +4,6 @@ + class SpaceObject; + int savePlayer( SpaceObject * player, int game_slot ); + SpaceObject * loadPlayer( int game_slot ); ++const char *getSaveName(int game_slot); + + #endif +--- src/loadsave.cpp ++++ src/loadsave.cpp +@@ -48,6 +48,20 @@ + #define debug printf("File: %s Line: %d\n", __FILE__, __LINE__ ); + #endif + ++const char *getSaveName(int i) ++{ ++ static char savename[1024]; ++ const char *homedir = getenv("HOME"); ++ if (homedir == NULL) { ++ fprintf(stderr, "HOME is not set, unable to save games"); ++ exit(1); ++ } ++ snprintf(savename, sizeof(savename), "%s/." PACKAGE, homedir); ++ mkdir(savename, 0755); ++ snprintf(savename, sizeof(savename), "%s/." PACKAGE "/player%d.rap", homedir, i); ++ return savename; ++} ++ + /* savePlayer: + * Saves the player in at player#.rap where # = game_slot + */ +@@ -56,8 +68,7 @@ + if ( player == NULL ) return 1; + printf("Save player\n"); + +- char filename[ 64 ]; +- snprintf( filename, 64, "player%d.rap", game_slot ); ++ const char *filename = getSaveName(game_slot); + + // PlayerHull * hull = dynamic_cast<PlayerHull *>(player->getHull()); + PlayerHull * hull = dynamic_cast<PlayerHull *>(player->getHull() ); +@@ -227,8 +238,7 @@ + + FILE * fv; + +- char filename[ 64 ]; +- snprintf( filename, 64, "player%d.rap", game_slot ); ++ const char *filename = getSaveName(game_slot); + fv = fopen( filename, "rb" ); + if ( fv == NULL ){ + printf("Could not open %s\n", filename ); +--- src/menu.cpp ++++ src/menu.cpp +@@ -575,8 +575,7 @@ + char * menuClass::getFileInfo( int number ){ + + char * temp = (char *)malloc( sizeof(char) * 1024 ); +- char buf[ 64 ]; +- sprintf( buf, "player%d.rap", number+1 ); ++ const char *buf = getSaveName(number+1); + FILE * fv = fopen( buf, "rb" ); + if ( !fv ){ + sprintf( temp, "Slot %d Empty", number+1 ); +--- src/raptor.cpp ++++ src/raptor.cpp +@@ -216,8 +216,7 @@ + + menu->clear(); + for ( int q = 0; q < 6; q++ ){ +- char filename[ 64 ]; +- snprintf( filename, 64, "player%d.rap", q+1 ); ++ const char *filename = getSaveName(q+1);; + if ( exists( filename ) ){ + time_t tl = file_time( filename ); + struct tm * real_time = localtime( &tl ); diff --git a/games-action/raptor2/raptor2-1.2.0.ebuild b/games-action/raptor2/raptor2-1.2.0.ebuild new file mode 100644 index 000000000000..33b9e5369f60 --- /dev/null +++ b/games-action/raptor2/raptor2-1.2.0.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/games-action/raptor2/raptor2-1.2.0.ebuild,v 1.1 2005/10/18 03:03:00 vapier Exp $ + +inherit eutils games + +MY_P="raptor-${PV}" +DESCRIPTION="space shoot-em-up game" +HOMEPAGE="http://raptorv2.sourceforge.net/" +SRC_URI="mirror://sourceforge/raptorv2/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~ia64 ~ppc ~x86" +IUSE="" + +DEPEND=">=media-libs/allegro-4.0.0 + >=media-libs/aldumb-0.9.2" + +S=${WORKDIR}/${MY_P} + +src_unpack() { + unpack ${A} + cd "${S}" + sed -i \ + -e '/AM_CXXFLAGS/s:-O3 -s::' \ + src/Makefile.in || die + epatch "${FILESDIR}"/${P}-gentoo-paths.patch + sed -i \ + -e "s:GENTOO_DATADIR:${GAMES_DATADIR}/${PN}/:" \ + src/defs.cpp \ + || die "sed src/raptor.cpp failed" +} + +src_install() { + dogamesbin src/raptor || die "dogamesbin failed" + insinto "${GAMES_DATADIR}/${PN}" + doins data/* || die "doins failed" + dodoc AUTHORS ChangeLog NEWS README + prepgamesdirs +} |