--- xscavenger-1.4.4.orig/debian/Imakefile.debian +++ xscavenger-1.4.4/debian/Imakefile.debian @@ -0,0 +1,39 @@ +# set this to the path where data files should be stored. LIBDIR +# is automatically defined by imake, usually to /usr/X11R6/lib/X11, so +# this should be a good default. + +LIBNAME = /usr/lib/games/xscavenger + +SRCS = anim.c edit.c scav.c x.c sound.c +OBJS = $(SRCS:.c=.o) + +# the "subst" hack below is because imake uses the C preprocessor, which +# will interpret an unquoted "/*" as a comment beginning. +#LIB_DATA = $(subst S,/,..SdataS*) +LIB_DATA = \ + ../data/badguy.lbm \ + ../data/brownblue.lbm \ + ../data/death.raw \ + ../data/dig.raw \ + ../data/fall.raw \ + ../data/flashspiral.lbm \ + ../data/gems.lbm \ + ../data/jungle.lbm \ + ../data/levels.scl \ + ../data/microman.lbm \ + ../data/pop.raw \ + ../data/redbrick.lbm \ + ../data/reddevil.lbm \ + ../data/regularguy.lbm \ + ../data/spiralthing.lbm \ + ../data/victory.raw + + +LOCAL_LIBRARIES = $(XLIB) +EXTRA_DEFINES = -DLIBNAME=\"$(LIBNAME)\" + +AllTarget(xscavenger) +NormalProgramTarget(xscavenger,$(OBJS),,,$(XLIB)) +InstallProgram(xscavenger,/usr/games) + +InstallMultipleFlags($(LIB_DATA),$(LIBNAME),-m 644) --- xscavenger-1.4.4.orig/debian/Imakefile.default +++ xscavenger-1.4.4/debian/Imakefile.default @@ -0,0 +1,20 @@ +# set this to the path where data files should be stored. LIBDIR +# is automatically defined by imake, usually to /usr/X11R6/lib/X11, so +# this should be a good default. +LIBNAME = $(LIBDIR)/scavenger + +SRCS = anim.c edit.c scav.c x.c sound.c +OBJS = $(SRCS:.c=.o) + +LIB_DATA = \ + ../data/badguy.lbm ../data/brownblue.lbm ../data/death.raw \ + ../data/dig.raw ../data/fall.raw ../data/levels.scl \ + ../data/microman.lbm ../data/pop.raw ../data/redbrick.lbm \ + ../data/reddevil.lbm ../data/regularguy.lbm ../data/spiralthing.lbm \ + ../data/victory.raw + +LOCAL_LIBRARIES = $(XLIB) +EXTRA_DEFINES = -DLIBNAME=\"$(LIBNAME)\" + +ComplexProgramTarget(scavenger) +InstallMultipleFlags($(LIB_DATA),$(LIBNAME),-m 644) --- xscavenger-1.4.4.orig/debian/README.Debian +++ xscavenger-1.4.4/debian/README.Debian @@ -0,0 +1,12 @@ +xscavenger for DEBIAN +---------------------- + +In Debian, scavenger is called "xscavenger". + +Please contact me if you have any problems with this package. + +H. S. Teoh , Wed Nov 27 22:12:33 EST 2002 + +I have taken over maintainership of this package. The previous maintainer, if +you wish to contact him, was: +Marcus Brinkmann , Sat, 15 Nov 1997 20:26:30 +0100 --- xscavenger-1.4.4.orig/debian/changelog +++ xscavenger-1.4.4/debian/changelog @@ -0,0 +1,210 @@ +xscavenger (1.4.4-9) unstable; urgency=low + + * Set StartupNotify to false in .desktop file. (Closes: #626769) + * Fix lintian warnings: + - Fix description to conform to recommended format + - Add hardening options to compile flags + - Update to Standards-Version: 3.9.4 + - Add recommended build rules to debian/rules + + -- Hwei Sheng Teoh Wed, 31 Jul 2013 11:51:22 -0700 + +xscavenger (1.4.4-8) unstable; urgency=low + + * Add xscavenger.desktop file. Thanks, Steinar Bang! (Closes: #603443) + * Update to policy version 3.9.1. + + -- Hwei Sheng Teoh Mon, 15 Nov 2010 09:49:32 -0800 + +xscavenger (1.4.4-7) unstable; urgency=low + + * Add xutils-dev to Build-Depends (Closes: #485724) + * Add libxext-dev to Build-Depends (Closes: #486977) + * Update to policy version 3.8.0.1. + * Add year to copyright file (based on upstream website info). + + -- Hwei Sheng Teoh Mon, 23 Jun 2008 11:27:06 -0700 + +xscavenger (1.4.4-6) unstable; urgency=low + + * Fix FTBFS (Closes: #474882) + + -- Hwei Sheng Teoh Mon, 07 Apr 2008 15:05:38 -0700 + +xscavenger (1.4.4-5) unstable; urgency=low + + * debian/rules: Don't strip binaries if DEB_BUILD_OPTIONS contains + 'nostrip' (Closes: #438329) + * Suppress compiler pointer signedness warnings. + * Update to Standards-Version: 3.7.2 + * Update to latest menu policy. + + -- Hwei Sheng Teoh Sat, 15 Sep 2007 09:22:52 -0700 + +xscavenger (1.4.4-4) unstable; urgency=low + + * Fix Build-Depends: to list explicit libraries rather than xlibs-dev + (Closes: #346859) + - Also, removed spurious Build-Depends on libxaw7-dev. + * Acknowledge NMU (Closes: #336867) + * Updated to Standards-Version: 3.6.2.2. + * debian/xscavenger.menuentry: fix unquoted string. + * debian/copyright: update FSF address. + * debian/rules: + - Install menu entry in /usr/share/menu, not /usr/lib/menu. + - Install pixmaps to /usr/share/pixmaps, not /usr/X11R6/.../pixmaps + + -- Hwei Sheng Teoh Wed, 11 Jan 2006 11:10:47 -0800 + +xscavenger (1.4.4-3.1) unstable; urgency=low + + * NMU with maintainer permission. + * Added support for GNU/kFreeBSD. + + -- Aurelien Jarno Tue, 8 Nov 2005 19:43:44 +0100 + +xscavenger (1.4.4-3) unstable; urgency=low + + * Apply file descriptor leak patch (Closes: #175128) + + -- Hwei Sheng Teoh Wed, 3 Sep 2003 12:41:51 -0400 + +xscavenger (1.4.4-2) unstable; urgency=low + + * Fix handling of long int's, which was broken for architectures + where sizeof(long)>4. (This probably also meant that xscavenger + never actually worked on all such architectures...) Thanks to + Steve Langasek for helping me with tracking down and fixing this + bug on alpha. (Closes: #56139) + + -- Hwei Sheng Teoh Sat, 14 Dec 2002 16:58:09 -0500 + +xscavenger (1.4.4-1) unstable; urgency=low + + * New upstream release + * debian/Imakefile.debian: added additional data files shipped with + upstream, which were missing from previous Debian packages. + + -- Hwei Sheng Teoh Mon, 2 Dec 2002 21:27:31 -0500 + +xscavenger (1.4.3-1) unstable; urgency=low + + * New upstream release (Closes: #113123) + * New maintainer, with blessings from previous maintainer. + * debian/control: update Build-Depends (Closes: #170195) + * Fixed soundserver to check for EOF or EPIPE when sound device was not + opened. (Closes: #149228) + * Create a bitmap icon for use when the WM doesn't use the pixmap. + Ideally, scavenger should create an icon window, and then we can reuse + the nice icon that is already being shipped; but that's a bit more work + and X clients *should* have a bitmap fallback anyway. (Closes: #74835) + * Update to Standards-Version: 3.5.8.0 + * debian/postinst: no longer need to create symlink in /usr/doc. + * debian/changelog: remove obsolete add-log-mailing-address. + * debian/rules: added -R options to strip, to remove .note and .comment + sections. + + -- Hwei Sheng Teoh Wed, 27 Nov 2002 07:50:29 -0500 + +xscavenger (1.4.2-1) unstable; urgency=low + + * New upstream version. + * Strip binary. + + -- Marcus Brinkmann Sat, 19 May 2001 02:05:28 +0200 + +xscavenger (1.4.0-2) unstable; urgency=low + + * Avoid brace expansion in debian/rules, closes: Bug#81336 + * Add Build-Depends, closes: Bug#82014 + * This is the new upstream version, closes: Bug#81676 + * Complies to current policy since 1.4.0-1, closes: Bug#74836 + + -- Marcus Brinkmann Fri, 12 Jan 2001 20:18:20 +0100 + +xscavenger (1.4.0-1) unstable; urgency=low + + * New upstream version. + + -- Marcus Brinkmann Thu, 4 Jan 2001 21:56:21 +0100 + +xscavenger (1.3.7-1) unstable; urgency=low + + * New upstream version, new animation. + + -- Marcus Brinkmann Fri, 2 Jul 1999 18:55:53 +0200 + +xscavenger (1.3.6-1) unstable; urgency=low + + * New upstream version, bug fixes only. + + -- Marcus Brinkmann Mon, 5 Oct 1998 01:13:21 +0200 + +xscavenger (1.3.5-1) unstable; urgency=low + + * New upstream version, bug fixes only. + + Soundserv reacts gracefully if /dev/dsp is not accessible. + + -- Marcus Brinkmann Wed, 10 Jun 1998 00:26:27 +0200 + +xscavenger (1.3.4-1) frozen unstable; urgency=low + + * New upstream version, bug fixes only. + + No core dump when sound not available. + + Checks disk capacity before writing level file. + + Don't corrupt level file when writing better score (fixes #22628) + + -- Marcus Brinkmann Sun, 24 May 1998 17:38:27 +0200 + +xscavenger (1.3.2-3) frozen unstable; urgency=low + + * Home Page changed (fixes bug report 20085). + * Added an icon to the menu entry. + + -- Marcus Brinkmann Mon, 23 Mar 1998 04:13:29 +0100 + +xscavenger (1.3.2-2) unstable; urgency=low + + * Changed description (fixes bug report 18994). + + -- Marcus Brinkmann Sun, 25 Feb 1998 10:02:42 +0100 + +xscavenger (1.3.2-1) unstable; urgency=low + + * New upstream version. Fixes bug no-one has detected yet ;) + Now the editor works in all color depths. + + -- Marcus Brinkmann Sun, 25 Feb 1998 10:02:42 +0100 + +xscavenger (1.3.1-3) unstable; urgency=low + + * Fixed name of manpage - scavenger.6 becomes xscavenger.6 + * Fixed copyright file - new adress of FSF. + * Removed du file. + + -- Marcus Brinkmann Sun, 15 Feb 1998 17:03:18 +0100 + +xscavenger (1.3.1-2) unstable; urgency=low + + * Fixed copyright - I have tracked down the origin of the sound server, + and it is free code. + + -- Marcus Brinkmann Sun, 25 Jan 1998 22:36:02 +0100 + +xscavenger (1.3.1-1) unstable; urgency=low + + * New upstream version. + * Maintainer field changed. + * Fixed copyright - there is probably a problem with the sound server. + + -- Marcus Brinkmann Sun, 21 Dec 1997 17:06:02 +0100 + +xscavenger (1.3-1) unstable; urgency=low + + * Initial Release. + + -- Adrian Bridgett Thu, 4 Dec 1997 19:31:21 +0000 + +Local variables: +mode: debian-changelog +End: --- xscavenger-1.4.4.orig/debian/control +++ xscavenger-1.4.4/debian/control @@ -0,0 +1,25 @@ +Source: xscavenger +Section: games +Priority: optional +Maintainer: Hwei Sheng Teoh +Standards-Version: 3.9.4 +Build-Depends: xutils-dev, libx11-dev, libxext-dev + +Package: xscavenger +Section: games +Priority: optional +Architecture: any +Depends: ${shlibs:Depends} +Description: Lode-runner-like platform game for X + XScavenger is a platform game for the X Window System. From the README: + . + Scavenger is like Lode Runner. You've got to run around gathering objects + while avoiding enemies. You can dig down through some of the blocks to get + at buried objects. After you've collected everything, ladders may appear. + To finish the level you've got to exit through the top of the screen. If + an enemy falls into a dug brick, he is stunned for a while. If the brick + fills in with him in it, he is killed, and he will reappear at the top of + the screen. + . + This version has a level editor for designing your own levels, and a + graphics editor for drawing your own artwork. --- xscavenger-1.4.4.orig/debian/copyright +++ xscavenger-1.4.4/debian/copyright @@ -0,0 +1,31 @@ +This is the Debian GNU/Linux prepackaged version of XScavenger. +XScavenger was written by Dave Ashley. + +This package was put together by +Adrian Bridgett , +from sources obtained from: + http://www.xdr.com/dash/linux.html + +The package has then been taken over by +Marcus Brinkmann . + +The source code is covered by the following copyright: + +* XScavenger: Copyright 1997 by Dave Ashley dash@xdr.com + + This program 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; version 2 dated June, 1991. + + This program 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 program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, + USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL-2'. --- xscavenger-1.4.4.orig/debian/rules +++ xscavenger-1.4.4/debian/rules @@ -0,0 +1,141 @@ +#!/usr/bin/make -f +############################ -*- Mode: Makefile -*- ########################### +## rules --- +## Author : Marcus Brinkmann = 2.4), libx11-6, libxext6 --- xscavenger-1.4.4.orig/debian/xscavenger-icon.xpm +++ xscavenger-1.4.4/debian/xscavenger-icon.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char *magick[] = { +/* columns rows colors chars-per-pixel */ +"24 24 4 1", +" c #000000", +"X c #7f7f00", +"o c #ffffff", +"O c None", +/* pixels */ +"OOOOOOOOOOOOOOOOOOOOOOOO", +"OOOOOOOOOOOOO OOOOOOOO", +"OOOOOOOOOOOO XXX OOOOOOO", +"OOOOOOOOOOO Xooo OOOOOOO", +"OOOOOOOOOOO Xoo OOOOOOOO", +"OOOOOOOOOOO ooo OOOOOOOO", +"OOOOOOOOOO XooX OOOOOOOO", +"OOOOOOOOO XoooX OOOOOOOO", +"OOOOOOOOO XoooX OOOOO", +"OOOOOOOOO Xooooooo OOOOO", +"OOOOOOOOO XXooooo OOOOOO", +"OOOOOOOOO XXXX OOOOOOO", +"OOOOOOOOO XXXX OOOOOOOOO", +"OOOOOOOOO XXXXX OOOOOOOO", +"OOOOOOOO XXXX OOOOOOOO", +"OOOOOOO XXXXXXX OOOOOOOO", +"OOOOOO XX XXXXX OOOOOOO", +"OOOOOO X O XXXXX OOOOOOO", +"OOOOOOO O XXX OOOOOOOO", +"OOOOOOOO XXX OOOOOOOOOOO", +"OOOOOOOO XX OOOOOOOOOOOO", +"OOOOOOO XX OOOOOOOOOOOOO", +"OOOOOOO XXX OOOOOOOOOOOO", +"OOOOOOO XXXX OOOOOOOOOOO" +}; --- xscavenger-1.4.4.orig/debian/xscavenger.desktop +++ xscavenger-1.4.4/debian/xscavenger.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Name=XScavenger +Comment=X11 clone of Lode Runner +Exec=/usr/games/xscavenger +Icon=xscavenger-icon +Terminal=false +Type=Application +Categories=Game;ArcadeGame; +StartupNotify=false --- xscavenger-1.4.4.orig/debian/xscavenger.menuentry +++ xscavenger-1.4.4/debian/xscavenger.menuentry @@ -0,0 +1,10 @@ +?package(xscavenger): \ + needs="X11" \ + section="Games/Action" \ + title="XScavenger" \ + icon="/usr/share/pixmaps/xscavenger-icon.xpm" \ + longtitle="The lode runner like platform game XScavenger." \ + description="XScavenger is like Lode Runner. You've got to run around \ + gathering objects while avoiding enemies. You can dig down through some \ + of the blocks to get at buried objects." \ + command="/usr/games/xscavenger" --- xscavenger-1.4.4.orig/debian/xscavenger.postinst +++ xscavenger-1.4.4/debian/xscavenger.postinst @@ -0,0 +1,23 @@ +#! /bin/sh + +set -e + +# We exit unless the package is being configured +case "$1" in + abort*upgrade) exit 0;; + abort*remove) exit 0;; + abort*deconfigure) exit 0;; + configure) + if [ -d /usr/doc -a -h /usr/doc/xscavenger ]; then + # No longer need symlink from /usr/doc to /usr/share/doc/. + rm -f /usr/doc/xscavenger + fi + ;; + *) exit 0; +esac + +if [ -x /usr/bin/update-menus ] ; then + update-menus +fi + +exit 0 --- xscavenger-1.4.4.orig/debian/xscavenger.postrm +++ xscavenger-1.4.4/debian/xscavenger.postrm @@ -0,0 +1,19 @@ +#! /bin/sh + +set -e + +# We exit unless the package is being removed or purged. +case "$1" in + remove) ;; + upgrade) exit 0;; + purge) ;; + failed-upgrade) exit 0;; + abort-install) exit 0;; + abort-upgrade) exit 0;; + disappear) exit 0;; + *) exit 0;; +esac + +if [ -x /usr/bin/update-menus ] ; then + update-menus; +fi --- xscavenger-1.4.4.orig/debian/xscavenger.prerm +++ xscavenger-1.4.4/debian/xscavenger.prerm @@ -0,0 +1,7 @@ +#! /bin/sh + +set -e + +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) -a -L /usr/doc/xscavenger ]; then + rm -f /usr/doc/xscavenger +fi --- xscavenger-1.4.4.orig/src/edit.c +++ xscavenger-1.4.4/src/edit.c @@ -1,6 +1,7 @@ /* SCAVENGER by David Ashley dash@xdr.com */ #include +#include #include #include "scav.h" #include "edit.h" --- xscavenger-1.4.4.orig/src/scav.c +++ xscavenger-1.4.4/src/scav.c @@ -239,16 +239,19 @@ - +/* 14 Dec 2002: re-wrote to be more portable - don't assume two's-complement + * representation for integers, and fix bug when sizeof(long) > 4. + */ long readlong() { -long val1=0; - - val1=myci()<<24L; - val1|=myci()<<16L; - val1|=myci()<<8; - val1|=myci(); + long val1=0; + int i,j; + for (i=0; i<4; i++) { + j = myci(); + if (j==-1) return -1L; + val1 = (val1<<8) + j; + } return val1; } int rbs() @@ -309,7 +312,7 @@ bmw=bmh=byteswide=0; while( (type=readlong()) ) { - if(type==0xffffffffL) break; + if(type==-1L) break; size=readlong(); if(size&1) size++; if(type==BMHD) @@ -402,16 +405,16 @@ input=open(resourcename,O_RDONLY); if(input<0) return -1; got=read(input,buff,8); - if(got!=8) return -2; - if (strncmp(buff,"SCAV",4)) return -3; + if(got!=8) {close(input);return -2;} + if (strncmp(buff,"SCAV",4)) {close(input);return -3;} max=(buff[4]<<24) | (buff[5]<<16) | (buff[6]<<8) | buff[7]; - if(num>=max) return 0; + if(num>=max) {close(input);return 0;} lseek(input,(num+1)<<3,SEEK_SET); got=read(input,buff,8); offset=(buff[0]<<24) | (buff[1]<<16) | (buff[2]<<8) | buff[3]; length=(buff[4]<<24) | (buff[5]<<16) | (buff[6]<<8) | buff[7]; if(len>length) len=length; - if(!offset || !len) return 0; + if(!offset || !len) {close(input);return 0;} lseek(input,offset,SEEK_SET); got=read(input,put,len); close(input); @@ -448,8 +451,8 @@ input=open(resourcename,O_RDONLY); if(input==-1) return -4; got=read(input,buff,8); - if(got!=8) return -2; - if(strncmp(buff,"SCAV",4)) return -3; + if(got!=8) {close(input);return -2;} + if(strncmp(buff,"SCAV",4)) {close(input);return -3;} output=creat(bakname,00600); if(output==-1) {close(input);return -6;} @@ -473,12 +476,12 @@ for(i=0;i1024 ? 1024 : count; - if (read(input,copybuff,got) != got) return -200; - if (write(output,copybuff,got) != got) return -200; + if (read(input,copybuff,got) != got) {close(input);close(output);return -200;} + if (write(output,copybuff,got) != got) {close(input);close(output);return -200;} count-=got; } lseek(input,length,SEEK_CUR); @@ -498,17 +501,17 @@ { got=read(input, copybuff, 1024); if (!got) break; - if (write (output, copybuff, got) != got) return -200; + if (write (output, copybuff, got) != got) {close(input);close(output);return -200;} offset += got; } if(len) { - if (write (output, take, len) != len) return -200; + if (write (output, take, len) != len) {close(input);close(output);return -200;} lseek (output, (num+1) << 3, SEEK_SET); - if (!rlout (output, offset)) return -200; + if (!rlout (output, offset)) {close(input);close(output);return -200;} } close (input); - if (fsync(output)) return -200; + if (fsync(output)) {close(output);return -200;} if (close(output)) return -200; err=rename(bakname,resourcename); if(err) return -1; @@ -1382,6 +1385,7 @@ break; } } + close(file); } void remslash(char *str) @@ -1416,6 +1420,8 @@ return -3; } } while(len); + close(input); + close(output); return 0; } @@ -1448,7 +1454,7 @@ printf("Failed to create directory %s, exiting\n",temp); exit(1); } - } + } else close(file); sprintf(resourcename,"%s/%s/%s",localname,localdirname,LEVELSNAME); file=open(resourcename,O_RDONLY); @@ -1485,7 +1491,7 @@ printf("Couldn't create %s\n",temp); exit(1); } - } + } else close(file); } void makercname(char *str) --- xscavenger-1.4.4.orig/src/sound.c +++ xscavenger-1.4.4/src/sound.c @@ -5,7 +5,12 @@ #include #include #include +#if defined(__linux__) #include +#endif +#if defined(__FreeBSD_kernel__) || defined(__FreeBSD__) +#include +#endif #include #include #include