--- val-and-rick-0.1a.dfsg1.orig/debian/patches/avoid-segfault-when-sdl-fails.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/avoid-segfault-when-sdl-fails.patch
@@ -0,0 +1,16 @@
+# Copyright (C) 2007  Peter De Wachter <pdewacht@gmail.com>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/gamemanager.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/gamemanager.d	2007-12-31 20:42:17.000000000 +0100
++++ val-and-rick-0.1a.dfsg1/src/abagames/vr/gamemanager.d	2007-12-31 20:57:38.000000000 +0100
+@@ -168,7 +169,7 @@
+   }
+ 
+   public void saveErrorReplay() {
+-    if (state == inGameState)
++    if (state !is null && state == inGameState)
+       inGameState.saveReplay("error.rpl");
+   }
+ 
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/series
+++ val-and-rick-0.1a.dfsg1/debian/patches/series
@@ -0,0 +1,9 @@
+import.patch
+fixes.patch
+makefile.patch
+directories.patch
+windowed.patch
+homedir.patch
+resizable.patch
+endian-clean.patch
+avoid-segfault-when-sdl-fails.patch
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/windowed.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/windowed.patch
@@ -0,0 +1,37 @@
+# Copyright (C) 2007  Miriam Ruiz <little_miry@yahoo.es>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/screen3d.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/screen3d.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/screen3d.d	2007-09-05 07:48:38.000000000 +0000
+@@ -22,7 +22,7 @@
+   float _nearPlane = 0.1;
+   int _width = 640;
+   int _height = 480;
+-  bool _windowMode = false;
++  bool _windowMode = true;
+ 
+   protected abstract void init();
+   protected abstract void close();
+Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/boot.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/boot.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/src/abagames/vr/boot.d	2007-09-05 07:48:38.000000000 +0000
+@@ -133,6 +133,9 @@
+     case "-window":
+       screen.windowMode = true;
+       break;
++    case "-fullscreen":
++      screen.windowMode = false;
++      break;
+     case "-res":
+       if (i >= args.length - 2) {
+         usage(progName);
+@@ -176,5 +179,5 @@
+ 
+ private void usage(char[] progName) {
+   Logger.error
+-    ("Usage: " ~ progName ~ " [-window] [-res x y] [-brightness [0-100]] [-luminosity [0-100]] [-nosound] [-reverse] [-nowait]");
++    ("Usage: " ~ progName ~ " [-window] [-fullscreen] [-res x y] [-brightness [0-100]] [-luminosity [0-100]] [-nosound] [-reverse] [-nowait]");
+ }
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/import.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/import.patch
@@ -0,0 +1,347 @@
+# Copyright (C) 2007  Peter De Wachter <pdewacht@gmail.com>
+# Copyright (C) 2007  Miriam Ruiz <little_miry@yahoo.es>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/import/SDL.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL.d	2007-09-05 07:48:36.000000000 +0000
+@@ -20,18 +20,18 @@
+     slouken@devolution.com
+ */
+ 
+-import SDL_types;
+-import SDL_getenv;
+-import SDL_error;
+-import SDL_rwops;
+-import SDL_timer;
+-import SDL_audio;
+-import SDL_cdrom;
+-import SDL_joystick;
+-import SDL_events;
+-import SDL_video;
+-import SDL_byteorder;
+-import SDL_Version;
++public import SDL_types;
++public import SDL_getenv;
++public import SDL_error;
++public import SDL_rwops;
++public import SDL_timer;
++public import SDL_audio;
++public import SDL_cdrom;
++public import SDL_joystick;
++public import SDL_events;
++public import SDL_video;
++public import SDL_byteorder;
++public import SDL_Version;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_Version.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_Version.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_Version.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,7 +22,7 @@
+ 
+ /* This header defines the current SDL version */
+ 
+-import SDL_types;
++public import SDL_types;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_active.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_active.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_active.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,7 +22,7 @@
+ 
+ /* Include file for SDL application focus event handling */
+ 
+-import SDL_types;
++public import SDL_types;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_audio.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_audio.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_audio.d	2007-09-05 07:48:36.000000000 +0000
+@@ -20,10 +20,10 @@
+     slouken@devolution.com
+ */
+ 
+-import SDL_types;
+-import SDL_error;
+-import SDL_rwops;
+-import SDL_byteorder;
++public import SDL_types;
++public import SDL_error;
++public import SDL_rwops;
++public import SDL_byteorder;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_cdrom.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_cdrom.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_cdrom.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,7 +22,7 @@
+ 
+ /* This is the CD-audio control API for Simple DirectMedia Layer */
+ 
+-import SDL_types;
++public import SDL_types;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_endian.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_endian.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_endian.d	2007-09-05 07:48:36.000000000 +0000
+@@ -34,9 +34,9 @@
+          and other data sources.
+ */
+ 
+-import SDL_types;
+-import SDL_rwops;
+-import SDL_byteorder;
++public import SDL_types;
++public import SDL_rwops;
++public import SDL_byteorder;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_events.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_events.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_events.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,12 +22,12 @@
+ 
+ /* Include file for SDL event handling */
+ 
+-import SDL_types;
+-import SDL_active;
+-import SDL_keyboard;
+-import SDL_mouse;
+-import SDL_joystick;
+-import SDL_syswm;
++public import SDL_types;
++public import SDL_active;
++public import SDL_keyboard;
++public import SDL_mouse;
++public import SDL_joystick;
++public import SDL_syswm;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_joystick.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_joystick.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_joystick.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,7 +22,7 @@
+ 
+ /* Include file for SDL joystick event handling */
+ 
+-import SDL_types;
++public import SDL_types;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_keyboard.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_keyboard.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_keyboard.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,11 +22,11 @@
+ 
+ /* Include file for SDL keyboard event handling */
+ 
+-import SDL_types;
++public import SDL_types;
+ // !!! A hack! struct SDL_keysym is defined in this module,
+ // !!! so we need to resolve the nameclash...
+ // !!! Definitely won't work on *NIX but for now will do.
+-import SDL_Keysym;
++public import SDL_Keysym;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_mixer.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_mixer.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_mixer.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,9 +22,9 @@
+ 
+ // convert to D by shinichiro.h
+ 
+-/* $Id: SDL_mixer.d,v 1.1.1.1 2005/03/13 16:15:04 kenta Exp $ */
++/* $Id: SDL_mixer.d,v 1.1.1.1 2005/06/18 00:46:00 kenta Exp $ */
+ 
+-import SDL;
++public import SDL;
+ 
+ extern (C) {
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_mouse.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_mouse.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_mouse.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,8 +22,8 @@
+ 
+ /* Include file for SDL mouse event handling */
+ 
+-import SDL_types;
+-import SDL_video;
++public import SDL_types;
++public import SDL_video;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_mutex.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_mutex.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_mutex.d	2007-09-05 07:48:36.000000000 +0000
+@@ -25,7 +25,7 @@
+ 	These are independent of the other SDL routines.
+ */
+ 
+-import SDL_types;
++public import SDL_types;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_quit.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_quit.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_quit.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,7 +22,7 @@
+ 
+ /* Include file for SDL quit event handling */
+ 
+-import SDL_events;
++public import SDL_events;
+ 
+ /* 
+   An SDL_QUITEVENT is generated when the user tries to close the application
+Index: val-and-rick-0.1a.dfsg1/import/SDL_rwops.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_rwops.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_rwops.d	2007-09-05 07:48:36.000000000 +0000
+@@ -24,7 +24,7 @@
+    data sources.  It can easily be extended to files, memory, etc.
+ */
+ 
+-import SDL_types;
++public import SDL_types;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_syswm.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_syswm.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_syswm.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,7 +22,7 @@
+ 
+ /* Include file for SDL custom system window manager hooks */
+ 
+-import SDL_Version;
++public import SDL_Version;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_thread.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_thread.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_thread.d	2007-09-05 07:48:36.000000000 +0000
+@@ -25,8 +25,8 @@
+ 	These are independent of the other SDL routines.
+ */
+ 
+-import SDL_types;
+-import SDL_mutex;
++public import SDL_types;
++public import SDL_mutex;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_timer.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_timer.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_timer.d	2007-09-05 07:48:36.000000000 +0000
+@@ -20,7 +20,7 @@
+     slouken@devolution.com
+ */
+ 
+-import SDL_types;
++public import SDL_types;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/SDL_video.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/SDL_video.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/SDL_video.d	2007-09-05 07:48:36.000000000 +0000
+@@ -22,9 +22,9 @@
+ 
+ /* Header file for access to the SDL raw framebuffer window */
+ 
+-import SDL_types;
+-import SDL_mutex;
+-import SDL_rwops;
++public import SDL_types;
++public import SDL_mutex;
++public import SDL_rwops;
+ 
+ extern(C):
+ 
+Index: val-and-rick-0.1a.dfsg1/import/opengl.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/opengl.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/opengl.d	2007-09-05 07:48:36.000000000 +0000
+@@ -1,10 +1,4 @@
+-version (Win32) {
+-	private import std.c.windows.windows;
+-	extern(Windows):
+-}
+-version (linux) {
+-	extern(C):
+-}
++extern(C):
+ 
+ alias uint GLenum;
+ alias ubyte GLboolean;
+@@ -1116,7 +1110,7 @@
+ /*************************************************************/
+ 
+ void /*APIENTRY*/glAccum (GLenum op, GLfloat value);
+-void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref);
++void /*APIENTRY*/glAlphaFunc (GLenum func, GLclampf ref_);
+ GLboolean /*APIENTRY*/glAreTexturesResident (GLsizei n, GLuint *textures, GLboolean *residences);
+ void /*APIENTRY*/glArrayElement (GLint i);
+ void /*APIENTRY*/glBegin (GLenum mode);
+@@ -1369,7 +1363,7 @@
+ void /*APIENTRY*/glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
+ void /*APIENTRY*/glSelectBuffer (GLsizei size, GLuint *buffer);
+ void /*APIENTRY*/glShadeModel (GLenum mode);
+-void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref, GLuint mask);
++void /*APIENTRY*/glStencilFunc (GLenum func, GLint ref_, GLuint mask);
+ void /*APIENTRY*/glStencilMask (GLuint mask);
+ void /*APIENTRY*/glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
+ void /*APIENTRY*/glTexCoord1d (GLdouble s);
+Index: val-and-rick-0.1a.dfsg1/import/openglu.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/openglu.d	2005-03-14 01:15:04.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/import/openglu.d	2007-09-05 07:48:36.000000000 +0000
+@@ -1,11 +1,6 @@
+ import opengl;
+ 
+-version (Win32) {
+-	extern(Windows):
+-}
+-version (linux) {
+-	extern(C):
+-}
++extern(C):
+ 
+ GLubyte* gluErrorString (
+     GLenum   errCode);
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/directories.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/directories.patch
@@ -0,0 +1,51 @@
+# Copyright (C) 2007  Miriam Ruiz <little_miry@yahoo.es>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/barrage.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/barrage.d	2007-09-07 00:24:50.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/src/abagames/vr/barrage.d	2007-09-07 00:26:48.000000000 +0200
+@@ -24,7 +24,7 @@
+ public class BarrageManager {
+  private:
+   static BulletMLParserTinyXML *parser[char[]][char[]];
+-  static const char[] BARRAGE_DIR_NAME = "barrage";
++  static const char[] BARRAGE_DIR_NAME = "/usr/share/games/val-and-rick/barrage";
+ 
+   public static void load() {
+     char[][] dirs = listdir(BARRAGE_DIR_NAME);
+Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/texture.d	2007-09-07 00:26:42.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d	2007-09-07 00:29:38.000000000 +0200
+@@ -16,7 +16,7 @@
+  */
+ public class Texture {
+  public:
+-  static char[] imagesDir = "images/";
++  static char[] imagesDir = "/usr/share/games/val-and-rick/images/";
+   static SDL_Surface*[char[]] surface;
+  private:
+   GLuint num, maskNum;
+Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/sound.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/sound.d	2007-09-07 00:24:50.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/sound.d	2007-09-07 00:26:48.000000000 +0200
+@@ -67,7 +67,7 @@
+ public class Music: Sound {
+  public:
+   static int fadeOutSpeed = 1280;
+-  static char[] dir = "sounds/musics";
++  static char[] dir = "/usr/share/games/val-and-rick/sounds/musics";
+  private:
+   Mix_Music* music;
+ 
+@@ -131,7 +131,7 @@
+ 
+ public class Chunk: Sound {
+  public:
+-  static char[] dir = "sounds/chunks";
++  static char[] dir = "/usr/share/games/val-and-rick/sounds/chunks";
+  private:
+   Mix_Chunk* chunk;
+   int chunkChannel;
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/fixes.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/fixes.patch
@@ -0,0 +1,90 @@
+# Copyright (C) 2007  Marcel Unbehaun <frostworks@gmx.de>
+# Copyright (C) 2007  Peter De Wachter <pdewacht@gmail.com>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/src/abagames/util/logger.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/logger.d	2007-09-07 00:17:49.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/src/abagames/util/logger.d	2007-09-07 00:17:54.000000000 +0200
+@@ -5,7 +5,7 @@
+  */
+ module abagames.util.logger;
+ 
+-private import std.stream;
++private import std.cstream;
+ private import std.string;
+ 
+ /**
+@@ -56,28 +56,28 @@
+ 
+   public static void info(char[] msg, bool nline = true) {
+     if (nline)
+-      stderr.writeLine(msg);
++      derr.writeLine(msg);
+     else
+-      stderr.writeString(msg);
++      derr.writeString(msg);
+   }
+ 
+   public static void info(double n, bool nline = true) {
+     if (nline)
+-      stderr.writeLine(std.string.toString(n));
++      derr.writeLine(std.string.toString(n));
+     else
+-      stderr.writeString(std.string.toString(n) ~ " ");
++      derr.writeString(std.string.toString(n) ~ " ");
+   }
+ 
+   public static void error(char[] msg) {
+-    stderr.writeLine("Error: " ~ msg);
++    derr.writeLine("Error: " ~ msg);
+   }
+ 
+   public static void error(Exception e) {
+-    stderr.writeLine("Error: " ~ e.toString());
++    derr.writeLine("Error: " ~ e.toString());
+   }
+ 
+   public static void error(Error e) {
+-    stderr.writeLine("Error: " ~ e.toString());
++    derr.writeLine("Error: " ~ e.toString());
+     if (e.next)
+       error(e.next);
+   }
+Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/luminous.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/luminous.d	2007-09-07 00:17:49.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/luminous.d	2007-09-07 00:17:54.000000000 +0200
+@@ -7,6 +7,7 @@
+ 
+ private import std.math;
+ private import std.string;
++private import std.c.string;
+ private import opengl;
+ private import abagames.util.actor;
+ 
+Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/barrage.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/barrage.d	2007-09-07 00:22:29.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/src/abagames/vr/barrage.d	2007-09-07 00:24:50.000000000 +0200
+@@ -30,6 +30,7 @@
+     char[][] dirs = listdir(BARRAGE_DIR_NAME);
+     foreach (char[] dirName; dirs) {
+       char[][] files = listdir(BARRAGE_DIR_NAME ~ "/" ~ dirName);
++      parser[dirName] = null;
+       foreach (char[] fileName; files) {
+         if (getExt(fileName) != "xml")
+           continue;
+Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/texture.d	2007-09-07 00:25:03.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d	2007-09-07 00:26:42.000000000 +0200
+@@ -25,7 +25,7 @@
+   Uint32[128 * 128] maskPixels;
+ 
+   public static SDL_Surface* loadBmp(char[] name) {
+-    if (surface[name]) {
++    if ((name in surface) != null) {
+       return surface[name];
+     } else {
+       char[] fileName = imagesDir ~ name;
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/homedir.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/homedir.patch
@@ -0,0 +1,98 @@
+# Copyright (C) 2007  Peter De Wachter <pdewacht@gmail.com>
+# Copyright (C) 2007  Miriam Ruiz <little_miry@yahoo.es>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/prefmanager.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/prefmanager.d	2007-09-05 07:56:30.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/src/abagames/vr/prefmanager.d	2007-09-05 07:57:43.000000000 +0000
+@@ -6,6 +6,9 @@
+ module abagames.vr.prefmanager;
+ 
+ private import std.stream;
++private import std.c.stdlib;
++private import std.string;
++private import std.file;
+ private import abagames.util.prefmanager;
+ private import abagames.vr.ship;
+ 
+@@ -15,18 +18,31 @@
+ public class PrefManager: abagames.util.prefmanager.PrefManager {
+  private:
+   static const int VERSION_NUM = 10;
+-  static const char[] PREF_FILE = "vr.prf";
++  static const char[] PREF_FILE = "val-and-rick.prf";
+   PrefData _prefData;
+ 
+   public this() {
+     _prefData = new PrefData;
+   }
+ 
++  public static char[] pref_dir()
++  {
++    char * home = getenv("HOME");
++    if (home is null)
++      throw new Error("HOME environment variable not defined");
++    char[] dir = std.string.toString(home) ~ "/.val-and-rick";
++    try {
++      mkdir(dir);
++    } catch (FileException e) {
++    }
++    return dir;
++  }
++
+   public void load() {
+     auto File fd = new File;
+     try {
+       int ver;
+-      fd.open(PREF_FILE);
++      fd.open(pref_dir() ~ "/" ~ PREF_FILE);
+       fd.read(ver);
+       if (ver != VERSION_NUM)
+         throw new Error("Wrong version num");
+@@ -41,7 +57,7 @@
+ 
+   public void save() {
+     auto File fd = new File;
+-    fd.create(PREF_FILE);
++    fd.create(pref_dir() ~ "/" ~ PREF_FILE);
+     fd.write(VERSION_NUM);
+     _prefData.save(fd);
+     fd.close();
+Index: val-and-rick-0.1a.dfsg1/src/abagames/vr/replay.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/vr/replay.d	2007-09-05 07:56:30.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/src/abagames/vr/replay.d	2007-09-05 07:58:45.000000000 +0000
+@@ -8,13 +8,13 @@
+ private import std.stream;
+ private import abagames.util.sdl.recordableinput;
+ private import abagames.util.sdl.pad;
++private import abagames.vr.prefmanager;
+ 
+ /**
+  * Manage a replay data.
+  */
+ public class ReplayData {
+  public:
+-  static const char[] dir = "replay";
+   static const int VERSION_NUM = 10;
+   InputRecord!(PadState) inputRecord;
+   long seed;
+@@ -22,7 +22,7 @@
+ 
+   public void save(char[] fileName) {
+     auto File fd = new File;
+-    fd.create(dir ~ "/" ~ fileName);
++    fd.create(PrefManager.pref_dir() ~ "/" ~ fileName);
+     fd.write(VERSION_NUM);
+     fd.write(seed);
+     inputRecord.save(fd);
+@@ -31,7 +31,7 @@
+ 
+   public void load(char[] fileName) {
+     auto File fd = new File;
+-    fd.open(dir ~ "/" ~ fileName);
++    fd.open(PrefManager.pref_dir() ~ "/" ~ fileName);
+     int ver;
+     fd.read(ver);
+     if (ver != VERSION_NUM)
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/endian-clean.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/endian-clean.patch
@@ -0,0 +1,37 @@
+# Copyright (C) 2007  Peter De Wachter <pdewacht@gmail.com>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/texture.d	2007-09-06 01:30:44.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/texture.d	2007-09-06 01:30:44.000000000 +0200
+@@ -95,13 +95,13 @@
+         }
+         glBindTexture(GL_TEXTURE_2D, num + ti);
+         gluBuild2DMipmaps(GL_TEXTURE_2D, 4, panelWidth, panelHeight,
+-                          GL_RGBA, GL_UNSIGNED_BYTE, pixels);
++                          GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, pixels);
+         glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
+         glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
+         if (maskColor != 0xffffffffu) {
+           glBindTexture(GL_TEXTURE_2D, maskNum + ti);
+           gluBuild2DMipmaps(GL_TEXTURE_2D, 4, panelWidth, panelHeight,
+-                            GL_RGBA, GL_UNSIGNED_BYTE, maskPixels);
++                            GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, maskPixels);
+           glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR_MIPMAP_NEAREST);
+           glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
+         }
+Index: val-and-rick-0.1a.dfsg1/import/opengl.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/import/opengl.d	2007-09-06 01:35:33.000000000 +0200
++++ val-and-rick-0.1a.dfsg1/import/opengl.d	2007-09-06 01:36:07.000000000 +0200
+@@ -21,6 +21,9 @@
+ /* Version */
+ const uint GL_VERSION_1_1 = 1;
+ 
++/* OpenGL 1.2 extension needed. Sorry. */
++const uint GL_UNSIGNED_INT_8_8_8_8_REV   = 0x8367;
++
+ /* AccumOp */
+ const uint GL_ACCUM                      = 0x0100;
+ const uint GL_LOAD                       = 0x0101;
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/resizable.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/resizable.patch
@@ -0,0 +1,45 @@
+# Copyright (C) 2007  Peter De Wachter <pdewacht@gmail.com>
+# Copyright (C) 2007  Miriam Ruiz <little_miry@yahoo.es>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/screen3d.d
+===================================================================
+--- val-and-rick-0.1a.dfsg1.orig/src/abagames/util/sdl/screen3d.d	2007-09-05 08:09:38.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/src/abagames/util/sdl/screen3d.d	2007-09-05 08:10:56.000000000 +0000
+@@ -23,6 +23,7 @@
+   int _width = 640;
+   int _height = 480;
+   bool _windowMode = true;
++  Uint32 _videoFlags;
+ 
+   protected abstract void init();
+   protected abstract void close();
+@@ -34,13 +35,12 @@
+         "Unable to initialize SDL: " ~ std.string.toString(SDL_GetError()));
+     }
+     // Create an OpenGL screen.
+-    Uint32 videoFlags;
+     if (_windowMode) {
+-      videoFlags = SDL_OPENGL | SDL_RESIZABLE;
++      _videoFlags = SDL_OPENGL | SDL_RESIZABLE;
+     } else {
+-      videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
++      _videoFlags = SDL_OPENGL | SDL_FULLSCREEN;
+     } 
+-    if (SDL_SetVideoMode(_width, _height, 0, videoFlags) == null) {
++    if (SDL_SetVideoMode(_width, _height, 0, _videoFlags) == null) {
+       throw new SDLInitFailedException
+         ("Unable to create SDL screen: " ~ std.string.toString(SDL_GetError()));
+     }
+@@ -53,6 +53,11 @@
+ 
+   // Reset a viewport when the screen is resized.
+   public void screenResized() {
++    if (SDL_SetVideoMode(width, height, 0, _videoFlags) == null) {
++      throw new Exception
++        ("Unable to resize SDL screen: " ~ std.string.toString(SDL_GetError()));
++    }
++
+     glViewport(0, 0, _width, _height);
+     glMatrixMode(GL_PROJECTION);
+     glLoadIdentity();
--- val-and-rick-0.1a.dfsg1.orig/debian/patches/makefile.patch
+++ val-and-rick-0.1a.dfsg1/debian/patches/makefile.patch
@@ -0,0 +1,44 @@
+# Copyright (C) 2007  Miriam Ruiz <little_miry@yahoo.es>
+# Distributed under the same license as the game. See debian/copyright.
+
+Index: val-and-rick-0.1a.dfsg1/Makefile
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ val-and-rick-0.1a.dfsg1/Makefile	2007-09-05 07:48:37.000000000 +0000
+@@ -0,0 +1,36 @@
++SOURCES=$(shell find src -name "*.d")
++OBJS=$(SOURCES:.d=.o)
++LSOURCES=$(shell find import -name "*.d")
++LOBJS=$(LSOURCES:.d=.o)
++CSOURCES=$(shell find src -name "*.c")
++COBJS=$(CSOURCES:.c=.o)
++
++LDFLAGS=
++CFLAGS=-O2 -Wall
++DFLAGS=-O -release
++#DFLAGS=-g -debug
++CC=gcc
++DC=gdmd
++LIBS=-lbulletml -lGLU -lGL `sdl-config --libs` -lSDL_mixer
++EXE=val-and-rick
++
++all: $(EXE)
++
++$(EXE): $(LOBJS) $(OBJS) $(COBJS)
++	gdc $(LDFLAGS) -o $@ $+ $(LIBS)
++
++$(LOBJS): %.o: %.d
++	$(DC) -d -c -of$@ $(DFLAGS) -Iimport $<
++
++$(OBJS): %.o: %.d
++	$(DC) -d -c -of$@ $(DFLAGS) -Iimport -Isrc $<
++
++$(COBJS): %.o: %.c
++	$(CC) -c -o $@ $(CFLAGS) `sdl-config --cflags` $<
++
++clean:
++	$(RM) -f src/*.o
++	$(RM) -f src/abagames/vr/*.o
++	$(RM) -f src/abagames/util/*.o
++	$(RM) -f src/abagames/util/sdl/*.o
++	$(RM) -f import/*.o
--- val-and-rick-0.1a.dfsg1.orig/debian/compat
+++ val-and-rick-0.1a.dfsg1/debian/compat
@@ -0,0 +1 @@
+5
--- val-and-rick-0.1a.dfsg1.orig/debian/control
+++ val-and-rick-0.1a.dfsg1/debian/control
@@ -0,0 +1,34 @@
+Source: val-and-rick
+Section: games
+Priority: extra
+Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org> 
+Uploaders: Miriam Ruiz <little_miry@yahoo.es>, Peter De Wachter <pdewacht@gmail.com>
+Build-Depends: debhelper (>= 5), quilt, gdc,
+ libglu1-mesa-dev | libglu-dev, libgl1-mesa-dev | libgl-dev,
+ libsdl1.2-dev, libsdl-mixer1.2-dev, libbulletml-dev
+Standards-Version: 3.7.3
+Vcs-Svn: svn://svn.debian.org/svn/pkg-games/packages/trunk/val-and-rick/
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-games/packages/trunk/val-and-rick/?op=log
+XS-DM-Upload-Allowed: yes
+
+Package: val-and-rick
+Architecture: any
+Depends: val-and-rick-data (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: shooter game
+ Val & Rick is probably the precursor to Gunroar, featuring similar controls
+ but in a different environment. Only 2D sprites and backgrounds are used in
+ what seems like a tribute to Xevious and Star Soldier.
+ .
+ Val & Rick is another gem among many by Kenta Cho.
+
+Package: val-and-rick-data
+Architecture: all
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: val-and-rick
+Description: shooter game - game data
+ Val & Rick is probably the precursor to Gunroar, featuring similar controls
+ but in a different environment. Only 2D sprites and backgrounds are used in
+ what seems like a tribute to Xevious and Star Soldier.
+ .
+ This package includes the architecture-independent data for Kenta Cho's game
+ Val & Rick.
--- val-and-rick-0.1a.dfsg1.orig/debian/val-and-rick.xpm
+++ val-and-rick-0.1a.dfsg1/debian/val-and-rick.xpm
@@ -0,0 +1,38 @@
+/* XPM */
+static char *dummy[]={
+"32 32 3 1",
+". c None",
+"# c #000000",
+"a c #0c74ec",
+"...#####................#####...",
+".#######................#######.",
+".####.........aaaa.........####.",
+"###...........aaaa...........###",
+"###..........................###",
+"##............................##",
+"##............aaaa............##",
+"##............aaaa............##",
+"................................",
+"................................",
+"..............aaaa..............",
+"..............aaaa..............",
+"................................",
+"................................",
+"..aa..aa..aa........aa..aa..aa..",
+"..aa..aa..aa........aa..aa..aa..",
+"..aa..aa..aa........aa..aa..aa..",
+"..aa..aa..aa........aa..aa..aa..",
+"................................",
+"................................",
+"..............aaaa..............",
+"..............aaaa..............",
+"................................",
+"................................",
+"##............aaaa............##",
+"##............aaaa............##",
+"##............................##",
+"###..........................###",
+"###...........aaaa...........###",
+".####.........aaaa.........####.",
+".#######................#######.",
+"...#####................#####..."};
--- val-and-rick-0.1a.dfsg1.orig/debian/copyright
+++ val-and-rick-0.1a.dfsg1/debian/copyright
@@ -0,0 +1,62 @@
+This package was debianized by Miriam Ruiz <little_miry@yahoo.es> on
+Sat, 25 Aug 2007 19:58:40 +0000.
+
+It was downloaded from http://www.asahi-net.or.jp/~cs8k-cyu/windows/vr0_1a.zip
+
+Upstream Author: 
+
+    Kenta Cho <cs8k-cyu@asahi-net.or.jp>
+
+Copyright: 
+
+    Copyright 2005 Kenta Cho
+
+    import/SDL* : Copyright (C) 1997, 1998, 1999, 2000, 2001  Sam Lantinga
+
+License:
+
+    Redistribution and use in source and binary forms, with or without
+    modification, are permitted provided that the following conditions
+    are met: 
+
+     1. Redistributions of source code must retain the above copyright notice, 
+        this list of conditions and the following disclaimer. 
+
+     2. Redistributions in binary form must reproduce the above copyright notice, 
+        this list of conditions and the following disclaimer in the documentation 
+        and/or other materials provided with the distribution. 
+
+    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 
+    INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
+    FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 
+    THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
+    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 
+    OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
+    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
+    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
+    ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+
+
+import/SDL*:
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU Lesser General
+Public License can be found in `/usr/share/common-licenses/LGPL'.
+
+
+The Debian packaging is (C) 2007, Miriam Ruiz <little_miry@yahoo.es> and
+is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
--- val-and-rick-0.1a.dfsg1.orig/debian/docs
+++ val-and-rick-0.1a.dfsg1/debian/docs
@@ -0,0 +1 @@
+readme.txt
--- val-and-rick-0.1a.dfsg1.orig/debian/val-and-rick-data.install
+++ val-and-rick-0.1a.dfsg1/debian/val-and-rick-data.install
@@ -0,0 +1,3 @@
+images usr/share/games/val-and-rick/
+sounds usr/share/games/val-and-rick/
+barrage usr/share/games/val-and-rick/
--- val-and-rick-0.1a.dfsg1.orig/debian/menu
+++ val-and-rick-0.1a.dfsg1/debian/menu
@@ -0,0 +1,3 @@
+?package(val-and-rick):needs="X11" section="Games/Action"\
+  title="Val & Rick" command="/usr/games/val-and-rick" \
+  icon="/usr/share/pixmaps/val-and-rick.xpm"
--- val-and-rick-0.1a.dfsg1.orig/debian/changelog
+++ val-and-rick-0.1a.dfsg1/debian/changelog
@@ -0,0 +1,17 @@
+val-and-rick (0.1a.dfsg1-2) unstable; urgency=low
+
+  [ Peter De Wachter ]
+  * Fixed link command, patch from Arthur Loiret. (Closes: #458281)
+  * Fixed segfault when SDL init fails. (Closes: #456024)
+
+  [ Miriam Ruiz ]
+  * Added XS-DM-Upload-Allowed tag to control to allow uploads from Debian
+    Maintainers.
+
+ -- Miriam Ruiz <little_miry@yahoo.es>  Thu, 03 Jan 2008 12:12:59 +0000
+
+val-and-rick (0.1a.dfsg1-1) unstable; urgency=low
+
+  * Initial release. Closes: #440901
+
+ -- Miriam Ruiz <little_miry@yahoo.es>  Sat, 25 Aug 2007 19:58:40 +0000
--- val-and-rick-0.1a.dfsg1.orig/debian/val-and-rick.6
+++ val-and-rick-0.1a.dfsg1/debian/val-and-rick.6
@@ -0,0 +1,55 @@
+.\" (c) 2007 Miriam Ruiz <little_miry@yahoo.es>
+.\" (c) 2005 Kenta Cho <cs8k-cyu@asahi-net.or.jp>
+.\" 
+.\" This document is free software; you can redistribute it and/or modify
+.\" it under the terms of the GNU General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or
+.\" (at your option) any later version.
+.\" 
+.\" This package is distributed in the hope that it will be useful,
+.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
+.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+.\" GNU General Public License for more details.
+.\" 
+.\" You should have received a copy of the GNU General Public License
+.\" along with this package; if not, write to the Free Software
+.\" Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+.TH "Val & Rick" "6" "" "" ""
+.SH "NAME"
+val-and-rick \- shooter game
+.SH "DESCRIPTION"
+Val and Rick is probably the precursor to Gunroar, featuring similar controls but in a different environment. Only 2D sprites and backgrounds are used in what seems like a tribute to Xevious and Star Soldier.
+.SH "OPTIONS"
+These options are available:
+.TP 
+\fB\-brightness n\fR
+Set the brightness of the screen.(n = 0 \- 100, default = 100)
+.TP 
+\fB\-luminous n\fR
+Set the luminous intensity.(n = 0 \- 100, default = 50)
+.TP 
+\fB\-nosound\fR
+Stop the sound.
+.TP 
+\fB\-window\fR
+Launch the game in a window.
+.TP 
+\fB\-fullscreen\fR
+Launch the game in fullscreen.
+.TP 
+\fB\-res width height\fR
+Sets the resolution of the screen in pixels.
+.TP 
+\fB\-nosound\fR
+.TP 
+\fB\-nowait\fR
+.TP 
+\fB\-accframe\fR
+.SH "USAGE"
+Press the Z key to shoot and hold down the X key to fix the direction of your aim.
+
+A power\-up icon in the shape of a tiny ship named Rick will appear if you collect enough blue orbs from defeated enemies, which is indicated at the bottom left of the screen. This will cause your ship to go into hyperdrive, that is until all energy is spent or your spacecraft takes damage from enemy bullets. Each successful hyperdrive attempt increases the counter by another hundred.
+
+The X key can also be used to drop bombs on grounded objects. Tap the P key to pause. The closer your ship is to the top of the screen, the faster it scrolls.
+.SH "AUTHOR"
+This game has been written by Kenta Cho <cs8k\-cyu@asahi\-net.or.jp>
--- val-and-rick-0.1a.dfsg1.orig/debian/val-and-rick.install
+++ val-and-rick-0.1a.dfsg1/debian/val-and-rick.install
@@ -0,0 +1,3 @@
+val-and-rick usr/games/
+debian/*.xpm usr/share/pixmaps/
+debian/*.desktop usr/share/applications/
--- val-and-rick-0.1a.dfsg1.orig/debian/val-and-rick.desktop
+++ val-and-rick-0.1a.dfsg1/debian/val-and-rick.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Type=Application
+Encoding=UTF-8
+Name=Val & Rick
+GenericName=
+Comment=Kenta Cho's Val & Rick
+Icon=val-and-rick.xpm
+Exec=/usr/games/val-and-rick
+Terminal=false
+Categories=Game;ArcadeGame;
--- val-and-rick-0.1a.dfsg1.orig/debian/rules
+++ val-and-rick-0.1a.dfsg1/debian/rules
@@ -0,0 +1,81 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+	DFLAGS = -g -debug -d
+else
+	CFLAGS += -O2
+	DFLAGS = -O -release -d
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	#ant -v
+	$(MAKE) -f /usr/share/quilt/quilt.make patch
+	touch $@
+
+build: build-stamp
+build-stamp: configure-stamp 
+	dh_testdir
+	$(MAKE) CFLAGS="$(CFLAGS)" DFLAGS="$(DFLAGS)"
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	#ant -v clean
+	[ ! -f Makefile ] || $(MAKE) clean
+	rm -f val-and-rick
+	rm -f `find . -name "*.o"`
+	$(MAKE) -f /usr/share/quilt/quilt.make unpatch
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+# Build architecture-independent files here.
+binary-indep: build install
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs 
+	dh_installdocs
+	dh_install
+	dh_installmenu
+	dh_installman debian/*.6
+	dh_desktop
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+get-orig-source:
+	dh_testdir
+	dh_testroot
+	wget http://www.asahi-net.or.jp/~cs8k-cyu/windows/vr0_1a.zip
+	unzip vr0_1a.zip
+	rm vr/*.dll
+	rm vr/*.exe
+	rm vr/lib/*.lib
+	tar cvfz ../val-and-rick_0.1a.dfsg1.orig.tar.gz vr
+	rm -rf vr0_1a.zip vr
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source
