rpms/egoboo/F-7 egoboo-2.4.3-opengl-wrapper.patch, NONE, 1.1 egoboo-2.4.3-unix.patch, NONE, 1.1 egoboo.desktop, NONE, 1.1 egoboo.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Tue Oct 9 08:40:23 UTC 2007


Author: jwrdegoede

Update of /cvs/extras/rpms/egoboo/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6684

Modified Files:
	.cvsignore sources 
Added Files:
	egoboo-2.4.3-opengl-wrapper.patch egoboo-2.4.3-unix.patch 
	egoboo.desktop egoboo.spec 
Log Message:
* Tue Oct  9 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 2.4.3-2
- Merge my unix port patches with the one found here:
  http://freegamer.schattenkind.net/index.php?t=msg&th=152
- Change license to GPLv3 after asking upstream for version clarification


egoboo-2.4.3-opengl-wrapper.patch:

--- NEW FILE egoboo-2.4.3-opengl-wrapper.patch ---
diff -up egosrc234/game/egoboo.sh~ egosrc234/game/egoboo.sh
--- egosrc234/game/egoboo.sh~	2007-10-06 22:49:13.000000000 +0200
+++ egosrc234/game/egoboo.sh	2007-10-06 22:49:13.000000000 +0200
@@ -3,6 +3,10 @@
 # exit on any error
 set -e
 
+. /usr/share/opengl-games-utils/opengl-game-functions.sh
+
+checkDriOK egoboo
+
 if [ ! -d ~/.egoboo ]; then
   mkdir ~/.egoboo
   cp -a /usr/share/egoboo/setup.txt /usr/share/egoboo/controls.txt \

egoboo-2.4.3-unix.patch:

--- NEW FILE egoboo-2.4.3-unix.patch ---
diff -up egosrc234/game/char.c.unix egosrc234/game/char.c
--- egosrc234/game/char.c.unix	2007-09-19 22:18:04.000000000 +0200
+++ egosrc234/game/char.c	2007-10-08 22:30:26.000000000 +0200
@@ -4859,7 +4859,7 @@ void check_player_import(char *dirname)
 			sprintf(filename, "%s/%s/skin.txt", dirname, foundfile);
             skin = get_skin(filename);
             
-			_snprintf(filename, 128, "%s/%s/tris.md2", dirname, foundfile);
+			snprintf(filename, 128, "%s/%s/tris.md2", dirname, foundfile);
 			load_one_md2(filename, numloadplayer);
 
 			sprintf(filename, "%s/%s/icon%d.bmp", dirname, foundfile, skin);
diff -up egosrc234/game/menu.c.unix egosrc234/game/menu.c
--- egosrc234/game/menu.c.unix	2007-09-14 16:39:30.000000000 +0200
+++ egosrc234/game/menu.c	2007-10-08 22:57:12.000000000 +0200
@@ -15,6 +15,10 @@
 #define snprintf _snprintf
 #endif
 
+#ifdef __unix__
+#define max(a,b) ( ((a)>(b))? (a):(b) )
+#endif
+
 //--------------------------------------------------------------------------------------------
 // New menu code
 //--------------------------------------------------------------------------------------------
diff -up egosrc234/game/game.c.unix egosrc234/game/game.c
--- egosrc234/game/game.c.unix	2007-09-20 11:08:08.000000000 +0200
+++ egosrc234/game/game.c	2007-10-08 22:57:53.000000000 +0200
@@ -3427,7 +3427,7 @@ void update_timers()
     lstclock = allclock;
     allclock = SDL_GetTicks()-sttclock;
     fpsclock+=allclock-lstclock;
