[SCM] Packaging for quakespasm branch, master, updated. debian/0.85.4-1-7-gee7e9b5

Stephen Kitt steve at sk2.org
Thu Jan 26 21:33:20 UTC 2012


The following commit has been merged in the master branch:
commit 3cf457ca6c678232be38cd03a46497e362d4ea06
Author: Stephen Kitt <steve at sk2.org>
Date:   Thu Jan 26 22:28:10 2012 +0100

    New upstream release:
    - Drop debian/patches/history-in-dotfile.patch, fixed differently
      upstream.
    - Refresh debian/patches/support-user-directories.patch using the
      upstream-provided patch in Misc/homedir_0.patch.

diff --git a/debian/changelog b/debian/changelog
index 7beda95..7a517af 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,17 @@
-quakespasm (0.85.4-2) UNRELEASED; urgency=low
+quakespasm (0.85.6-1) UNRELEASED; urgency=low
 
+  [ Stephen Kitt ]
+  * New upstream release:
+    - Drop debian/patches/history-in-dotfile.patch, fixed differently
+      upstream.
+    - Refresh debian/patches/support-user-directories.patch using the
+      upstream-provided patch in Misc/homedir_0.patch.
+  
+  [ Simon McVittie ]
   * debian/patches/gnu.patch: add "gnu" as an OS type, so compilation can at
     least be attempted on Hurd and kFreeBSD
 
- -- Simon McVittie <smcv at debian.org>  Tue, 19 Jul 2011 10:57:06 +0100
+ -- Stephen Kitt <steve at sk2.org>  Mon, 23 Jan 2012 06:44:41 +0100
 
 quakespasm (0.85.4-1) unstable; urgency=low
 
diff --git a/debian/patches/gnu.patch b/debian/patches/gnu.patch
index 637b8e4..21755ba 100644
--- a/debian/patches/gnu.patch
+++ b/debian/patches/gnu.patch
@@ -5,9 +5,9 @@ Subject: [PATCH] Allow compilation to be at least attempted on Hurd and
  kFreeBSD
 
 Origin: vendor, Debian
---- a/Quake/Makefile
-+++ b/Quake/Makefile
-@@ -51,10 +51,18 @@
+--- quakespasm.orig/Quake/Makefile
++++ quakespasm/Quake/Makefile
+@@ -48,10 +48,18 @@
  UNIX = linux
  TOPDIR := $(shell pwd)
  else
diff --git a/debian/patches/remove-redundant-linking.patch b/debian/patches/remove-redundant-linking.patch
index a588d1b..6dcba1d 100644
--- a/debian/patches/remove-redundant-linking.patch
+++ b/debian/patches/remove-redundant-linking.patch
@@ -3,14 +3,19 @@ Description: Remove redundant linking of vorbis libraries
   but these are not required, only libvorbisfile.  This avoids an unnecessary
   dependency.
 From: David Banks <amoebae at gmail.com>
---- a/Quake/Makefile
-+++ b/Quake/Makefile
-@@ -141,7 +141,7 @@
+--- quakespasm.orig/Quake/Makefile
++++ quakespasm/Quake/Makefile
+@@ -141,11 +141,11 @@
  endif
- ifeq ($(USE_CODEC_VORBIS),1)
- CFLAGS+= -DUSE_CODEC_VORBIS
--CODECLIBS+= vorbis vorbisfile ogg
-+CODECLIBS+= vorbisfile
+ ifeq ($(VORBISLIB),vorbis)
+ cpp_vorbisdec=
+-lib_vorbisdec=-lvorbisfile -lvorbis -logg
++lib_vorbisdec=-lvorbisfile
  endif
- ifeq ($(USE_CODEC_MP3),1)
- CFLAGS+= -DUSE_CODEC_MP3
+ ifeq ($(VORBISLIB),tremor)
+ cpp_vorbisdec=-DVORBIS_USE_TREMOR
+-lib_vorbisdec=-lvorbisidec -logg
++lib_vorbisdec=-lvorbisidec
+ endif
+ 
+ CODECLIBS  :=
diff --git a/debian/patches/series b/debian/patches/series
index a084391..eaef0fe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,4 @@
 remove-redundant-linking.patch
 support-user-directories.patch
