koules (1.4-18) debian-dir only changes

Summary

 debian/changelog                         |  290 +++++++++++++++++++++++++++++++
 debian/compat                            |    1 
 debian/control                           |   22 ++
 debian/copyright                         |   37 +++
 debian/dirs                              |    3 
 debian/docs                              |    4 
 debian/koules.desktop                    |   19 ++
 debian/koules.menu                       |    6 
 debian/koules.png.uu                     |   19 ++
 debian/koules.postinst                   |   34 +++
 debian/koules.prerm                      |   27 ++
 debian/koules.xpm                        |   50 +++++
 debian/patches/000_build_rules.diff      |   26 ++
 debian/patches/050_defines.diff          |  106 +++++++++++
 debian/patches/100_spelling.diff         |   40 ++++
 debian/patches/101_buffer_overflow.diff  |   15 +
 debian/patches/102_includes.diff         |   48 +++++
 debian/patches/103_asm.diff              |   86 +++++++++
 debian/patches/104_types.diff            |   22 ++
 debian/patches/105_save_file.diff        |   32 +++
 debian/patches/106_shm_check.diff        |  101 ++++++++++
 debian/patches/107_fix_xsynchronize.diff |   32 +++
 debian/patches/108_use_right_visual.diff |  130 +++++++++++++
 debian/patches/109_fpe_fix.diff          |   12 +
 debian/patches/200_tcl.diff              |   27 ++
 debian/patches/300_kfreebsd-gnu.diff     |   22 ++
 debian/patches/series                    |   14 +
 debian/rules                             |   92 +++++++++
 debian/watch                             |    3 
 29 files changed, 1320 insertions(+)

    
download this patch

Patch contents