-    if(fpsclock >= CLOCKS_PER_SEC)
+    if(fpsclock >= TICKS_PER_SEC)
     {
         create_szfpstext(fpsframe);
         fpsclock = 0;
diff -up egosrc234/game/Ui.h.unix egosrc234/game/Ui.h
--- egosrc234/game/Ui.h.unix	2007-03-18 18:56:46.000000000 +0100
+++ egosrc234/game/Ui.h	2007-10-08 22:30:26.000000000 +0200
@@ -8,7 +8,7 @@
 #define egoboo_ui_h
 
 #include "Font.h"
-#include "GLTexture.h"
+#include "gltexture.h"
 #include <SDL.h>
 
 typedef unsigned int UI_ID;
diff -up /dev/null egosrc234/game/Makefile
--- /dev/null	2007-10-09 07:40:24.267001753 +0200
+++ egosrc234/game/Makefile	2007-10-09 08:34:49.000000000 +0200
@@ -0,0 +1,113 @@
+# note if you change the prefix also update egoboo.sh
+PREFIX   := /usr
+EGO_SRC  := camera.c char.c Client.c Clock.c common-file.c configfile.c \
+					  egoboostrutil.c enchant.c Font.c game.c gltexture.c graphicfan.c \
+					  graphicmad.c graphic.c graphicprt.c id_normals.c input.c \
+					  lin-file.c Log.c MainLoop.c mathstuff.c Md2.c menu.c module.c \
+					  network.c particle.c passage.c script.c Server.c sound.c \
+					  sys_lin.c Task.c Ticker.c Timer.c Ui.c
+EGO_OBJ  := ${EGO_SRC:.c=.o}
+ENET_SRC := ../enet/host.c ../enet/list.c ../enet/memory.c \
+						../enet/packet.c ../enet/peer.c ../enet/protocol.c \
+						../enet/unix.c
+ENET_OBJ := ${ENET_SRC:.c=.o}
+
+SDL_CONF  := sdl-config
+SDLCONF_I := $(shell ${SDL_CONF} --cflags)
+SDLCONF_L := $(shell ${SDL_CONF} --libs)
+
+CC      := gcc
+OPT     := -Os
+INC     := -I. -I../enet/include ${SDLCONF_I}
+CFLAGS  := ${OPT} ${INC}
+LDFLAGS := ${SDLCONF_L} -lSDL_ttf -lSDL_mixer -lGL -lGLU
+
+EGO_BIN := egoboo
+
+all: test_sdl ${EGO_BIN}
+
+test_sdl.o: test_sdl.c
+	${CC} ${CFLAGS} -o $@ -c $^ || make blurb_abort
+test_sdl: test_sdl.o
+	${CC} -o $@ $^ ${LDFLAGS} || make blurb_abort
+	./test_sdl || make blurb_abort
+blurb_abort:
+	@echo -e "\nFailed to compile/link/run test program -- make sure the required libs are installed\n"
+	@exit 1
+
+${EGO_BIN}: ${EGO_OBJ} ${ENET_OBJ}
+	${CC} -o $@ $^ ${LDFLAGS}
+
+install: ${EGO_BIN}
+	mkdir -p ${PREFIX}/bin
+	mkdir -p ${PREFIX}/libexec
+	install -m 755 ${EGO_BIN} ${PREFIX}/libexec
+	install -p -m 755 ${EGO_BIN}.sh ${PREFIX}/bin/${EGO_BIN}
+
+clean:
+	rm -f ${ENET_OBJ} ${EGO_OBJ} ${EGO_BIN} test_sdl.o test_sdl
+
+# cleaned up dependencies
+camera.o: camera.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+char.o: char.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+Client.o: Client.c Client.h
+Clock.o: Clock.c proto.h egobootypedef.h Clock.h Log.h
+common-file.o: common-file.c egoboo.h egobootypedef.h \
+  proto.h gltexture.h mathstuff.h \
+  configfile.h egoboostrutil.h Md2.h Log.h
+configfile.o: configfile.c configfile.h egobootypedef.h \
+  egoboostrutil.h
+egoboostrutil.o: egoboostrutil.c egoboostrutil.h egobootypedef.h
+enchant.o: enchant.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+Font.o: Font.c Font.h
+game.o: game.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h Ui.h \
+  Font.h Clock.h
+gltexture.o: gltexture.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+graphic.o: graphic.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+graphicfan.o: graphicfan.c egoboo.h egobootypedef.h \
+  proto.h gltexture.h mathstuff.h \
+  configfile.h egoboostrutil.h Md2.h Log.h
+graphicmad.o: graphicmad.c egoboo.h egobootypedef.h \
+  proto.h gltexture.h mathstuff.h \
+  configfile.h egoboostrutil.h Md2.h Log.h id_md2.h
+graphicprt.o: graphicprt.c egoboo.h egobootypedef.h \
+proto.h gltexture.h mathstuff.h \
+  configfile.h egoboostrutil.h Md2.h Log.h
+id_normals.o: id_normals.c id_md2.h
+input.o: input.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h Ui.h \
+  Font.h
+lin-file.o: lin-file.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+Log.o: Log.c Log.h
+MainLoop.o: MainLoop.c Log.h Clock.h System.h Server.h Client.h Menu.h
+mathstuff.o: mathstuff.c mathstuff.h egobootypedef.h
+Md2.o: Md2.c Md2.h egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Log.h
+menu.o: menu.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h Ui.h \
+  Font.h Menu.h
+module.o: module.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+network.o: network.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+particle.o: particle.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+passage.o: passage.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+script.o: script.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+Server.o: Server.c Server.h
+sound.o: sound.c egoboo.h egobootypedef.h proto.h \
+  gltexture.h mathstuff.h configfile.h egoboostrutil.h Md2.h Log.h
+sys_lin.o: sys_lin.c
+Task.o: Task.c Task.h Clock.h
+Ticker.o: Ticker.c Ticker.h Clock.h
+Timer.o: Timer.c Timer.h Clock.h
+Ui.o: Ui.c Ui.h Font.h gltexture.h
diff -up /dev/null egosrc234/game/egoboo.sh
--- /dev/null	2007-10-09 07:40:24.267001753 +0200
+++ egosrc234/game/egoboo.sh	2007-10-08 22:30:26.000000000 +0200
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# exit on any error
+set -e
+
+if [ ! -d ~/.egoboo ]; then
+  mkdir ~/.egoboo
+  cp -a /usr/share/egoboo/setup.txt /usr/share/egoboo/controls.txt \
+    /usr/share/egoboo/players ~/.egoboo
+  ln -s /usr/share/egoboo/basicdat /usr/share/egoboo/modules ~/.egoboo
+fi
+
+cd ~/.egoboo
+
+exec /usr/libexec/egoboo "$@"
diff -up egosrc234/game/graphic.c.unix egosrc234/game/graphic.c
--- egosrc234/game/graphic.c.unix	2007-09-19 22:12:00.000000000 +0200
+++ egosrc234/game/graphic.c	2007-10-08 22:56:46.000000000 +0200
@@ -3,6 +3,10 @@
 
 #include "egoboo.h"
 
+#ifdef __unix__
+#define min(a,b) ( ((a)<(b))? (a):(b) )
+#endif
+
 // Defined in egoboo.h
 SDL_Surface *displaySurface = NULL;
 bool_t	gTextureOn = bfalse;
@@ -1278,7 +1282,7 @@ void load_all_objects(char *modname)
 
     // Log all of the script errors
     //printf(" DIAG: opening ParseErr\n");
-    globalparseerr = fopen("basicdat/ParseErr.txt", "w");
+    globalparseerr = fopen("ParseErr.txt", "w");
 	parseerror = bfalse;
     fprintf(globalparseerr, "This file documents typos found in the AI scripts...\n");
 
@@ -4020,7 +4024,7 @@ void load_all_menu_images()
     strcpy(searchname, "modules/*.mod");
 
     // Log a directory list
-    filesave = fopen("basicdat/modules.txt", "w");
+    filesave = fopen("modules.txt", "w");
 	if ( filesave != NULL )
 	{
 		fprintf(filesave, "This file logs all of the modules found\n");
@@ -4313,6 +4317,14 @@ void sdlinit(int argc, char **argv)
 	
 	atexit(SDL_Quit);
 
+#ifdef __unix__
+	/* GLX doesn't differentiate between 24 and 32 bpp, asking for 32 bpp
+	   will cause SDL_SetVideoMode to fail with:
+	   Unable to set video mode: Couldn't find matching GLX visual */
+	if (scrd == 32)
+		scrd = 24;
+#endif
+
 	colordepth=scrd/3;
 
 	/* Setup the cute windows manager icon */
diff -up /dev/null egosrc234/game/sys_lin.c
--- /dev/null	2007-10-09 07:40:24.267001753 +0200
+++ egosrc234/game/sys_lin.c	2007-10-08 22:58:31.000000000 +0200
@@ -0,0 +1,32 @@
+#include <stdio.h> /* for NULL */
+#include <sys/time.h>
+
+static double startuptime;
+
+void sys_initialize()
+{
+	struct timeval now;
+	gettimeofday(&now, NULL);
+	startuptime = now.tv_sec + now.tv_usec / 1000000.0;
+}
+
+void sys_shutdown()
+{
+}
+
+double sys_getTime()
+{
+	struct timeval now;
+	gettimeofday(&now, NULL);
+	return now.tv_sec + now.tv_usec / 1000000.0 - startuptime;
+}
+
+int sys_frameStep()
+{
+	return 0;
+}
+
+int main(int argc, char* argv[])
+{
+	return SDL_main(argc, argv);
+}
diff -up egosrc234/game/lin-file.c.unix egosrc234/game/lin-file.c
--- egosrc234/game/lin-file.c.unix	2006-09-26 21:23:32.000000000 +0200
+++ egosrc234/game/lin-file.c	2007-10-09 08:47:07.000000000 +0200
@@ -4,111 +4,125 @@
 
 #include "egoboo.h"
 #include <stdio.h>
+#include <unistd.h>
+#include <glob.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/dir.h>
 
-char command[500];
-FILE *DirFiles;
-char DirRead[100];
-
 //File Routines-----------------------------------------------------------
-void make_directory(char *dirname)
+void fs_init()
 {
-    // ZZ> This function makes a new directory
-    sprintf(command,"mkdir -p %s\n",dirname);
-    system(command);
-}
+}
 
-void remove_directory(char *dirname)
+int fs_fileIsDirectory(const char *filename)
 {
-    // ZZ> This function removes a directory
-    sprintf(command,"rm -rf %s\n",dirname);
-    system(command);
-}
+  struct stat stats;
+  
+  if (!stat(filename, &stats))
+    return S_ISDIR(stats.st_mode);
+
+  return 0;
+}
 