-history-in-dotfile.patch
 mp3-copyright.patch
 gnu.patch
diff --git a/debian/patches/support-user-directories.patch b/debian/patches/support-user-directories.patch
index 505088d..83fde4a 100644
--- a/debian/patches/support-user-directories.patch
+++ b/debian/patches/support-user-directories.patch
@@ -3,16 +3,14 @@ Description: Support user directories for game data and configuration
   directories under ~/.quakespasm/id1 (more generally, ~/.quakespasm/<game>).
   Data is structured in the same way as the regular Quake data directories.
 From: Ozkan Sezer <sezeroz at gmail.com>
---- a/Quake/common.c
-+++ b/Quake/common.c
-@@ -1844,32 +1844,36 @@
+--- quakespasm.orig/Quake/common.c
++++ quakespasm/Quake/common.c
+@@ -1846,32 +1846,34 @@
  COM_AddGameDirectory -- johnfitz -- modified based on topaz's tutorial
  =================
  */
--void COM_AddGameDirectory (const char *dir)
-+#define SYS_USERDIR ".quakespasm"
-+static char *homedir = NULL;
-+void COM_AddGameDirectory (const char *base, const char *dir)
+-static void COM_AddGameDirectory (const char *dir)
++static void COM_AddGameDirectory (const char *base, const char *dir)
  {
  	int i;
  	unsigned int path_id;
@@ -21,8 +19,8 @@ From: Ozkan Sezer <sezeroz at gmail.com>
  	char pakfile[MAX_OSPATH];
 +	qboolean been_here = false;
  
--	strcpy (com_gamedir, dir);
-+	strcpy (com_gamedir, va("%s/%s", base, dir));
+-	q_strlcpy (com_gamedir, dir, sizeof(com_gamedir));
++	q_strlcpy (com_gamedir, va("%s/%s", base, dir), sizeof(com_gamedir));
  
  	// assign a path_id to this game directory
  	if (com_searchpaths)
@@ -33,56 +31,45 @@ From: Ozkan Sezer <sezeroz at gmail.com>
  	// add the directory to the search path
  	search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
  	search->path_id = path_id;
--	strcpy (search->filename, dir);
-+	strcpy (search->filename, com_gamedir);
+-	q_strlcpy (search->filename, dir, sizeof(search->filename));
++	q_strlcpy (search->filename, com_gamedir, sizeof(search->filename));
  	search->next = com_searchpaths;
  	com_searchpaths = search;
  
  	// add any pak files in the format pak0.pak pak1.pak, ...
  	for (i = 0; ; i++)
  	{
--		sprintf (pakfile, "%s/pak%i.pak", dir, i);
-+		sprintf (pakfile, "%s/pak%i.pak", com_gamedir, i);
+-		q_snprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", dir, i);
++		q_snprintf (pakfile, sizeof(pakfile), "%s/pak%i.pak", com_gamedir, i);
  		pak = COM_LoadPackFile (pakfile);
  		if (!pak)
  			break;
-@@ -1879,6 +1883,14 @@
+@@ -1881,6 +1883,14 @@
  		search->next = com_searchpaths;
  		com_searchpaths = search;
  	}
 +
-+	if (!been_here && homedir != NULL)
++	if (!been_here && host_parms->userdir != host_parms->basedir)
 +	{
 +		been_here = true;
-+		strcpy(com_gamedir, va("%s/%s/%s", homedir, SYS_USERDIR, dir));
++		q_strlcpy(com_gamedir, va("%s/%s", host_parms->userdir, dir), sizeof(com_gamedir));
 +		Sys_mkdir(com_gamedir);
 +		goto _add_path;
 +	}
  }
  
  #if defined(USE_QS_CONBACK)
