diff options
author | Michael Sterrett <mr_bones_@gentoo.org> | 2005-03-18 01:48:42 +0000 |
---|---|---|
committer | Michael Sterrett <mr_bones_@gentoo.org> | 2005-03-18 01:48:42 +0000 |
commit | 904eb7bd811a596aa3365cb4ae138cd7d64d4c76 (patch) | |
tree | 4ebb242a29c1965fbae2e895d22e2a2e4517fc50 /games-arcade/balloonchase | |
parent | Always install the static lib, too. (diff) | |
download | gentoo-2-904eb7bd811a596aa3365cb4ae138cd7d64d4c76.tar.gz gentoo-2-904eb7bd811a596aa3365cb4ae138cd7d64d4c76.tar.bz2 gentoo-2-904eb7bd811a596aa3365cb4ae138cd7d64d4c76.zip |
fix bad directory reading for bug #85699; tidy
(Portage version: 2.0.51.19)
Diffstat (limited to 'games-arcade/balloonchase')
-rw-r--r-- | games-arcade/balloonchase/ChangeLog | 8 | ||||
-rw-r--r-- | games-arcade/balloonchase/balloonchase-0.9.6.ebuild | 29 | ||||
-rw-r--r-- | games-arcade/balloonchase/files/0.9.6-gentoo.patch | 178 |
3 files changed, 195 insertions, 20 deletions
diff --git a/games-arcade/balloonchase/ChangeLog b/games-arcade/balloonchase/ChangeLog index 8710f460edd8..ccabd7113f2d 100644 --- a/games-arcade/balloonchase/ChangeLog +++ b/games-arcade/balloonchase/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for games-arcade/balloonchase -# Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-arcade/balloonchase/ChangeLog,v 1.2 2004/06/24 22:01:44 agriffis Exp $ +# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/games-arcade/balloonchase/ChangeLog,v 1.3 2005/03/18 01:48:42 mr_bones_ Exp $ + + 17 Mar 2005; Michael Sterrett <mr_bones_@gentoo.org> + +files/0.9.6-gentoo.patch, balloonchase-0.9.6.ebuild: + fix bad directory reading for bug #85699; tidy *balloonchase-0.9.6 (07 Nov 2003) diff --git a/games-arcade/balloonchase/balloonchase-0.9.6.ebuild b/games-arcade/balloonchase/balloonchase-0.9.6.ebuild index a9c1826407a5..a3883544629a 100644 --- a/games-arcade/balloonchase/balloonchase-0.9.6.ebuild +++ b/games-arcade/balloonchase/balloonchase-0.9.6.ebuild @@ -1,41 +1,34 @@ -# Copyright 1999-2004 Gentoo Foundation +# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-arcade/balloonchase/balloonchase-0.9.6.ebuild,v 1.4 2004/06/24 22:01:44 agriffis Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-arcade/balloonchase/balloonchase-0.9.6.ebuild,v 1.5 2005/03/18 01:48:42 mr_bones_ Exp $ -inherit games +inherit eutils games DESCRIPTION="Fly a hot air balloon and try to blow the other player out of the screen" HOMEPAGE="http://koti.mbnet.fi/makegho/c/bchase/" SRC_URI="http://koti.mbnet.fi/makegho/c/bchase/${P}.tar.bz2" -KEYWORDS="x86 ~amd64" LICENSE="GPL-2" SLOT="0" +KEYWORDS="~amd64 x86" IUSE="" -RDEPEND="media-libs/libsdl" -DEPEND="${RDEPEND} - >=sys-apps/sed-4" +DEPEND="media-libs/libsdl" src_unpack() { unpack ${A} - cd ${S} + cd "${S}" + epatch "${FILESDIR}/${PV}-gentoo.patch" sed -i \ - -e '/opendir/ i\ if (getenv("HOME")) { chdir(getenv("HOME")); } - ' \ - -e 's:balloonchase.dat:.balloonchaserc:ig' \ - -e "s:\"images/:\"${GAMES_DATADIR}/${PN}/images/:" src/main.c || \ - die 'sed main.c failed' - sed -i \ - -e "/^CFLAGS/ s:=.*:= ${CFLAGS}:" Makefile || \ - die 'sed Makefile failed' + -e "s:GENTOODIR:${GAMES_DATADIR}/${PN}:" src/main.c \ + || die 'sed failed' } src_install() { - dogamesbin balloonchase || die "dogamesbin failed" + dogamesbin balloonchase || die "dogamesbin failed" dodir "${GAMES_DATADIR}/${PN}" cp -r images "${D}/${GAMES_DATADIR}/${PN}/" || die "cp failed" - dodoc README || die "dodoc failed" + dodoc README prepgamesdirs } diff --git a/games-arcade/balloonchase/files/0.9.6-gentoo.patch b/games-arcade/balloonchase/files/0.9.6-gentoo.patch new file mode 100644 index 000000000000..606babfec25c --- /dev/null +++ b/games-arcade/balloonchase/files/0.9.6-gentoo.patch @@ -0,0 +1,178 @@ +diff -ru balloonchase-0.9.6.orig/Makefile balloonchase-0.9.6/Makefile +--- balloonchase-0.9.6.orig/Makefile 2002-10-11 10:31:53.000000000 -0400 ++++ balloonchase-0.9.6/Makefile 2005-03-17 20:24:20.000000000 -0500 +@@ -9,7 +9,7 @@ + clean: + rm balloonchase src/*.o + main: src/main.c +- g++ -c -o src/main.o `sdl-config --cflags` src/main.c ++ g++ $(CXXFLAGS) -c -o src/main.o `sdl-config --cflags` src/main.c + g++ -o balloonchase src/main.o `sdl-config --libs` + pkg: + @echo $(PKG_BCVERSION) >VERSION +diff -ru balloonchase-0.9.6.orig/src/main.c balloonchase-0.9.6/src/main.c +--- balloonchase-0.9.6.orig/src/main.c 2002-10-11 10:31:53.000000000 -0400 ++++ balloonchase-0.9.6/src/main.c 2005-03-17 20:33:12.000000000 -0500 +@@ -333,47 +333,47 @@ + + int InitImages() + { +- back = SDL_LoadBMP("images/back.bmp"); ++ back = SDL_LoadBMP("GENTOODIR/images/back.bmp"); + +- num3 = SDL_LoadBMP("images/num3.bmp"); ++ num3 = SDL_LoadBMP("GENTOODIR/images/num3.bmp"); + SDL_SetColorKey(num3, SDL_SRCCOLORKEY, SDL_MapRGB(num3->format, 0xFF, 0xFF, 0xFF)); +- num2 = SDL_LoadBMP("images/num2.bmp"); ++ num2 = SDL_LoadBMP("GENTOODIR/images/num2.bmp"); + SDL_SetColorKey(num2, SDL_SRCCOLORKEY, SDL_MapRGB(num2->format, 0xFF, 0xFF, 0xFF)); +- num1 = SDL_LoadBMP("images/num1.bmp"); ++ num1 = SDL_LoadBMP("GENTOODIR/images/num1.bmp"); + SDL_SetColorKey(num1, SDL_SRCCOLORKEY, SDL_MapRGB(num1->format, 0xFF, 0xFF, 0xFF)); +- num0 = SDL_LoadBMP("images/num0.bmp"); ++ num0 = SDL_LoadBMP("GENTOODIR/images/num0.bmp"); + SDL_SetColorKey(num0, SDL_SRCCOLORKEY, SDL_MapRGB(num0->format, 0xFF, 0xFF, 0xFF)); +- numv = SDL_LoadBMP("images/num-.bmp"); ++ numv = SDL_LoadBMP("GENTOODIR/images/num-.bmp"); + SDL_SetColorKey(numv, SDL_SRCCOLORKEY, SDL_MapRGB(numv->format, 0xFF, 0xFF, 0xFF)); + +- menu = SDL_LoadBMP("images/menu.bmp"); +- menu_onoff = SDL_LoadBMP("images/menu_onoff.bmp"); ++ menu = SDL_LoadBMP("GENTOODIR/images/menu.bmp"); ++ menu_onoff = SDL_LoadBMP("GENTOODIR/images/menu_onoff.bmp"); + + +-// arrow[0] = SDL_LoadBMP("images/down.bmp"); ++// arrow[0] = SDL_LoadBMP("GENTOODIR/images/down.bmp"); + // SDL_SetColorKey(arrow[0], SDL_SRCCOLORKEY, SDL_MapRGB(arrow[0]->format, 0x00, 0x00, 0x00)); +-// arrow[1] = SDL_LoadBMP("images/down.bmp"); ++// arrow[1] = SDL_LoadBMP("GENTOODIR/images/down.bmp"); + // SDL_SetColorKey(arrow[1], SDL_SRCCOLORKEY, SDL_MapRGB(arrow[1]->format, 0x00, 0x00, 0x00)); + +- kp1 = SDL_LoadBMP("images/kp1.bmp"); ++ kp1 = SDL_LoadBMP("GENTOODIR/images/kp1.bmp"); + SDL_SetColorKey(kp1, SDL_SRCCOLORKEY, SDL_MapRGB(kp1->format, 0xFF, 0xFF, 0xFF)); +- kp1b = SDL_LoadBMP("images/kp1b.bmp"); ++ kp1b = SDL_LoadBMP("GENTOODIR/images/kp1b.bmp"); + SDL_SetColorKey(kp1b, SDL_SRCCOLORKEY, SDL_MapRGB(kp1b->format, 0xFF, 0xFF, 0xFF)); + +- kp2 = SDL_LoadBMP("images/kp2.bmp"); ++ kp2 = SDL_LoadBMP("GENTOODIR/images/kp2.bmp"); + SDL_SetColorKey(kp2, SDL_SRCCOLORKEY, SDL_MapRGB(kp2->format, 0xFF, 0xFF, 0xFF)); +- kp2b = SDL_LoadBMP("images/kp2b.bmp"); ++ kp2b = SDL_LoadBMP("GENTOODIR/images/kp2b.bmp"); + SDL_SetColorKey(kp2b, SDL_SRCCOLORKEY, SDL_MapRGB(kp2b->format, 0xFF, 0xFF, 0xFF)); + +- font2 = SDL_LoadBMP("images/font.bmp"); ++ font2 = SDL_LoadBMP("GENTOODIR/images/font.bmp"); + font = SDL_CreateRGBSurface(SDL_SWSURFACE, 1288, 100, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); + SDL_SetColorKey(font, SDL_SRCCOLORKEY, SDL_MapRGB(font->format, 0x00, 0x00, 0x00)); + DrawIMG (font, font2, 0, 0); + +- blobtrox = SDL_LoadBMP("images/blobtrox.bmp"); ++ blobtrox = SDL_LoadBMP("GENTOODIR/images/blobtrox.bmp"); + //SDL_SetColorKey(blobtrox, SDL_SRCCOLORKEY, SDL_MapRGB(blobtrox->format, 0x01, 0x01, 0x01)); + +- balloonchase = SDL_LoadBMP("images/balloonchase.bmp"); ++ balloonchase = SDL_LoadBMP("GENTOODIR/images/balloonchase.bmp"); + + TMP = SDL_CreateRGBSurface(SDL_SWSURFACE, 259, 200, 32, 0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF); + blursurface = SDL_CreateRGBSurface(SDL_SWSURFACE, 640, 480, 32, 0x00000000, 0x00000000, 0x00000000, 0x00000000); +@@ -578,7 +578,7 @@ + + void createdat(int winsneed, int option_wave_effect) + { +- FILE *OPTFILE=fopen ("balloonchase.dat", "w+"); ++ FILE *OPTFILE=fopen (".balloonchaserc", "w+"); + char datmsg[60]; + sprintf (datmsg, "Balloon Chase settings file -- Do not edit manually!"); + char tmp2; +@@ -588,52 +588,32 @@ + } + fputc (winsneed, OPTFILE); + fputc (option_wave_effect+2, OPTFILE); +- fprintf (stderr, "Saved configuration to balloonchase.dat\n"); ++ fprintf (stderr, "Saved configuration to .balloonchaserc\n"); + fclose (OPTFILE); + } + + void checkfiles() + { +- char found=0; +- #ifdef WIN32 +- WIN32_FIND_DATA fileinfo; +- BOOL rc = 0; +- HANDLE hFile; +- hFile = FindFirstFile("*", &fileinfo); +- while(rc) +- { +- rc = FindNextFile(hFile, &fileinfo); +- if (strcmp (fileinfo.cFileName, "balloonchase.dat")==0) +- { +- fprintf(stderr, "Found balloonchase.dat\n"); +- found = 1; +- _findclose(hFile); +- #endif +- #ifndef WIN32 +- struct dirent *filelist[255]; +- int i=0; +- int j=0; + DIR *dp; +- dp=opendir("./"); +- int filenum=0; +- while( filelist[filenum]=readdir(dp) ) +- filenum++; +- closedir(dp); +- if (filenum>=2) +- for (i=0;i<filenum;i++) +- { +- if (strcmp(filelist[i]->d_name,"balloonchase.dat")==0) +- { +- fprintf (stderr, "Found balloonchase.dat\n"); +- found=1; +- } ++ ++ if (getenv("HOME")) { ++ chdir(getenv("HOME")); ++ } ++ if ((dp = opendir("./"))) { ++ struct dirent *f; ++ ++ while(f=readdir(dp)) { ++ if (strcmp(f->d_name, ".balloonchaserc") == 0) { ++ fprintf (stderr, "Found .balloonchaserc\n"); ++ closedir(dp); ++ return; + } +- #endif +- if (found==0) +- { +- fprintf (stderr, "Balloonchase.dat not found!\nCreating new...\n"); +- if (found==0) createdat(2, 1); + } ++ closedir(dp); ++ fprintf (stderr, ++ "Balloonchase.dat not found!\nCreating new...\n"); ++ createdat(2, 1); ++ } + } + + Uint32 rgb(Uint8 r, Uint8 g, Uint8 b) +@@ -1257,7 +1237,7 @@ + SDL_WM_SetCaption ("Balloon Chase", 0); + checkfiles(); + +- FILE *OPTFILE=fopen ("balloonchase.dat", "r"); ++ FILE *OPTFILE=fopen (".balloonchaserc", "r"); + char datmsg[60]; + char varmistus[60]; + +@@ -1275,7 +1255,7 @@ + { + winsneeded=fgetc(OPTFILE); + option_wave_effect=fgetc(OPTFILE)-2; +- fprintf (stderr, "Successfully loaded balloonchase.dat\n"); ++ fprintf (stderr, "Successfully loaded .balloonchaserc\n"); + } + else + { |