-void delete_file(char *filename)
+int fs_createDirectory(const char *dirname)
 {
-    // ZZ> This function deletes a file
-    sprintf(command,"rm -f %s\n",filename);
-    system(command);
+    // ZZ> This function makes a new directory
+    return mkdir(dirname, 0755);
 }
 
-void copy_file(char *source, char *dest)
+int fs_removeDirectory(const char *dirname)
 {
-    // ZZ> This function copies a file on the local machine
-    sprintf(command,"cp -f %s %s\n",source,dest);
-    system(command);
+    // ZZ> This function removes a directory
+    return rmdir(dirname);
 }
 
-void delete_directory(char *dirname)
+void fs_deleteFile(const char *filename)
 {
-    // ZZ> This function deletes all files in a directory,
-    //     and the directory itself
-    sprintf(command,"rm -rf %s\n",dirname);
-    system(command);
+    // ZZ> This function deletes a file
+    unlink(filename);
 }
 
-void copy_directory(char *dirname, char *todirname)
+void fs_copyFile(const char *source, const char *dest)
 {
-    // ZZ> This function copies all files in a directory
-    sprintf(command,"cp -fr %s %s\n",dirname,todirname);
-    system(command);
+    // ZZ> This function copies a file on the local machine
+    FILE *sourcef;
+    FILE *destf;
+    char buf[4096];
+    int bytes_read;
+    
+    sourcef = fopen(source, "r");
+    if (!sourcef)
+      return;
+        
+    destf = fopen(dest, "w");
+    if (!destf)
+    {
+        fclose(sourcef);
+        return;
+    }
+    
+    while ((bytes_read = fread(buf, 1, sizeof(buf), sourcef)))
+        fwrite(buf, 1, bytes_read, destf);
+        
+    fclose(sourcef);
+    fclose(destf);
 }
 
 void empty_import_directory(void)
 {
     // ZZ> This function deletes all the TEMP????.OBJ subdirectories in the IMPORT directory
-    sprintf(command,"rm -rf import/temp*.obj\n");
-    system(command);
+    system("rm -rf import/temp*.obj\n");
 }
 