-@@ -1915,6 +1927,10 @@
- {
- 	int i, j;
- 
-+	homedir = getenv("HOME");
-+	if (homedir)
-+		Sys_mkdir (va("%s/%s", homedir, SYS_USERDIR));
-+
- 	i = COM_CheckParm ("-basedir");
- 	if (i && i < com_argc-1)
- 		strcpy (com_basedir, com_argv[i + 1]);
-@@ -1929,8 +1945,7 @@
+@@ -1935,8 +1945,7 @@
  	}
  
  	// start up with GAMENAME by default (id1)
 -	COM_AddGameDirectory (va("%s/"GAMENAME, com_basedir));
--	strcpy (com_gamedir, va("%s/"GAMENAME, com_basedir));
+-	q_strlcpy (com_gamedir, va("%s/"GAMENAME, com_basedir), sizeof(com_gamedir));
 +	COM_AddGameDirectory (com_basedir, GAMENAME);
  
  #if defined(USE_QS_CONBACK)
  	if (!fitzmode)
-@@ -1944,17 +1959,17 @@
+@@ -1950,17 +1959,17 @@
  	com_nummissionpacks = 0;
  	if (COM_CheckParm ("-rogue"))
  	{
@@ -103,12 +90,78 @@ From: Ozkan Sezer <sezeroz at gmail.com>
  		com_nummissionpacks++;
  	}
  	//johnfitz
-@@ -1963,7 +1978,7 @@
+@@ -1969,7 +1978,7 @@
  	if (i && i < com_argc-1)
  	{
  		com_modified = true;
 -		COM_AddGameDirectory (va("%s/%s", com_basedir, com_argv[i + 1]));
 +		COM_AddGameDirectory (com_basedir, com_argv[i + 1]);
  	}
+ 
+ 	COM_CheckRegistered ();
+--- quakespasm.orig/Quake/sys_sdl_unix.c
++++ quakespasm/Quake/sys_sdl_unix.c
+@@ -20,6 +20,8 @@
+ 
+ */
+ 
++#define USE_PASSWORD_FILE 1
++
+ #include "quakedef.h"
+ 
+ #include <sys/types.h>
+@@ -29,6 +31,9 @@
+ #include <sys/time.h>
+ #include <fcntl.h>
+ #include <time.h>
++#if USE_PASSWORD_FILE
++#include <pwd.h>
++#endif	/* USE_PASSWORD_FILE */
+ 
+ #include "SDL.h"
+ 
+@@ -139,9 +144,43 @@
+ 	return -1;
+ }
+ 
++#define SYS_USERDIR	".quakespasm"
++static char	userdir[MAX_OSPATH];
++
++static void Sys_GetUserdir (char *dst, size_t dstsize)
++{
++	size_t		n;
++	const char	*home_dir = NULL;
++#if USE_PASSWORD_FILE
++	struct passwd	*pwent;
++
++	pwent = getpwuid( getuid() );
++	if (pwent == NULL)
++		perror("getpwuid");
++	else
++		home_dir = pwent->pw_dir;
++#endif
++	if (home_dir == NULL)
++		home_dir = getenv("HOME");
++	if (home_dir == NULL)
++		Sys_Error ("Couldn't determine userspace directory");
++
++/* what would be a maximum path for a file in the user's directory...
++ * $HOME/SYS_USERDIR/game_dir/dirname1/dirname2/dirname3/filename.ext
++ * still fits in the MAX_OSPATH == 256 definition, but just in case :
++ */
++	n = strlen(home_dir) + strlen(SYS_USERDIR) + 50;
++	if (n >= dstsize)
++		Sys_Error ("Insufficient array size for userspace directory");
++
++	q_snprintf (dst, dstsize, "%s/%s", home_dir, SYS_USERDIR);
++}
++
+ void Sys_Init (void)
+ {
+-	host_parms->userdir = host_parms->basedir; /* TODO: implement properly! */
++	Sys_GetUserdir(userdir, sizeof(userdir));
++	Sys_mkdir (userdir);
++	host_parms->userdir = userdir;
  }
  
+ void Sys_mkdir (const char *path)

-- 
Packaging for quakespasm



More information about the Pkg-games-commits mailing list