--- koules-1.4.orig/debian/dirs
+++ koules-1.4/debian/dirs
@@ -0,0 +1,3 @@
+usr/games/
+usr/share/doc/koules/
+usr/share/games/koules/
--- koules-1.4.orig/debian/docs
+++ koules-1.4/debian/docs
@@ -0,0 +1,4 @@
+BUGS
+Koules.FAQ
+README
+TODO
--- koules-1.4.orig/debian/copyright
+++ koules-1.4/debian/copyright
@@ -0,0 +1,37 @@
+This package was debianized by Klee Dienes.
+
+Later it has been maintained by Wichert Akkerman and Aaron Lehmann. Many thanks
+for your work!
+
+The current maintainer is Debian Games Team
+<pkg-games-devel@lists.alioth.debian.org>, package rebuild by Alexander Schmehl
+<tolimar@debian.org> on Fri, 18 Aug 2006 13:02:23 +0200.
+
+It was downloaded from <http://www.paru.cas.cz/~hubicka/koules/English/koules.html>
+
+Upstream Author: JAHUSOFT, Jan Hubicka <hubicka@limax.paru.cas.cz>
+
+Copyright: Copyright (C) 1995,1996 by Jan Hubicka, Kamil Toman, Ludvik Tesar, Thomas A. K. Kjaer,
+	Lutz Vieweg, Thomas Marsh, Rick Sayre, Joe  Rumsey and S. M. Patel
+
+License:
+
+   This package 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
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is Copyright (C) 2006, Alexander Schmehl <tolimar@debian.org> and
+is licensed under the GPL, see above.
--- koules-1.4.orig/debian/koules.desktop
+++ koules-1.4/debian/koules.desktop
@@ -0,0 +1,19 @@
+[Desktop Entry]
+Version=1.0
+Type=Application
+Name=koules
+GenericName=Arcade Game
+GenericName[de]=Arkade-Spiel
+GenericName[ro_RO]=Joc de arcadă
+GenericName[fr]=Un jeu d'arcade
+Comment=Push your enemies away, but stay away from obstacles
+Comment[de]=Dränge deine Gegner weg, aber halte dich von Hindernissen Fern
+Comment[fr]=Eliminez-vos enemies en restant à l'écart des obstacles
+Icon=koules.png
+
+Exec=koules
+Terminal=false
+StartupNotify=false
+
+Categories=Game;ArcadeGame;
+
--- koules-1.4.orig/debian/koules.prerm
+++ koules-1.4/debian/koules.prerm
@@ -0,0 +1,27 @@
+#!/bin/sh
+# prerm script for koules
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+    remove|upgrade|deconfigure)
+    if [ -L /usr/doc/koules ]; then
+        rm -f /usr/doc/koules
+    fi
+
+        ;;
+    failed-upgrade)
+        ;;
+    *)
+        echo "prerm called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+
--- koules-1.4.orig/debian/changelog
+++ koules-1.4/debian/changelog
@@ -0,0 +1,290 @@
+koules (1.4-18) unstable; urgency=low
+
+  [ Ansgar Burchardt ]
+  * Remove deprecated Encoding key from .desktop file
+  * Build-depend on xutils-dev for xmkmf (Closes: #485207)
+
+  [ Alexander Reichle-Schmehl ]
+  * Adopt debian/control to my new name
+
+  [ Barry deFreese ]
+  * Update my e-mail address.
+  * Fix some minor syntax issues in debian/copyright.
+  * Remove deprecated xutils build dependency.
+  * Remove deprecated FilePattern from .desktop file.
+  * Bump Standards Version to 3.8.1. (No changes needed).
+
+ -- Barry deFreese <bdefreese@debian.org>  Tue, 17 Mar 2009 21:14:37 -0400
+
+koules (1.4-17) unstable; urgency=low
+
+  [ Cyril Brulebois ]
+  * Added Vcs-Svn and Vcs-Browser fields in the control file.
+
+  [ Gonéri Le Bouder ]
+  * remove ./xkoules.man during the clean to be able to do two build in a row
+    * (Closes: #424462)
+  * remove the dh-make header in the debian/rules
+
+  [ Barry deFreese ]
+  * Add watch file
+  * Change long description to not include short description.
+  * Add homepage field in control
+  * 107_fix_xsynchronize.diff (Closes: #412056)
+    * Handle ARGB visuals properly
+  * 108_use_right_visual.diff
+    * Handle -y option
+  * Thanks to Peter De Wachter for the patches
+  * 109_fpe_fix.diff (Closes: #269840)
+    * Fixes floating point exceptions
+    * Thanks to Steffen Pingel for the patch
+  * Add myself to uploaders
+
+ -- Barry deFreese <bddebian@comcast.net>  Wed, 05 Dec 2007 13:16:56 -0500
+
+koules (1.4-16) unstable; urgency=low
+
+  [ Gonéri Le Bouder ]
+  * remove Applications from Categorie in the desktop file since it's not
+    an official categorie
+  * add patch by Auriel Jarno to fix the build on kFreeBSD (#413511)
+  * .desktop: french translation
+
+  [ Jon Dowland ]
+  * update menu section to "Games/Action" for menu policy transition.
+    Thanks Linas Žvirblis.
+
+ -- Alexander Schmehl <tolimar@debian.org>  Sun, 29 Jul 2007 20:45:20 +0200
+
+koules (1.4-15) unstable; urgency=high
+
+  * Use quilt for patch management.
+
+  * debian/control:
+    + Uncapitalised short description and add the word "abstract" to it.
+    + Slightly reworded long description.
+    + Build-depend on quilt.
+    + Added myself to the uploaders.
+
+  * debian/patches/000_build_rules.diff:
+    + New patch from old diff: add proper build rules.
+  * debian/patches/050_defines.diff:
+    + New patch from old diff: set compile-time paths and features.
+  * debian/patches/100_spelling.diff:
+    + New patch from old diff: spelling fixes.
+  * debian/patches/101_buffer_overflow.diff:
+    + New patch from old diff: fix a buffer overflow in commandline
+      handling.
+  * debian/patches/102_includes.diff:
+    + New patch from old diff: add missing headers.
+    + Add missing <string.h> to xlib/text.c.
+  * debian/patches/103_asm.diff:
+    + New patch from old diff: fix asm syntax.
+  * debian/patches/104_types.diff:
+    + New patch from old diff: fix types to avoid crashes on 64-bit arches
+      and on powerpc.
+  * debian/patches/105_save_file.diff:
+    + New patch from old diff: do not exit if the save file was not found.
+  * debian/patches/200_tcl.diff:
+    + New patch from old diff: fix paths in the tcl script and add a
+      wrapper to warn about the missing interpreter.
+
+  * debian/patches/106_shm_check.diff:
+    + Fix MIT-SHM detection code for remote displays (Closes: #392983).
+
+ -- Sam Hocevar (Debian packages) <sam+deb@zoy.org>  Fri,  3 Nov 2006 11:25:44 +0100
+
+koules (1.4-14) unstable; urgency=low
+
+  * The "It's not a script!  It's a space station!" release
+  * Move arch dependend sound server binary from /usr/share/games/koules to
+    /usr/lib/... (Closes: #386311)
+    - created some symlinks for the soundfiles
+
+ -- Alexander Schmehl <tolimar@debian.org>  Wed,  6 Sep 2006 21:54:19 +0200
+
+koules (1.4-13) unstable; urgency=low
+
+  * Finnally applying patch from Guus Sliepen to fix segfaults on 64-bit archs
+    (Closes: #331719, 379470)
+    Many thanks!
+
+ -- Alexander Schmehl <tolimar@debian.org>  Fri, 18 Aug 2006 17:12:21 +0200
+
+koules (1.4-12) unstable; urgency=low
+
+  * New Maintainer (Closes: #353391)
+  * Accepting previous NMUs by Amaya (Many thanks!) (Closes: #331719, #346960)
+  * fixing menu Icon (Closes: #36709)
+    - Thanks to David Kimdon for the patch!
+  * fixing typo in game messages (Closes: #224228)
+    - Thanks to Jeff Breidenbach for reporting and submiting a patch!
+  * adding hints to menu file (Closes: #311027)
+  * using debhelper for the package
+    - tweaking standars version to 3.7.2 while doing so ;)
+    - main difference:  Stuff is installed to /usr/share/games/koules not
+      /usr/lib
+  * installing manpage and koules symlink to xkoules manpage (Closes: #195243)
+  * installing desktop file and icon
+
+ -- Alexander Schmehl <tolimar@debian.org>  Fri, 18 Aug 2006 12:48:08 +0200
+
+koules (1.4-11.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Get rid of the /usr/doc link in postinst (Closes: #331719).
+
+ -- Amaya Rodrigo Sastre <amaya@debian.org>  Sun, 16 Jul 2006 22:08:17 +0200
+
+koules (1.4-11.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Remove Build-Dependency on xlibs-dev, now Build-depend on libx11-dev
+    and libxext-dev (Closes: #346960).
+  * Credit and Big Thanks to Nico Golde <nico@ngolde.de> for the patch and
+    testing.
+
+ -- Amaya Rodrigo Sastre <amaya@debian.org>  Wed, 18 Jan 2006 21:42:57 +0100
+
+koules (1.4-11) unstable; urgency=low
+
+  * Fix sndsrv issue on 'unsigned char' platforms (Closes: #181213)
+  * Clean up a symlink in the clean target
+  * Fix multi-line string literals
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Sat, 01 Mar 2003 09:19:08 -0800
+
+koules (1.4-10) unstable; urgency=low
+
+  * Improve long description (Closes: #172535)
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Sat, 11 Jan 2003 22:15:40 -0800
+
+koules (1.4-9) unstable; urgency=low
+
+  * xmkmf broke the build. Thanks Paul Slootman <paul@wurtel.net> for
+    pointing it out and suggesting a workaround. No thanks to xmkmf for
+    continuously breaking. Looking at making a normal makefile for the
+    package.
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Mon, 20 Aug 2001 19:02:30 -0700
+
+koules (1.4-8) unstable; urgency=low
+
+  * Whoops. 1.4-6 added a symlink in a gravely incorrect way. Nobody
+    noticed until 1.4-7 came out. Fixed by using ln -sf
+    (Closes: #105809, #105817, #105855)
+  * Fix implicit declaration of gettimeofday()
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Thu, 19 Jul 2001 07:35:52 -0700
+
+koules (1.4-7) unstable; urgency=low
+
+  * Fix build on PA-RISC, thanks Josip Rodin (Closes: #104851)
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Wed, 18 Jul 2001 05:48:29 -0700
+
+koules (1.4-6) unstable; urgency=low
+
+  * Add 'koules' as a symlink to xkoules. I imagine it's good practice to have an executable with the same name as the package.
+  * Package koules.tcl as 'startkoules'. So, reccomend tcl8.3 and tk8.3 :(.
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Sat, 23 Dec 2000 18:14:18 -0800
+
+koules (1.4-5) unstable; urgency=high
+
+  * Make the package removable!
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Wed, 22 Nov 2000 13:31:10 -0800
+
+koules (1.4-4) unstable; urgency=low
+
+  * Applied patch to make it build with gcc295 from Colin Watson <cjw44@flatline.org.uk>
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Tue, 21 Nov 2000 16:11:40 -0800
+
+koules (1.4-3) unstable; urgency=low
+
+  * Apply security fix to sound code
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Mon, 20 Nov 2000 21:37:07 -0800
+
+koules (1.4-2) unstable; urgency=low
+
+  * New maintainer
+  * Fixed to compile under modern Debian, with the aid of gcc272
+  * Added Build-Depends for X Windows libraries and utilities
+  * Removed OS2 files from the installed documentation
+  * Fixed Lintian errors:
+    * Fixed path to GPL
+    * Moved docs and manpages to /usr/share
+    * Removed GPL from installed documentation
+    * Manage doc symlink in postinst/prerm
+    * Pass -isp option to dpkg-gencontrol to make it include Priority and Section info in binary package
+
+ -- Aaron Lehmann <aaronl@vitelus.com>  Mon, 20 Nov 2000 20:53:40 -0800
+
+koules (1.4-1.2) frozen unstable; urgency=low
+
+  * Non-mainatiner release.
+  * Fixed menu icon path.
+
+ -- Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>  Fri, 13 Mar 1998 14:07:12 +0100
+
+koules (1.4-1.1) unstable; urgency=low
+
+  * Non-mainatiner release.
+  * Changed standard to 2.4.0.0 (because I don't have precognition).
+
+ -- Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>  Fri, 13 Mar 1998 14:07:12 +0100
+
+koules (1.4-1) unstable; urgency=low
+
+  * Non-mainatiner release.
+  * New upstream version, now free because upstream author rewrote parts of
+    non-dfsg-compliant code.
+  * Added icon and menu entry.
+  * Changed standard to 2.4.0.1 (hopefully it is compliant ;)
+
+ -- Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de>  Thu, 12 Mar 1998 15:25:13 +0100
+
+koules (1.3-2.1) unstable; urgency=low
+
+  * Non-maintainer libc6 release.
+  * rcfiles.c: include errno.h
+
+ -- Joey Hess <joeyh@master.debian.org>  Sun, 16 Nov 1997 01:34:21 -0500
+
+koules (1.3-2) contrib; urgency=low
+
+  * Fixed bad version number (fixes #7372).
+  * Added check for ENOENT when reading configuration files (fixes #5883).
+  
+ -- Klee Dienes <klee@debian.org>  Tue, 25 Feb 1997 13:35:53 -0500
+
+koules (1.3-1) contrib; urgency=low
+
+  * Updated to new upstream version (fixes #6865).
+  * Minor packaging changes.
+  
+ -- Klee Dienes <klee@debian.org>  Sat, 8 Feb 1997 13:37:58 -0500
+
+koules (1.2-3) contrib; urgency=low
+
+  * Minor packaging changes.
+  * Updated to use dpkg-shlibdeps.
+
+ -- Klee Dienes <klee@debian.org>  Sat, 2 Nov 1996 22:07:33 -0700
+
+koules (1.2-2) contrib; urgency=low
+
+  * Upgraded to new packaging format.
+  * Upgraded to new upstream version.
+
+ -- Klee Dienes <klee@debian.org>  Wed, 4 Sep 1996 23:16:37 -0700
+
+koules (1.2-1) contrib; urgency=low
+
+  * Initial release.
+
+ -- Klee Dienes <klee@debian.org>  Sat, 8 Jun 1996 13:41:53 -0700
--- koules-1.4.orig/debian/compat
+++ koules-1.4/debian/compat
@@ -0,0 +1 @@
+5
--- koules-1.4.orig/debian/watch
+++ koules-1.4/debian/watch
@@ -0,0 +1,3 @@
+version=3
+
+http://www.ucw.cz/~hubicka/koules/packages/koules([\d.]+)-src\.tar\.gz
--- koules-1.4.orig/debian/koules.png.uu
+++ koules-1.4/debian/koules.png.uu
@@ -0,0 +1,19 @@
+begin 644 koules.png
+MB5!.1PT*&@H````-24A$4@```!L````>"`8```#=&67F````!F)+1T0`_P#_
+M`/^@O:>3````"7!(67,```L3```+$P$`FIP8````!W1)344'U@@2#"(2G\)/
+M2P```D5)1$%42,?=5M&1XR`,?612Q&&7P9;A;!GK,G#*8,N`E('+L+@NN(\$
+M+#!VO',_-\>,)\81/+TG"03\KT.<-8PQ1KZ,:,FSON_%7WNR+$M,8_N._*2Y
+MM38>[7<YQZ1ID=EU7?_Z[1`C(L[+]?0T,>&,GJ-D4[-,#(TQ\81LR)LFT!6P
+M_"]M[KTOP(PQ,49$K0]8MKSD;#C3EJWW/EIK,V`-EF/FO8])^S2>,1%`Y2`1
+MH>OZ(B/3]]OM$\Y9$(T```YX27$"@'GV%="Z":^4-2'Z8DT:(03V/F(8AE@P
+M4^JC6-!B2;04WSF0<Q:WV^=A3ESYA`/.LX=2?1.XMN=`W]\F2[BI,VMM=,XV
+M-YIGGY_D`)^WUG&@$,8<#J54%,:8**4$@+<R\#'//B=$8L3!.%`(`42$"]&8
+M`YH\=<YBGGV><V;.63AGH=3'*>F*@]@8$XE&=)W)'[^^QM.!;S%*"95(I&P6
+MO`Z.`%LR3U-+WF%3`D2$$`*N(8R0TFP"S#V>IL^"R:I$F0RO<VA3GPGT2K1`
+MRF0\;D"[SF":1E9_QUG'$Z)U><9A&'(M26EPO]=F&EK?JU.B5(#;*O7(TG&L
+M#);&X_%HI(%^Q?%W/D6(ED-;8..QN``0(02$$'86\\S[E3/MG>T*NAZJEV<&
+MS>*IL:X,=;5H0G+LC.UN6[#JJU\2Z)84U2WPWI8W5557I'=NUM5+*;N*V;[M
+M:WOQMN'9DZ+*L`-;(6HRHMGRG&XSCWH:(4XVJ2U`L=O2G0'Z44?\CL8_U^O_
+5`6X"3O^B1ECO`````$E%3D2N0F""
+`
+end
--- koules-1.4.orig/debian/rules
+++ koules-1.4/debian/rules
@@ -0,0 +1,92 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	QUILT_PATCHES=debian/patches quilt push -a || test $$? = 2
+	xmkmf
+	make Makefile
+	make Makefiles
+	touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+	# new xmkmf stuff does strange things with the manpage
+	# this is a workaround
+	if [ ! -s xkoules.man ]; then ln -sf xkoules.6 xkoules.man; fi
+	$(MAKE) KOULESDIR=/usr/games SOUNDDIR=/usr/lib/games/koules MANDIR=/usr/share/man/man6
+	/usr/bin/uudecode debian/koules.png.uu -o debian/koules.png
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp xkoules.man
+	[ ! -f Makefile ] || $(MAKE) distclean
+	QUILT_PATCHES=debian/patches quilt pop -a -R || test $$? = 2
+	dh_clean debian/koules.png
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+	$(MAKE) install KOULESDIR=$(CURDIR)/debian/koules/usr/games SOUNDDIR=$(CURDIR)/debian/koules/usr/lib/games/koules MANDIR=$(CURDIR)/debian/koules/usr/share/man/man6
+	dh_install debian/koules.xpm /usr/share/pixmaps/
+	dh_install debian/koules.png /usr/share/pixmaps/
+	dh_install -s debian/koules.desktop /usr/share/applications/
+	dh_link /usr/games/xkoules /usr/games/koules
+	dh_link /usr/share/man/man6/xkoules.6.gz /usr/share/man/man6/koules.6.gz
+	mv debian/koules/usr/lib/games/koules/*.raw debian/koules/usr/share/games/koules/
+	dh_link /usr/share/games/koules/colize.raw /usr/lib/games/koules/colize.raw
+	dh_link /usr/share/games/koules/creator1.raw /usr/lib/games/koules/creator1.raw
+	dh_link /usr/share/games/koules/creator2.raw /usr/lib/games/koules/creator2.raw
+	dh_link /usr/share/games/koules/destroy1.raw /usr/lib/games/koules/destroy1.raw
+	dh_link /usr/share/games/koules/destroy2.raw /usr/lib/games/koules/destroy2.raw
+	dh_link /usr/share/games/koules/end.raw /usr/lib/games/koules/end.raw
+	dh_link /usr/share/games/koules/start.raw /usr/lib/games/koules/start.raw
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_installmenu
+	dh_desktop
+	dh_installexamples
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
--- koules-1.4.orig/debian/control
+++ koules-1.4/debian/control
@@ -0,0 +1,22 @@
+Source: koules
+Section: games
+Priority: optional
+Maintainer: Debian Games Team <pkg-games-devel@lists.alioth.debian.org>
+Uploaders: Alexander Reichle-Schmehl <tolimar@debian.org>, Sam Hocevar (Debian packages) <sam+deb@zoy.org>, Barry deFreese <bdefreese@debian.org>
+Build-Depends: debhelper (>= 5), quilt, xutils-dev, libx11-dev, libxext-dev, sharutils
+Standards-Version: 3.8.1
+Homepage: http://www.ucw.cz/~hubicka/koules/English/koules.html
+Vcs-Svn: svn://svn.debian.org/svn/pkg-games/packages/trunk/koules/
+Vcs-Browser: http://svn.debian.org/wsvn/pkg-games/packages/trunk/koules/?op=log
+
+Package: koules
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: tcl8.3, tk8.3
+Description: abstract space action game
+ Koules is a fast action arcade-style game. This version is compiled for X11.
+ It has cool 256 color graphics, a multiplayer mode for up to 5 players, full
+ sound and, of course, network support. Koules is an original idea. The first
+ version of Koules was developed from scratch by Jan Hubicka in July 1995.
+ .
+ It supports multiplayer deathmatch and cooperative play.
--- koules-1.4.orig/debian/koules.menu
+++ koules-1.4/debian/koules.menu
@@ -0,0 +1,6 @@
+?package(koules):needs="X11" section="Games/Action"\
+  hints="X,2D"\
+  title="koules" command="/usr/games/xkoules"\
+  icon="/usr/share/pixmaps/koules.xpm" \
+  longtitle="Space action game for X11"
+
--- koules-1.4.orig/debian/koules.postinst
+++ koules-1.4/debian/koules.postinst
@@ -0,0 +1,34 @@
+#!/bin/sh
+# postinst script for koules
+#
+# see: dh_installdeb(1)
+
+set -e
+
+case "$1" in
+    configure)
+    if [ -x /usr/bin/update-menus ] ; then
+      update-menus
+    fi
+    if [ -d /usr/doc -a -h /usr/doc/koules -a -d /usr/share/doc/koules ]; then
+      rm -f /usr/doc/koules
+    fi
+    exit 0
+
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
+
--- koules-1.4.orig/debian/koules.xpm
+++ koules-1.4/debian/koules.xpm
@@ -0,0 +1,50 @@
+/* XPM */
+static char * Koules_xpm[] = {
+"27 30 15 1",
+" 	c None",
+".	c #FFFFFF",
+"+	c #FFFF00",
+"@	c #E5E5E5",
+"#	c #B2B2B2",
+"$	c #CCCCCC",
+"%	c #999999",
+"&	c #7F7F00",
+"*	c #666667",
+"=	c #4C4C4C",
+"-	c #333333",
+";	c #191919",
+">	c #000000",
+",	c #00007F",
+"'	c #0000FF",
+"                           ",
+"                           ",
+"          ...+@@@          ",
+"       @..@..@+++@+#       ",
+"      .@..@..@.@+++$+      ",
+"    +@@.@...++@+@++++#%    ",
+"   @+.+@@@.+.+@++$+++%+&   ",
+"   @++++.++.@.@++++$#+%&   ",
+"  $++++@+.+.@@+@+++#+#&&&  ",
+" +$$++@@+@++@+++$++#+%&&*= ",
+" ++$+++@+@@@+++$$+#++%&&*= ",
+" +++++$++++++++++#++%&&&*= ",
+"##+++++$$$+$$$+#+#++&&&*==-",
+"%##+++++++++++$#++%%&&*==-;",
+"&%##+#$#+$+$##+++%&%&&*==-;",
+"%&%%%+++#+++++++%%&&**=--;;",
+"&&&%%%+++##++++&&&&&===--;>",
+"*&&%&&%%&+++%&%&&&**===;;>>",
+"=&*&&&&&%&&&%&&&&*===-;;;>>",
+">=**&>>>>,&&&&**>>>>,-;>>> ",
+">===>>>>>,,*=*=>>>>>,,>>>> ",
+" -->>>>>>,,,==>>>>>>,,,>>  ",
+"  ;,>,>,,,,'--,>,>,,,,'>>  ",
+"  >,,>,>,,,'-;,,>,>,,,'>   ",
+"   ,,,,,,''';>,,,,,,'''>   ",
+"   ,,,,','''>>,,,,',''     ",
+"    '''''''>>>>'''''''     ",
+"     '''''>>>>>>'''''      ",
+"          >>>>>>>          ",
+"                           "};
+
+
--- koules-1.4.orig/debian/patches/108_use_right_visual.diff
+++ koules-1.4/debian/patches/108_use_right_visual.diff
@@ -0,0 +1,130 @@
+Index: koules-1.4/xlib/init.c
+===================================================================
+--- koules-1.4.orig/xlib/init.c	2007-09-03 20:46:52.000000000 +0200
++++ koules-1.4/xlib/init.c	2007-09-03 21:38:49.000000000 +0200
+@@ -95,7 +95,6 @@
+                                   Bool * sharedpixmaps);
+ static int      haderror;
+ static int      (*origerrorhandler) (Display *, XErrorEvent *);
+-static int      bpp;
+ 
+ 
+ static int
+@@ -179,14 +178,14 @@
+   VfTime = 1000000 / 25 * 12;
+   pixmap->ximage = XCreateImage (dp, DefaultVisual (dp, screen),
+ 				 depth, ZPixmap, 0,
+-				 NULL, Width, Height, bpp * 8, 0);
++				 NULL, Width, Height, depth, 0);
+   if (!pixmap->ximage)
+     {
+       fprintf (stderr, "Can't get image\n");
+       return 0;
+     }
+   /*Calculate size of shared memory */
+-  memsize = ((Width + 1) * (Height + 1) * bpp);
++  memsize = ((Width + 1) * (Height + 1) * depth / 8);
+   if ((data = malloc (memsize)) == NULL)
+     {
+       printf ("Can't malloc memory for image\n");
+@@ -340,7 +339,6 @@
+   char           *title1 = "Koules";
+ 
+   Font            f;
+-  XVisualInfo     vinfo_return;
+   XGCValues       values;
+ #ifndef NAS_SOUND
+ #ifndef RSOUND
+@@ -390,54 +388,46 @@
+     XSynchronize (dp, 1);
+   XSetCloseDownMode (dp, DestroyAll);
+   screen = DefaultScreen (dp);
+-  fadeenable = 1;
+-  if (XMatchVisualInfo (dp, DefaultScreen (dp),
+-			8, PseudoColor, &vinfo_return) == False)
+-    {
+-      fadeenable = 0;
+-      printf ("X: Screen doesn't support PseudoColor!\n");
+-      if (XMatchVisualInfo (dp, DefaultScreen (dp),
+-			    32, TrueColor, &vinfo_return) == True)
+-	{
+-	  useprivate = 0;
+-	  bpp = 4;
+-	}
+-      else if (XMatchVisualInfo (dp, DefaultScreen (dp),
+-				 24, TrueColor, &vinfo_return) == True)
+-	{
+-	  useprivate = 0;
+-	  bpp = 4;
+-	}
+-      else if (XMatchVisualInfo (dp, DefaultScreen (dp),
+-				 16, TrueColor, &vinfo_return) == True)
+-	{
+-	  useprivate = 0;
+-	  bpp = 2;
+-	}
+-      else if (XMatchVisualInfo (dp, DefaultScreen (dp),
+-				 15, TrueColor, &vinfo_return) == True)
+-	{
+-	  useprivate = 0;
+-	  bpp = 2;
+-	}
+-      else if (XMatchVisualInfo (dp, DefaultScreen (dp),
+-				 8, GrayScale, &vinfo_return) == True)
+-	{
+-	  useprivate = 0;
+-	  monochrome = 1;
+-	  bpp = 2;
+-	}
+-      else
+-	{
+-	  printf ("Unsupported visual! Using slow and reliable mode\n");
++  {
++    XVisualInfo template;
++    XVisualInfo * vinfo;
++    int nitems_return;
++    template.visualid = XVisualIDFromVisual (DefaultVisual (dp, DefaultScreen (dp)));
++    vinfo = XGetVisualInfo (dp, VisualIDMask, &template, &nitems_return);
++    if (nitems_return == 0)
++      {
++        printf ("X server does not know about the default visual...");
++        exit (0);
++      }
++
++    if (vinfo->class == PseudoColor && vinfo->depth == 8)
++      {
++        fadeenable = 1;
++      }
++    else
++      {
++        fadeenable = 0;
++        printf ("X: Screen doesn't support PseudoColor!\n");
++        if (vinfo->class == TrueColor)
++          {
++            useprivate = 0;
++          }
++        else if (vinfo->class == GrayScale)
++          {
++            useprivate = 0;
++            monochrome = 1;
++          }
++        else
++          {
++            printf ("Unsupported visual! Using slow and reliable mode\n");
+ #ifdef MITSHM
+-	  shm = 0;
++            shm = 0;
+ #endif
+-	}
+-    }
+-  else
+-    bpp = 1;
+-  depth = vinfo_return.depth;
++          }
++      }
++    depth = vinfo->depth;
++    XFree(vinfo);
++  }
+ #ifdef MITSHM
+   /* Make sure all is destroyed if killed off */
+
--- koules-1.4.orig/debian/patches/102_includes.diff
+++ koules-1.4/debian/patches/102_includes.diff
@@ -0,0 +1,48 @@
+Index: koules-1.4/rcfiles.c
+===================================================================
+--- koules-1.4.orig/rcfiles.c	2006-11-03 11:12:56.000000000 +0100
++++ koules-1.4/rcfiles.c	2006-11-03 11:12:58.000000000 +0100
+@@ -20,6 +20,7 @@
+ /* Changes for joystick "accelerate by deflection"         *
+  *  (c) 1997 by Ludvik Tesar (Ludv\'{\i}k Tesa\v{r})       *
+  ************************LT*********************************/
++#include <errno.h>
+ #include "koules.h"
+ #ifdef XSUPPORT
+ static CONST char *name = ".xkoules-controls";
+Index: koules-1.4/xlib/interface.c
+===================================================================
+--- koules-1.4.orig/xlib/interface.c	1998-03-05 18:19:44.000000000 +0100
++++ koules-1.4/xlib/interface.c	2006-11-03 11:12:58.000000000 +0100
+@@ -14,6 +14,7 @@
+ *----------------------------------------------------------*
+ *  interface.c interface xlib graphics functions           *
+ ***********************************************************/
++#include <stdint.h>
+ #include <X11/Xlib.h>
+ #include <X11/keysym.h>
+ #include <X11/keysymdef.h>
+Index: koules-1.4/xlib/init.c
+===================================================================
+--- koules-1.4.orig/xlib/init.c	2006-11-03 11:12:54.000000000 +0100
++++ koules-1.4/xlib/init.c	2006-11-03 11:12:58.000000000 +0100
+@@ -30,6 +30,7 @@
+ #include "../framebuffer.h"
+ 
+ #include <sys/time.h>
++#include <time.h>
+ #include <unistd.h>
+ #include "../mygetopt.h"
+ #include <sys/signal.h>
+Index: koules-1.4/xlib/text.c
+===================================================================
+--- koules-1.4.orig/xlib/text.c	2006-11-03 11:13:03.000000000 +0100
++++ koules-1.4/xlib/text.c	2006-11-03 11:13:17.000000000 +0100
+@@ -4,6 +4,7 @@
+ 
+ #ifdef MITSHM
+ #include <stdlib.h>
++#include <string.h>
+ #include "inlstring.h"		/* include inline string operations */
+ #include "interface.h"
+ 
--- koules-1.4.orig/debian/patches/series
+++ koules-1.4/debian/patches/series
@@ -0,0 +1,14 @@
+000_build_rules.diff
+050_defines.diff
+100_spelling.diff
+101_buffer_overflow.diff
+102_includes.diff
+103_asm.diff
+104_types.diff
+105_save_file.diff
+106_shm_check.diff
+107_fix_xsynchronize.diff
+108_use_right_visual.diff
+200_tcl.diff
+300_kfreebsd-gnu.diff
+109_fpe_fix.diff
--- koules-1.4.orig/debian/patches/103_asm.diff
+++ koules-1.4/debian/patches/103_asm.diff
@@ -0,0 +1,86 @@
+--- koules-1.4.orig/xlib/shmbitmap.c
++++ koules-1.4/xlib/shmbitmap.c
+@@ -248,7 +248,6 @@
+ 	    "idivl %3\n\t"
+ :	    "=a" (result)	/* out */
+ :	    "a" (m1), "d" (m2), "g" (d)		/* in */
+-:	    "ax", "dx"		/* mod */
+     );
+   return result;
+ }
+--- koules-1.4.orig/xlib/inlstring.h
++++ koules-1.4/xlib/inlstring.h
+@@ -238,13 +238,12 @@
+ static INLINE void *
+ __memcpy_aligndest (void *dest, const void *src, int n)
+ {
+-  __asm__         __volatile__ ("
+-				cmpl $3, %%ecx
+-				ja 1f
+-				call * __memcpy_jumptable (, %%ecx, 4)
+-				jmp 2f
+-				1:call __memcpyasm_regargs
+-				"
++  __asm__         __volatile__ (
++				"cmpl $3, %%ecx\n\t"
++				"ja 1f\n\t"
++				"call * __memcpy_jumptable (, %%ecx, 4)\n\t"
++				"jmp 2f\n\t"
++				"1:call __memcpyasm_regargs\n\t"
+ 				:
+ 				:"b"            (dest), "d" (src), "c" (n)
+ 				:"ax", "0", "1", "2");
+@@ -255,14 +254,13 @@
+ static INLINE void *
+ __memcpy_destaligned (void *dest, const void *src, int n)
+ {
+-  __asm__         __volatile__ ("
+-				cmpl $32, %%ecx
+-				ja 1f
+-				call * __memcpy_jumptable (, %%ecx, 4)
+-				jmp 2f
+-				1:call __memcpyasm_regargs_aligned
+-				2:
+-				"
++  __asm__         __volatile__ (
++				"cmpl $32, %%ecx\n\t"
++				"ja 1f\n\t"
++				"call * __memcpy_jumptable (, %%ecx, 4)\n\t"
++				"jmp 2f\n\t"
++				"1:call __memcpyasm_regargs_aligned\n\t"
++				"2:\n\t"
+ 				:
+ 				:"b"            (dest), "d" (src), "c" (n)
+ 				:"ax", "0", "1", "2");
+@@ -273,14 +271,13 @@
+ static INLINE void *
+ __memcpy_balanced (void *dest, const void *src, int n)
+ {
+-  __asm__         __volatile__ ("
+-				cmpl $19, %%ecx
+-				ja 1f
+-				call * __memcpy_jumptable (, %%ecx, 4)
+-				jmp 2f
+-				1:call __memcpyasm_regargs
+-				2:
+-				"
++  __asm__         __volatile__ (
++				"cmpl $19, %%ecx\n\t"
++				"ja 1f\n\t"
++				"call * __memcpy_jumptable (, %%ecx, 4)\n\t"
++				"jmp 2f\n\t"
++				"1:call __memcpyasm_regargs\n\t"
++				"2:\n\t"
+ 				:
+ 	     :"b"            ((long) dest), "d" ((long) src), "c" ((long) n)
+ 				:"ax", "bx", "cx", "dx");
+--- koules-1.4.orig/font.c
++++ koules-1.4/font.c
+@@ -58,7 +58,6 @@
+ 	    "idivl %3\n\t"
+ :	    "=a" (result)	/* out */
+ :	    "a" (m1), "d" (m2), "g" (d)		/* in */
+-:	    "ax", "dx"		/* mod */
+     );
+   return result;
+ }
--- koules-1.4.orig/debian/patches/105_save_file.diff
+++ koules-1.4/debian/patches/105_save_file.diff
@@ -0,0 +1,32 @@
+--- koules-1.4.orig/rcfiles.c
++++ koules-1.4/rcfiles.c
+@@ -126,9 +127,11 @@
+ #endif
+   if ((controls = fopen (fullname, "r")) == NULL)
+     {
+-      printf ("could not open save file:%s\n"
+-	      "using default values\n", fullname);
+-      perror ("error");
++      if (errno != ENOENT) {
++        perror ("error");
++        printf ("could not open save file:%s\n"
++	        "using default values\n", fullname);
++      }
+       goto skip;
+     }
+   fread (keys, 1, sizeof (keys), controls);	/*save user defined keys */
+@@ -157,9 +160,11 @@
+ #endif
+   if ((levels = fopen (fullname, "r")) == NULL)
+     {
+-      printf ("could not open save file:%s\n"
+-	      "using default values\n", fullname);
+-      perror ("error");
++      if (errno != ENOENT) {
++        printf ("could not open save file:%s\n"
++   	        "using default values\n", fullname);
++        perror ("error");
++      }
+       return;
+     }
+ 
--- koules-1.4.orig/debian/patches/107_fix_xsynchronize.diff
+++ koules-1.4/debian/patches/107_fix_xsynchronize.diff
@@ -0,0 +1,32 @@
+Index: koules-1.4/xlib/init.c
+===================================================================
+--- koules-1.4.orig/xlib/init.c	2007-09-03 20:29:10.000000000 +0200
++++ koules-1.4/xlib/init.c	2007-09-03 20:29:29.000000000 +0200
+@@ -386,6 +386,8 @@
+       printf ("could not open display\n");
+       exit (0);
+     }
++  if (Sync)
++    XSynchronize (dp, 1);
+   XSetCloseDownMode (dp, DestroyAll);
+   screen = DefaultScreen (dp);
+   fadeenable = 1;
+@@ -578,8 +580,6 @@
+     }
+ #endif
+ 
+-  if (Sync)
+-    XSynchronize (dp, 1);
+ #if defined(NAS_SOUND)||defined(RSOUND)
+   printf ("Initializing sound server...\n");
+   if (sndinit)
+@@ -666,7 +666,7 @@
+ 	  "\n\n\n\n"
+ 	  "                     Copyright(c) Jan Hubicka 1995, 1996\n\n\n");
+   useprivate = 0;
+-  while ((c = mygetopt (argc, argv, "KWD:P:L:C:SxslEMmpdhfb")) != -1)
++  while ((c = mygetopt (argc, argv, "KWD:P:L:C:SxyslEMmpdhfb")) != -1)
+     {
+       switch (c)
+ 	{
+
--- koules-1.4.orig/debian/patches/000_build_rules.diff
+++ koules-1.4/debian/patches/000_build_rules.diff
@@ -0,0 +1,26 @@
+--- koules-1.4.orig/Makefile.svgalib
++++ koules-1.4/Makefile.svgalib
+@@ -116,6 +116,6 @@
+ 
+ .depend:
+ 	echo '# Program dependencies' >.depend
+-	gcc -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(PROGS_O)) >>.depend
++	$(CC) -I svgalib $(DEFINES) -MM $(patsubst %.o,%.c,$(PROGS_O)) >>.depend
+ 
+ include .depend
+--- koules-1.4.orig/Imakefile
++++ koules-1.4/Imakefile
+@@ -73,7 +73,12 @@
+ 
+ LOCAL_LIBRARIES = util/libutils.a xlib/libxlib.a $(NASLIB) $(XLIB) $(EXTRALIB)  -lm 
+ DEPLIBS= util/libutils.a xlib/libxlib.a $(DEPXLIB)
+- 
++
++util/libutils.a::
++	cd util && make libutils.a
++
++xlib/libxlib.a::
++	cd xlib && make libxlib.a
+ 
+ MakeSubdirs($(SUBDIRS))
+ DependSubdirs($(SUBDIRS))
--- koules-1.4.orig/debian/patches/104_types.diff
+++ koules-1.4/debian/patches/104_types.diff
@@ -0,0 +1,22 @@
+--- koules-1.4.orig/xlib/interface.c
++++ koules-1.4/xlib/interface.c
+@@ -154,7 +155,7 @@
+ 	  {
+ 	    register unsigned char *data = (unsigned char *) source.vbuff,
+ 	                   *end = (unsigned char *) source.vbuff + MAPWIDTH * (MAPHEIGHT + 20);
+-	    register unsigned long *out = (unsigned long *) source.ximage->data;
++	    register uint32_t *out = (uint32_t *) source.ximage->data;
+ 	    while (data < end)
+ 	      {
+ 		*out = rpixels[*data];
+--- koules-1.4.orig/koules.sndsrv.linux.c
++++ koules-1.4/koules.sndsrv.linux.c
+@@ -181,7 +180,7 @@
+ void
+ do_everything (int dsp, int is_pcsp)
+ {
+-  char            k;
++  signed char     k;
+   int             i, j;
+   int             terminate = -1;	/* Which Sound to Terminate                              */
+   int             playing[16];	/* Sound numbers that we are playing                     */
--- koules-1.4.orig/debian/patches/300_kfreebsd-gnu.diff
+++ koules-1.4/debian/patches/300_kfreebsd-gnu.diff
@@ -0,0 +1,22 @@
+--- koules-1.4.orig/koules.sndsrv.freebsd.c
++++ koules-1.4/koules.sndsrv.freebsd.c
+@@ -14,7 +14,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/ioctl.h>
+-#include <machine/soundcard.h>
++#include <sys/soundcard.h>
+ #include <sys/time.h>
+ #include <signal.h>
+ #include <string.h>
+--- koules-1.4.orig/Iconfig
++++ koules-1.4/Iconfig
+@@ -92,7 +92,7 @@
+ #endif
+ #endif
+ 
+-#if defined(FreeBSDArchitecture)
++#if defined(FreeBSDArchitecture) || defined(KFreeBSDArchitecture)
+ SYSDEFS = 
+ #if !defined(NAS_SOUND)&&!defined(RSOUND)
+ #define SOUND
--- koules-1.4.orig/debian/patches/100_spelling.diff
+++ koules-1.4/debian/patches/100_spelling.diff
@@ -0,0 +1,40 @@
+--- koules-1.4.orig/rcfiles.c
++++ koules-1.4/rcfiles.c
+@@ -66,7 +67,7 @@
+   if ((controls = fopen (fullname, "w")) == NULL)
+     {
+       printf ("could not open save file:%s\n"
+-	      "saving of controls skippen\n", fullname);
++	      "saving of controls skipped\n", fullname);
+       perror ("error");
+       return;
+     }
+@@ -96,7 +97,7 @@
+   if ((levels = fopen (fullname, "w")) == NULL)
+     {
+       printf ("could not open save file:%s\n"
+-	      "saving of controls skippen\n", fullname);
++	      "saving of controls skipped\n", fullname);
+       perror ("error");
+       return;
+     }
+--- koules-1.4.orig/text.h
++++ koules-1.4/text.h
+@@ -270,7 +270,7 @@
+ {
+   "The DARK APPLEPOLISHER",
+   "has heard about you",
+-  "Your are famous",
++  "You are famous",
+   "This has one disadvantage",
+   "B_BALLS are going to",
+   "kick you out",
+@@ -290,7 +290,7 @@
+   "...",
+   "do not",
+   "turn the power off",
+-  "your are near",
++  "you are near",
+   "your goal",
+   "NOW you can finish the game"};
+ static int      BBBALLSIZE = (sizeof (bbballtext) / sizeof (char *));
--- koules-1.4.orig/debian/patches/200_tcl.diff
+++ koules-1.4/debian/patches/200_tcl.diff
@@ -0,0 +1,27 @@
+--- koules-1.4.orig/koules.tcl
++++ koules-1.4/koules.tcl
+@@ -3,9 +3,9 @@
+ # This is simple user (anti)friendly dialog for starting koules
+ # Only reason why I did it is that I wanted to try tcl/tk
+ #files - configure here if paths are differ
+-set xkoules "/usr/bin/X11/xkoules"
+-set koulessvga "/usr/local/bin/koules.svga"
+-set koulessound "/usr/local/lib/koules/creator1.raw"
++set xkoules "/usr/games/xkoules"
++set koulessvga "/usr/games/koules.svga"
++set koulessound "/usr/lib/games/koules/creator1.raw"
+ set config "~/.xkoules.opt"
+ set revision 1.1
+ # Set default
+--- koules-1.4.orig/startkoules
++++ koules-1.4/startkoules
+@@ -0,0 +1,9 @@
++#!/bin/sh
++if [ ! -f /usr/bin/wish ]; then
++	echo "Sorry, this script requires the tcl8.3 and tk8.3 packages to be installed."
++	echo "They are not a dependency of the koules package in case you don't want to use"
++	echo "this script. Please install those packages and execute this script again."
++	exit 1
++fi
++
++exec /usr/bin/wish /usr/lib/games/koules/koules.tcl
--- koules-1.4.orig/debian/patches/106_shm_check.diff
+++ koules-1.4/debian/patches/106_shm_check.diff
@@ -0,0 +1,101 @@
+Index: koules-1.4/xlib/init.c
+===================================================================
+--- koules-1.4.orig/xlib/init.c	2006-11-03 11:43:49.000000000 +0100
++++ koules-1.4/xlib/init.c	2006-11-03 11:56:04.000000000 +0100
+@@ -91,6 +91,8 @@
+ 
+ #ifdef MITSHM
+ extern int      XShmQueryExtension (Display * dpy);
++extern Bool     XShmQueryVersion (Display* dpy, int * major, int * minor,
++                                  Bool * sharedpixmaps);
+ static int      haderror;
+ static int      (*origerrorhandler) (Display *, XErrorEvent *);
+ static int      bpp;
+@@ -107,6 +109,15 @@
+   return (0);
+ }
+ 
++static int
++badmatcherrorhandler (Display * d, XErrorEvent * e)
++{
++  haderror++;
++  if (e->error_code != BadMatch)
++    (*origerrorhandler) (d, e);
++  return (0);
++}
++
+ #define Width MAPWIDTH
+ #define Height (MAPHEIGHT+20)
+ XShmSegmentInfo shminfo;
+@@ -186,16 +197,27 @@
+   fflush (stdout);
+   testpixmap = XCreatePixmap (dp, wi, MAPWIDTH, MAPHEIGHT + 20, DefaultDepth (dp, screen));
+   XSync (dp, 0);
++  haderror = False;
++  origerrorhandler = XSetErrorHandler (badmatcherrorhandler);
+   for (i = 0; i < 10 && wait > 0; i++)
+     {
+-      XPutImage (dp, testpixmap, gc, pixmap->ximage, 0, 0, 0, 0, MAPWIDTH, MAPHEIGHT + 20);
++      if (!XPutImage (dp, testpixmap, gc, pixmap->ximage, 0, 0, 0, 0,
++                      MAPWIDTH, MAPHEIGHT + 20))
++        break;
+       XSync (dp, 0);
+       gettimeofday (&VnewClk, NULL);
+       if (VnewClk.tv_usec < VendSleep)
+ 	VendSleep -= 1000000;
+       wait = (VfTime - VnewClk.tv_usec + VendSleep);
+     }
++  XSync (dp, False);
++  XSetErrorHandler (origerrorhandler);
+   XFreePixmap (dp, testpixmap);
++  if (haderror)
++    {
++      printf (" XPutImage failed (remote server?)\n");
++      return 0;
++    }
+   if (i == 10)
+     {
+       printf ("OK\n");
+@@ -258,6 +280,7 @@
+   pixmap->ximage->data = (char *) shared_mem;
+ 
+   /* Now try to attach it to the X Server */
++  XSync (dp, False);
+   haderror = False;
+   origerrorhandler = XSetErrorHandler (shmerrorhandler);
+   if (!XShmAttach (dp, &shminfo))
+@@ -416,22 +439,25 @@
+ #ifdef MITSHM
+   /* Make sure all is destroyed if killed off */
+ 
+-  /* Make sure we can do PsuedoColor colormap stuff */
++  /* Make sure we can do PseudoColor colormap stuff */
+   if (!shm)
+     {
+       printf ("Shm support disabled\n");
+     }
+   else
+-    /* Check to see if the extensions are supported */
+-  if (!XShmQueryExtension (dp))
+     {
+-      fprintf (stderr, "X server doesn't support MITSHM extension.\n");
+-      shm = 0;
++      /* Check to see if the extensions are supported */
++      int major, minor;
++      Bool pixmaps;
++      if (XShmQueryVersion (dp, &major, &minor, &pixmaps) != 0
++           && (major > 1 || (major == 1 && minor >= 1)))
++          printf ("Shm mode seems to be possible\n");
++      else
++        {
++          fprintf (stderr, "X server doesn't support MITSHM extension.\n");
++          shm = 0;
++        }
+     }
+-  if (shm)
+-    printf ("Shm mode seems to be possible\n");
+-
+-
+ #endif
+   wi = physicalscreen.pixmap = XCreateSimpleWindow (dp, RootWindow (dp, screen), 50, 50, MAPWIDTH, MAPHEIGHT + 20,
+ 						    0, 0, 0);
--- koules-1.4.orig/debian/patches/109_fpe_fix.diff
+++ koules-1.4/debian/patches/109_fpe_fix.diff
@@ -0,0 +1,12 @@
+--- koules-1.4.orig/xlib/shmbitmap.c	2007-10-26 21:16:50.000000000 -0400
++++ koules-1.4/xlib/shmbitmap.c	2007-10-26 21:18:21.000000000 -0400
+@@ -187,6 +187,9 @@
+ void
+ ShmPutBitmap (int x, int y, int w, int h, void *_dp)
+ {
++  if (x < 0 || y < 0)
++    return;
++
+ /* no clipping */
+   uchar          *dp = _dp;
+   uchar          *vp, *vpline;
--- koules-1.4.orig/debian/patches/101_buffer_overflow.diff
+++ koules-1.4/debian/patches/101_buffer_overflow.diff
@@ -0,0 +1,15 @@
+--- koules-1.4.orig/koules.sndsrv.linux.c
++++ koules-1.4/koules.sndsrv.linux.c
+@@ -65,10 +65,9 @@
+   for (i = 0; i < NUM_SOUNDS; i++)
+     {
+       s[0] = 0;
+-      strcat (s, argv[1]);
+-      if (s[(int) strlen (s) - 1] == '/')
++      if (argv[1][(int) strlen (argv[1]) - 1] == '/')
+ 	FILENAME[i]++;
+-      strcat (s, FILENAME[i]);
++      snprintf(s, sizeof(s), "%s%s", argv[1], FILENAME[i]);
+       FILENAME[i] = malloc ((int) strlen (s) + 1);
+       strcpy (FILENAME[i], s);
+       sound_buffer[i] = NULL;
--- koules-1.4.orig/debian/patches/050_defines.diff
+++ koules-1.4/debian/patches/050_defines.diff
@@ -0,0 +1,106 @@
+--- koules-1.4.orig/xlib/init.c
++++ koules-1.4/xlib/init.c
+@@ -769,6 +770,32 @@
+ #endif
+ 	  break;
+ 	default:
++#ifdef NETSUPPORT
++#define USAGE_NETSUPPORT " -S run koules as network server\n \
++-C<host> run koules as network client\n \
++-P<port> select port. Default is:%i\n \
++-W run server in width mode-support for 320x200 svgalib and OS/2 clients\n \
++-L<level> select level for server\n \
++-D<number> select dificulty for server:\n \
++    0: nightmare\n \
++    1: hard\n \
++    2: medium(default and recomended)\n \
++    3: easy\n \
++    4: very easy\n \
++-K run server in deathmatch mode\n "
++#else
++#define USAGE_NETSUPPORT ""
++#endif
++#ifdef SOUND
++#define USAGE_SOUND " -d Disable sound support\n"
++#else
++#define USAGE_SOUND ""
++#endif
++#ifdef MITSHM
++#define USAGE_MITSHM " -M DISABLE shared memory support\n"
++#else
++#define USAGE_MITSHM ""
++#endif
+ 	  printf ("USAGE:"
+ 		  " -h for help\n"
+ 		  " -b for blackandwhite displays\n"
+@@ -778,27 +805,10 @@
+ 		  " -p use private colormap\n"
+ 		  " -y Synchronize with X(for debugging)\n"
+ 		  " -f nofade(for debugging)\n"
+-#ifdef SOUND
+-		  " -d Disable sound support\n"
+-#endif
++		  USAGE_SOUND
+ 		  " -x Disable X11 pointer\n"
+-#ifdef MITSHM
+-		  " -M DISABLE shared memory support\n"
+-#endif
+-#ifdef NETSUPPORT
+-		  " -S run koules as network server\n"
+-		  " -C<host> run koules as network client\n"
+-		  " -P<port> select port. Default is:%i\n"
+-		  " -W run server in width mode-support for 320x200 svgalib and OS/2 clients\n"
+-		  " -L<level> select level for server\n"
+-		  " -D<number> select dificulty for server:\n"
+-		  "     0: nightmare\n"
+-		  "     1: hard\n"
+-		  "     2: medium(default and recomended)\n"
+-		  "     3: easy\n"
+-		  "     4: very easy\n"
+-		  " -K run server in deathmatch mode\n", DEFAULTINITPORT
+-#endif
++		  USAGE_MITSHM
++		  USAGE_NETSUPPORT, DEFAULTINITPORT
+ 	    );
+ 	  exit (2);
+ 	}
+--- koules-1.4.orig/Iconfig
++++ koules-1.4/Iconfig
+@@ -18,7 +18,7 @@
+    use my emulation
+    If you are unsure try to leave it commented out. My emulation
+    works on most unixes*/
+-/*#define HAVEUSLEEP*/
++#define HAVEUSLEEP
+ /* for network audio server(supported by most unixes)*/
+ /* It does not sound as well as built in driver ... koules uses too 
+    much sounds*/
+@@ -29,14 +29,14 @@
+ /* linux joystick support
+    Now compiles w/o joystick toolkit. For using joystick support is
+    joystick toolikit required...of course */
+-/*#define JOYSTICK*/
++#define JOYSTICK
+ /*for fast 386 based assembler routines
+   recomended for linux*/
+-/*#define I386ASSEMBLY*/
++#define I386ASSEMBLY
+ /* directories*/
+-KOULESDIR		=/usr/bin/X11
+-SOUNDDIR		=/usr/local/lib/koules
+-MANDIR			=/usr/local/man/man6
++KOULESDIR		=/usr/games
++SOUNDDIR		=/usr/games/lib/koules
++MANDIR			=/usr/man/man6
+ 
+ /*You need some extra libraryes for BSD sockets compatibility?*/
+ /* TOP_INCLUDES =                       /* Sun users with GCC need this */
+@@ -61,7 +61,7 @@
+ #endif
+ 
+ 
+-#if defined(HPArchitecture)
++#if defined(HPArchitecture) && !defined(LinuxArchitecture)
+     SYSDEFS = +O3 -Ae 
+ #if !defined(NAS_SOUND)&&!defined(RSOUND)
+ #define SOUND