+static glob_t last_find_glob;
+static size_t glob_find_index;
+
 // Read the first directory entry
-char *DirGetFirst(char *search)
+const char *fs_findFirstFile(const char *searchDir, const char *searchExtension)
 {
-  sprintf(command,"find %s -maxdepth 0 -printf \"%%f\\n\"  ",search);
-  DirFiles=popen(command,"r");
-  if(!feof(DirFiles))
-  {
-    fscanf(DirFiles,"%s\n",DirRead);
-    return(DirRead);
-  }
+  char pattern[PATH_MAX];
+  char *last_slash;
+  
+  if (searchExtension)
+    snprintf(pattern, PATH_MAX, "%s/*.%s", searchDir, searchExtension);
   else
-  {
-    return(NULL);
-  }
+    snprintf(pattern, PATH_MAX, "%s/*", searchDir);
+  
+  last_find_glob.gl_offs = 0;
+  glob(pattern, GLOB_NOSORT, NULL, &last_find_glob);
+  
+  if (!last_find_glob.gl_pathc)
+    return NULL;
+    
+  glob_find_index = 0;
+  last_slash = strrchr(last_find_glob.gl_pathv[glob_find_index], '/');
+  
+  if (last_slash)
+    return last_slash + 1;
+  
+  return NULL; /* should never happen */
 }
 
 // Read the next directory entry (NULL if done)
