summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authormirandir2015-12-01 11:34:29 +0100
committermirandir2015-12-01 11:34:29 +0100
commit694fb3bcfa1cb991f7ffd43e8cdfd42947e5cfbf (patch)
treeac54a281b57ded6b40014a99e110d70251f409cb
parente1c162e750aa00c4fa4733ed87bbf1d5d3f43f4e (diff)
downloadaur-694fb3bcfa1cb991f7ffd43e8cdfd42947e5cfbf.tar.gz
Add some Debian patchs
-rw-r--r--.SRCINFO18
-rw-r--r--NetPacket_buffer_size.patch23
-rw-r--r--PKGBUILD24
-rw-r--r--exit-fullscreen.patch43
-rw-r--r--format-security.patch14
-rw-r--r--handle-SDL-quit-event.patch21
-rw-r--r--no-springs.patch29
-rw-r--r--remove-XF86Config-information.patch19
-rw-r--r--remove-outdated-network-info.patch25
-rw-r--r--safe-temporary-files.patch86
10 files changed, 297 insertions, 5 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f4274c23fe66..b92ebac12f65 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = jumpnbump
pkgdesc = You, as a bunny, have to jump on your opponents to make them explode. It's a true multiplayer game which can't be played alone. It has network support. This program is a Unix port of the old DOS game by brainchilddesign.
pkgver = 1.55
- pkgrel = 5
+ pkgrel = 6
url = http://freecode.com/projects/jumpnbump
arch = i686
arch = x86_64
@@ -12,8 +12,24 @@ pkgbase = jumpnbump
optdepends = jumpnbump-menu: a launcher for jumpnbump
source = http://mirandir.pagesperso-orange.fr/files/jumpnbump-1.55.tar.gz
source = jnb.patch
+ source = exit-fullscreen.patch
+ source = format-security.patch
+ source = handle-SDL-quit-event.patch
+ source = NetPacket_buffer_size.patch
+ source = no-springs.patch
+ source = remove-outdated-network-info.patch
+ source = remove-XF86Config-information.patch
+ source = safe-temporary-files.patch
sha256sums = 95e9ec8c3148a996bd46ffea21393aa0e0868706325d5947bc932b4ba46eafcf
sha256sums = 16d4363944d8279e7da77588085f7c103afa743f977c1ea9c742959f6140253d
+ sha256sums = dd8477ce5cb52de888d5e05290f3773550aabe6a213010981b9678b119efedbc
+ sha256sums = c883804700bcaf602bdec6882fefe945519e18dfc430f05cffca34ec86c81290
+ sha256sums = c8ae29440efdadbc219cb2157912342a1c44ba1456407163156df0bba5e63959
+ sha256sums = c1ba56fbb95495cdc2212e0dd3a67e572894785c2e8efe2629324d7c5a1ea8a2
+ sha256sums = a06d0cb309e985e3ba78dd8495955b83805e67f43906634d7e782f0580b5343a
+ sha256sums = dcaadc60cf7210ec5ed87a630a7da2856b6ab483f2ea6608bc07c120bb55140b
+ sha256sums = 17877cafcd9d8440a0f2c9e8da80136a9c4c5eeebb633e7dd748a05cd0d1b6e0
+ sha256sums = f99113c04b988d2e2048b79bb58bfeba26b3aeea3937936b97b06334d34a5c4c
pkgname = jumpnbump
diff --git a/NetPacket_buffer_size.patch b/NetPacket_buffer_size.patch
new file mode 100644
index 000000000000..7356401b0520
--- /dev/null
+++ b/NetPacket_buffer_size.patch
@@ -0,0 +1,23 @@
+Subject: Fix NetPacket buffer size by adapting its member types
+Author: Fabian Greffrath <fabian+debian@greffrath.com>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762698
+
+--- a/main.c
++++ b/main.c
+@@ -273,11 +273,11 @@ NetInfo net_info[JNB_MAX_PLAYERS];
+
+ typedef struct
+ {
+- unsigned long cmd;
+- long arg;
+- long arg2;
+- long arg3;
+- long arg4;
++ Uint32 cmd;
++ Sint32 arg;
++ Sint32 arg2;
++ Sint32 arg3;
++ Sint32 arg4;
+ } NetPacket;
+
+ #define NETPKTBUFSIZE (4 + 4 + 4 + 4 + 4)
diff --git a/PKGBUILD b/PKGBUILD
index 28e16b6a5c39..991f3f71828f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,26 +4,42 @@
pkgname=jumpnbump
pkgver=1.55
-pkgrel=5
+pkgrel=6
pkgdesc="You, as a bunny, have to jump on your opponents to make them explode. It's a true multiplayer game which can't be played alone. It has network support. This program is a Unix port of the old DOS game by brainchilddesign."
arch=('i686' 'x86_64')
url="http://freecode.com/projects/jumpnbump"
license=('GPL')
depends=('sdl_mixer' 'sdl_net')
optdepends=('jumpnbump-levels: more levels for jumpnbump' 'jumpnbump-menu: a launcher for jumpnbump')
-source=("http://mirandir.pagesperso-orange.fr/files/${pkgname}-${pkgver}.tar.gz" "jnb.patch")
+source=("http://mirandir.pagesperso-orange.fr/files/${pkgname}-${pkgver}.tar.gz" "jnb.patch" "exit-fullscreen.patch" "format-security.patch" "handle-SDL-quit-event.patch" "NetPacket_buffer_size.patch" "no-springs.patch" "remove-outdated-network-info.patch" "remove-XF86Config-information.patch" "safe-temporary-files.patch")
sha256sums=('95e9ec8c3148a996bd46ffea21393aa0e0868706325d5947bc932b4ba46eafcf'
- '16d4363944d8279e7da77588085f7c103afa743f977c1ea9c742959f6140253d')
+ '16d4363944d8279e7da77588085f7c103afa743f977c1ea9c742959f6140253d'
+ 'dd8477ce5cb52de888d5e05290f3773550aabe6a213010981b9678b119efedbc'
+ 'c883804700bcaf602bdec6882fefe945519e18dfc430f05cffca34ec86c81290'
+ 'c8ae29440efdadbc219cb2157912342a1c44ba1456407163156df0bba5e63959'
+ 'c1ba56fbb95495cdc2212e0dd3a67e572894785c2e8efe2629324d7c5a1ea8a2'
+ 'a06d0cb309e985e3ba78dd8495955b83805e67f43906634d7e782f0580b5343a'
+ 'dcaadc60cf7210ec5ed87a630a7da2856b6ab483f2ea6608bc07c120bb55140b'
+ '17877cafcd9d8440a0f2c9e8da80136a9c4c5eeebb633e7dd748a05cd0d1b6e0'
+ 'f99113c04b988d2e2048b79bb58bfeba26b3aeea3937936b97b06334d34a5c4c')
build() {
+ cd "${srcdir}/${pkgname}-1.50/"
+
+ for i in 'exit-fullscreen.patch' 'format-security.patch' 'handle-SDL-quit-event.patch' 'NetPacket_buffer_size.patch' 'no-springs.patch' 'remove-outdated-network-info.patch' 'remove-XF86Config-information.patch' 'safe-temporary-files.patch'
+ do
+ patch -p1 < ${srcdir}/$i
+ done
+
cd "${srcdir}/${pkgname}-1.50/sdl/"
patch -lp0 < ../../jnb.patch || return 1
-
+
cd "${srcdir}/${pkgname}-1.50"
./configure \
--prefix=/usr \
--mandir=/usr/share/man
+
make
}
diff --git a/exit-fullscreen.patch b/exit-fullscreen.patch
new file mode 100644
index 000000000000..63be971d7b1d
--- /dev/null
+++ b/exit-fullscreen.patch
@@ -0,0 +1,43 @@
+Subject: Exit fullscreen mode on quit
+From: Dan Carpenter <error27@gmail.com>
+Date: Tue, 17 Jan 2006 08:37:51 -0800
+
+See http://bugs.debian.org/338705
+
+--- a/globals.h
++++ b/globals.h
+@@ -344,6 +344,7 @@ void register_mask(void *pixels);
+ #ifdef USE_SDL
+ /* long filelength(int handle); */
+ void fs_toggle();
++void exit_fullscreen();
+ int intr_sysupdate();
+ #endif
+
+--- a/main.c
++++ b/main.c
+@@ -3375,6 +3375,8 @@ void deinit_program(void)
+ __dpmi_regs regs;
+ #endif
+
++ exit_fullscreen();
++
+ dj_stop();
+ dj_free_mod(MOD_MENU);
+ dj_free_mod(MOD_GAME);
+--- a/sdl/gfx.c
++++ b/sdl/gfx.c
+@@ -227,6 +227,13 @@ void fs_toggle()
+ }
+
+
++void exit_fullscreen()
++{
++ if (fullscreen)
++ fs_toggle();
++}
++
++
+ void wait_vrt(int mix)
+ {
+ return;
diff --git a/format-security.patch b/format-security.patch
new file mode 100644
index 000000000000..4506b744e843
--- /dev/null
+++ b/format-security.patch
@@ -0,0 +1,14 @@
+Subject: Fix format-security vulnerability
+Author: Fabian Greffrath <fabian+debian@greffrath.com>
+
+--- a/main.c
++++ b/main.c
+@@ -3400,7 +3400,7 @@ void deinit_program(void)
+ #endif
+
+ if (main_info.error_str[0] != 0) {
+- printf(main_info.error_str);
++ printf("%s", main_info.error_str);
+ #ifdef _MSC_VER
+ MessageBox(0, main_info.error_str, "Jump'n'Bump", 0);
+ #endif
diff --git a/handle-SDL-quit-event.patch b/handle-SDL-quit-event.patch
new file mode 100644
index 000000000000..d542c374337b
--- /dev/null
+++ b/handle-SDL-quit-event.patch
@@ -0,0 +1,21 @@
+Subject: Handle SQL quit event
+From: Ansgar Burchardt <ansgar@43-1.org>
+Date: Sat Dec 13 15:00:01 2008 +0100
+
+This patch makes Jump'n'bump quit when pressing the close button or
+using other means to ask Jump'n'bump to quit (e.g. Alt+F4).
+
+Closes: #487333
+
+--- a/sdl/interrpt.c
++++ b/sdl/interrpt.c
+@@ -419,6 +419,9 @@ int intr_sysupdate()
+ break;
+ }
+ break;
++ case SDL_QUIT:
++ deinit_program();
++ break;
+ default:
+ break;
+ }
diff --git a/no-springs.patch b/no-springs.patch
new file mode 100644
index 000000000000..f5086a21e681
--- /dev/null
+++ b/no-springs.patch
@@ -0,0 +1,29 @@
+From 4a0a965547b52afc953d9bd11ab059f543551459 Mon Sep 17 00:00:00 2001
+From: Fabian Greffrath <fabian@greffrath.com>
+Date: Tue, 16 Sep 2014 19:02:37 +0200
+Subject: [PATCH] fix rabbit disappearing in upper left corner
+
+aka "undesired springs added above the screen"
+
+If the bunny jumps out of the screen, its
+y-coordinate becomes negative. Thus, the array that is checked for the
+position of the objects on the map overflows and returns some bogus,
+e.g. that there are springs whereas there aren't. This patch
+checks for the y-coordinate and caps it at zero.
+
+c.f. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=370650
+---
+ main.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/main.c
++++ b/main.c
+@@ -2096,6 +2096,8 @@ void steer_players(void)
+
+ s1 = (player[c1].x >> 16);
+ s2 = (player[c1].y >> 16);
++ if (s2 < 0)
++ s2 = 0;
+ if (ban_map[(s2 + 15) >> 4][(s1 + 8) >> 4] == BAN_SPRING || ((ban_map[(s2 + 15) >> 4][s1 >> 4] == BAN_SPRING && ban_map[(s2 + 15) >> 4][(s1 + 15) >> 4] != BAN_SOLID) || (ban_map[(s2 + 15) >> 4][s1 >> 4] != BAN_SOLID && ban_map[(s2 + 15) >> 4][(s1 + 15) >> 4] == BAN_SPRING))) {
+ player[c1].y = ((player[c1].y >> 16) & 0xfff0) << 16;
+ player[c1].y_add = -400000L;
diff --git a/remove-XF86Config-information.patch b/remove-XF86Config-information.patch
new file mode 100644
index 000000000000..2e11fd82a280
--- /dev/null
+++ b/remove-XF86Config-information.patch
@@ -0,0 +1,19 @@
+Subject: Remove modeline for XF86Config-4 from README
+
+--- a/README
++++ b/README
+@@ -24,14 +24,6 @@ Thanks to ben for making patches to run
+ Thanks to ivo for doing debian packages.
+
+ f10 change between windowed/fullscreen mode
+-(see the XF86Config-4, copy n paste the modeline 400x256
+-then add the mode "400x256" to whatever bpp you have by default, restart x)
+-example: add following line in Section "Monitor" of your
+-/etc/X11/XF86Config (or XF86Config-4)
+-Modeline "400x256" 22.00 400 416 480 504 256 259 262 269 doublescan
+-then in Section "Screen" if your DefaultDepth is 24 do be sure you have
+-something like:
+-Modes "1024x768" "640x480" "512x384" "400x256" "320x240"
+ esc/f12 exit
+
+ For compilation you will need:
diff --git a/remove-outdated-network-info.patch b/remove-outdated-network-info.patch
new file mode 100644
index 000000000000..e955be0ceca0
--- /dev/null
+++ b/remove-outdated-network-info.patch
@@ -0,0 +1,25 @@
+Subject: Remove outdated network information from README
+From: Francois Marier <francois@debian.org>
+Date: Sun, 26 Jun 2005 13:02:29 -0400
+
+See http://bugs.debian.org/314221.
+
+--- a/README
++++ b/README
+@@ -44,16 +44,6 @@ which you can start with: jumpnbump -dat
+ there's a screensaver mode as well:
+ jumpnbump -fireworks -fullscreen
+
+-Network play works like this, oh well here's an example
+-Player 1: jumpnbump -port 7777 -net 0 ip_or_hostname_of_player2 port_of_player2
+-Player 2: jumpnbump -port 7777 -net 1 ip_or_hostname_of_player1 port_of_player1
+-just take port 7777 for all ports and hope it's open and you aren't
+-firewalled (it's all udp!)
+-You can add -net 3 and -net 4 for 3rd and 4th player, and be sure.
+-All the players use the same -dat level.dat
+-(the scoreboards is different on each player and strange things like
+-that, but longislandman is working on it (isn't it? longislandman? you alive?))
+-
+ You can find the original dos game (which runs in dos/win9x (dosextender!))
+ at http://www.brainchilddesign.com/games/jumpnbump/index.html
+
diff --git a/safe-temporary-files.patch b/safe-temporary-files.patch
new file mode 100644
index 000000000000..e1e13c6f3e66
--- /dev/null
+++ b/safe-temporary-files.patch
@@ -0,0 +1,86 @@
+Subject: Handle temporary files in a safe way
+From: Ansgar Burchardt <ansgar@43-1.org>
+Date: Mon, 29 Sep 2008 22:01:59 +0200
+
+See http://bugs.debian.org/500611.
+
+--- a/modify/jnbunpack.c
++++ b/modify/jnbunpack.c
+@@ -23,6 +23,7 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
++#include <errno.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <fcntl.h>
+@@ -83,8 +84,13 @@ int main(int argc, char **argv)
+ memset(filename, 0, sizeof(filename));
+ strncpy(filename, datafile[i].filename, 12);
+ printf("Extracting %s ", filename);
++ fflush(stdout);
+
+- outfd = open(filename, O_RDWR | O_CREAT | O_BINARY, 0644);
++ if (unlink(filename) == -1 && errno != ENOENT) {
++ perror("cannot unlink file");
++ exit(1);
++ }
++ outfd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0644);
+ if (!outfd) {
+ perror("cant open file");
+ exit(1);
+--- a/sdl/sound.c
++++ b/sdl/sound.c
+@@ -23,6 +23,8 @@
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
++#include <stdlib.h>
++#include <string.h>
+ #include "globals.h"
+ #include <limits.h>
+ #ifndef _MSC_VER
+@@ -463,11 +465,8 @@ char dj_ready_mod(char mod_num)
+ {
+ #ifndef NO_SDL_MIXER
+ FILE *tmp;
+-# if ((defined _MSC_VER) || (defined __MINGW32__))
+- char filename[] = "jnb.tmpmusic.mod";
+-# else
+- char filename[] = "/tmp/jnb.tmpmusic.mod";
+-# endif
++ int tmp_fd;
++ char* filename;
+ unsigned char *fp;
+ int len;
+
+@@ -506,15 +505,24 @@ char dj_ready_mod(char mod_num)
+ return 0;
+ }
+
+- tmp = fopen(filename, "wb");
+- if (tmp) {
+- fwrite(fp, len, 1, tmp);
+- fflush(tmp);
+- fclose(tmp);
++ filename = strdup("/tmp/jumpnbump.mod.XXXXXX");
++ tmp_fd = mkstemp(filename);
++ if (tmp_fd == -1) {
++ free(filename);
++ return 0;
++ }
++ tmp = fdopen(tmp_fd, "wb");
++ if (!tmp) {
++ free(filename);
++ return 0;
+ }
++ fwrite(fp, len, 1, tmp);
++ fflush(tmp);
++ fclose(tmp);
+
+ current_music = Mix_LoadMUS(filename);
+ unlink(filename);
++ free(filename);
+ if (current_music == NULL) {
+ fprintf(stderr, "Couldn't load music: %s\n", SDL_GetError());
+ return 0;