-char *DirGetNext(void)
+const char *fs_findNextFile(void)
 {
-  if(!feof(DirFiles))
-  { 
-    fscanf(DirFiles,"%s\n",DirRead);
-    return(DirRead);
-  }
-  else
-  {
-    return(NULL);
-  }
+  char *last_slash;
+  
+  ++glob_find_index;
+  if (glob_find_index >= last_find_glob.gl_pathc)
+    return NULL;
+
+  last_slash = strrchr(last_find_glob.gl_pathv[glob_find_index], '/');
+  
+  if (last_slash)
+    return last_slash + 1;
+  
+  return NULL; /* should never happen */
 }
 
 // Close anything left open
-void DirClose()
-{
-  fclose(DirFiles);
-}
-
-int ClockGetTick()
+void fs_findClose()
 {
-  return(clock());
-}
-
-int DirGetAttrib(char *fromdir)
-{
-  int tmp;
-#define FILE_ATTRIBUTE_DIRECTORY 0x10
-#define FILE_ATTRIBUTE_NORMAL 0x0
-#define FILE_ATTRIBUTE_ERROR 0xffffffff
-
-  return(0);
+  globfree(&last_find_glob);
 }
diff -up egosrc234/game/Font.c.unix egosrc234/game/Font.c
--- egosrc234/game/Font.c.unix	2007-08-22 23:52:02.000000000 +0200
+++ egosrc234/game/Font.c	2007-10-08 22:56:21.000000000 +0200
@@ -10,6 +10,10 @@
 #include <SDL_opengl.h>
 #include <SDL_ttf.h>
 
+#ifdef __unix__
+#define max(a,b) ( ((a)>(b))? (a):(b) )
+#endif
+
 struct Font
 {
 	TTF_Font *ttfFont;
diff -up egosrc234/game/network.c.unix egosrc234/game/network.c
--- egosrc234/game/network.c.unix	2007-09-14 16:56:36.000000000 +0200
+++ egosrc234/game/network.c	2007-10-08 22:30:26.000000000 +0200
@@ -108,7 +108,11 @@ void close_session()
 			numPeers = net_myHost->peerCount;
 			for(i = 0;i < numPeers;i++)
 			{
+#ifdef ENET11
+				enet_peer_disconnect(&net_myHost->peers[i], 0);
+#else
 				enet_peer_disconnect(&net_myHost->peers[i]);
+#endif
 			}
 
 			// Allow up to 5 seconds for peers to drop
@@ -1571,8 +1575,11 @@ void listen_for_packets()
 				// don't allow anyone to connect during the game session
 				net_logf("listen_for_packets: Client tried to connect during the game: %x:%u\n",
 					event.peer->address.host, event.peer->address.port);
+#ifdef ENET11
+				enet_peer_disconnect(event.peer, 0);
+#else
 				enet_peer_disconnect(event.peer);
-
+#endif
 				break;
 
 			case ENET_EVENT_TYPE_DISCONNECT:
diff -up egosrc234/game/egoboo.h.unix egosrc234/game/egoboo.h
--- egosrc234/game/egoboo.h.unix	2007-09-19 22:07:26.000000000 +0200
+++ egosrc234/game/egoboo.h	2007-10-08 22:56:08.000000000 +0200
@@ -1,9 +1,10 @@
 #ifndef _EGOBOO_H_
 #define	_EGOBOO_H_
 
-
+#ifndef __unix__
 #pragma warning(disable : 4305)                     // Turn off silly warnings
 #pragma warning(disable : 4244)                     //
+#endif
 
 /* Typedefs for various platforms */
 #include "egobootypedef.h"
@@ -395,12 +396,11 @@ EXTERN int rotmeshdown;                 
 #define PRTSOLIDSPRITE                  1           // Sprite particle
 #define PRTALPHASPRITE                  2           // Smoke particle
 
-#ifndef CLOCK_PER_SEC
-#define CLOCKS_PER_SEC          1000        // Windows ticks 1000 times per second
-#endif
+/* SDL_GetTicks() always returns milli seconds */
+#define TICKS_PER_SEC                   1000
 
-#define FRAMESKIP                       CLOCKS_PER_SEC/50 //20          // 1000/20 = 50 game updates per second
-#define ONESECOND                       (CLOCKS_PER_SEC/FRAMESKIP)
+#define FRAMESKIP                       TICKS_PER_SEC/50 //20          // 1000/20 = 50 game updates per second
+#define ONESECOND                       (TICKS_PER_SEC/FRAMESKIP)
 #define STOPBOUNCING                    0.1 //1.0         // To make objects stop bouncing
 #define STOPBOUNCINGPART                5.0         // To make particles stop bouncing
 
@@ -1597,7 +1597,7 @@ EXTERN float md2normals[MD2LIGHTINDICES]
 
 // This is for random naming
 EXTERN unsigned short          numchop  EQ(0);                // The number of name parts
-EXTERN unsigned short          chopwrite  EQ(0);              // The data pointer
+EXTERN unsigned int            chopwrite  EQ(0);              // The data pointer
 EXTERN char                    chopdata[CHOPDATACHUNK];    // The name parts
 EXTERN unsigned short          chopstart[MAXCHOP];         // The first character of each part
 EXTERN unsigned short          capsectionsize[MAXMODEL][MAXSECTION];   // Number of choices, 0
@@ -1640,7 +1640,7 @@ extern int                     iNumAis;
 #define ALERTIFTHROWN                       268435456   // 28
 #define ALERTIFCRUSHED                      536870912   // 29
 #define ALERTIFNOTPUTAWAY                   1073741824  // 30
-#define ALERTIFTAKENOUT                     2147483648  // 31
+#define ALERTIFTAKENOUT                     2147483648u // 31
 
 #define FIFSPAWNED                          0   // Scripted AI functions (v0.10)
 #define FIFTIMEOUT                          1   //
--- egosrc234/game/test_sdl.c.unix	1970-01-01 01:00:00.000000000 +0100
+++ egosrc234/game/test_sdl.c	2007-09-29 17:56:01.000000000 +0200
@@ -0,0 +1,20 @@
+#include <stdio.h>
+#include <SDL.h>
+#include <SDL_opengl.h>
+#include <SDL_mixer.h>
+#include <SDL_ttf.h>
+
+int main(int argc, char* argv[])
+{
+  SDL_Init(0);
+  int f, c;
+  Uint16 fmt;
+  Mix_QuerySpec(&f, &fmt, &c);
+  TTF_Init(); 
+  TTF_Quit();
+  SDL_Quit();
+  for (f = 0; f < 70; ++f) printf("*");printf("\n");
+  printf("If you can read this all is well -- compiling egoboo now\n");
+  for (f = 0; f < 70; ++f) printf("*");printf("\n");
+  return 0;
+}


--- NEW FILE egoboo.desktop ---
[Desktop Entry]
Name=Egoboo
Comment=A top down graphical (3D) RPG in the spirit of Nethack
Exec=egoboo
Icon=egoboo
Terminal=false
StartupNotify=false
Type=Application
Categories=Game;RolePlaying;


--- NEW FILE egoboo.spec ---
Name:           egoboo
Version:        2.4.3
Release:        2%{?dist}
Summary:        A top down graphical (3D) RPG in the spirit of Nethack
Group:          Amusements/Games
License:        GPLv3
URL:            http://home.no.net/egoboo/
# this is http://home.no.net/egoboo/egosrc243.rar repackaged in tar.gz
Source0:        %{name}-%{version}.tar.gz
Source1:        %{name}.desktop
Patch0:         %{name}-2.4.3-unix.patch
Patch1:         %{name}-2.4.3-opengl-wrapper.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  SDL_mixer-devel SDL_ttf-devel enet-devel desktop-file-utils
Requires:       %{name}-data = %{version}, opengl-games-utils

%description
Egoboo is a top down rpg in the spirit of Nethack and other games of the
Roguelike genre. It uses OpenGL graphics and will have randomly generated
maps and customizable characters. The objective of the project is to bring the
fun and depth of roguelike gameplay, kicking and screaming, into the third
dimension.


%prep
# Yes upstream put the wrong version in the base dir.
%setup -q -n egosrc234
%patch0 -p1
%patch1 -p1
sed -i 's/\r//g' game/change.log game/Egoboodoc.txt
iconv -f ISO-8859-1 -t UTF8 game/change.log > ChangeLog


%build
# We override ENET_OBJ and LDFLAGS to use the system enet
make -C game ENET_OBJ= \
  CFLAGS="$RPM_OPT_FLAGS `sdl-config --cflags` -DENET11" \
  LDFLAGS="`sdl-config --libs` -lSDL_ttf -lSDL_mixer -lGL -lGLU -lenet"


%install
rm -rf $RPM_BUILD_ROOT
make -C game ENET_OBJ= install PREFIX=$RPM_BUILD_ROOT%{_prefix}

# below is the desktop file and icon stuff.
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install --vendor fedora            \
  --dir $RPM_BUILD_ROOT%{_datadir}/applications \
  %{SOURCE1}


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
# note the end-users docs are in the -data package
%doc ChangeLog game/Egoboodoc.txt
%{_bindir}/%{name}
%{_libexecdir}/%{name}
%{_datadir}/applications/fedora-%{name}.desktop


%changelog
* Tue Oct  9 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 2.4.3-2
- Merge my unix port patches with the one found here:
  http://freegamer.schattenkind.net/index.php?t=msg&th=152
- Change license to GPLv3 after asking upstream for version clarification

* Sat Oct  6 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 2.4.3-1
- Initial Fedora package


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/egoboo/F-7/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	8 Oct 2007 18:29:40 -0000	1.1
+++ .cvsignore	9 Oct 2007 08:39:51 -0000	1.2
@@ -0,0 +1 @@
+egoboo-2.4.3.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/egoboo/F-7/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	8 Oct 2007 18:29:40 -0000	1.1
+++ sources	9 Oct 2007 08:39:51 -0000	1.2
@@ -0,0 +1 @@
+7b894078e657d1e7cec61cfa1dcaf27c  egoboo-2.4.3.tar.gz




More information about the fedora-extras-commits mailing list