--- xroach-1.5.orig/xroach.c
+++ xroach-1.5/xroach.c
@@ -48,6 +48,7 @@
 typedef int ErrorHandler();
 
 #define SCAMPER_EVENT	(LASTEvent + 1)
+#define RoundTripDelay  20000
 
 #if !defined(GRAB_SERVER)
 #define GRAB_SERVER	0
@@ -267,6 +268,7 @@
 		}
 		DrawRoaches();
 		XSync(display, False);
+		usleep(RoundTripDelay);
 		break;
 		
 	    case UnmapNotify:
@@ -340,10 +342,10 @@
     unsigned int numChildren;
     int cx;
     Atom actualType;
-    Atom actualFormat;
+    int actualFormat;
     unsigned long nItems;
     unsigned long bytesAfter;
-    Window *newRoot;
+    unsigned char *newRoot;
     
     /*
        Get real root window.
@@ -372,7 +374,7 @@
 	    XA_WINDOW, &actualType, &actualFormat, &nItems,
 	    &bytesAfter, &newRoot) == Success && actualFormat != None) {
 		if (nItems >= 1) {
-		    rootWin = *newRoot;
+		    rootWin = *(Window*)newRoot;
 		}
 		if (newRoot) {
 		    XFree(newRoot);
@@ -505,7 +507,7 @@
 
 	if (roach->steps-- <= 0) {
 	    TurnRoach(roach);
-	    roach->steps = RandInt(200);
+	    roach->steps = RandInt((int)(1000.0/roachSpeed));
 	}
 
 	for (ii=rx+1; ii<curRoaches; ii++) {
--- xroach-1.5.orig/Imakefile
+++ xroach-1.5/Imakefile
@@ -3,4 +3,8 @@
 SRCS = xroach.c
 OBJS = xroach.o
 
+XCOMM Modification to install under $PREFIX
+BINDIR=$(PREFIX)/usr/X11R6/bin
+MANDIR=$(PREFIX)/usr/X11R6/man/man1
+
 ComplexProgramTarget(xroach)
--- xroach-1.5.orig/debian/menu
+++ xroach-1.5/debian/menu
@@ -0,0 +1,5 @@
+?package(xroach):needs=x11 section=Games/Toys title="Xroach - start" \
+	command=xroach
+?package(xroach):needs=x11 section=Games/Toys title="Xroach - stop" \
+	command="killall -KILL xroach"
+
--- xroach-1.5.orig/debian/copyright
+++ xroach-1.5/debian/copyright
@@ -0,0 +1,29 @@
+This is a Debian prepackaged version of the xroach program.
+
+This package was put together by Joey Hess <joeyh@master.debian.org>, using
+sources from:
+	ftp://ftp.x.org/contrib/games
+
+The following copyright applies to this package:
+
+/*
+    Xroach - A game of skill.  Try to find the roaches under your windows.
+    
+    Copyright 1991 by J.T. Anderson
+
+    jta@locus.com
+    
+    This program may be freely distributed provided that all
+    copyright notices are retained.
+
+    To build:
+      cc -o xroach roach.c -lX11 [-lsocketorwhatever] [-lm] [-l...]
+
+    Dedicated to Greg McFarlane.   (gregm@otc.otca.oz.au)
+    
+    Squish option contributed by Rick Petkiewizc (rick@locus.com)
+    
+    Virtual root code adapted from patch sent by Colin Rafferty who
+    borrowed it from Tom LaStrange.  Several other folks sent similar
+    fixes.
+*/
--- xroach-1.5.orig/debian/control
+++ xroach-1.5/debian/control
@@ -0,0 +1,12 @@
+Source: xroach
+Section: games
+Priority: optional
+Maintainer: Joey Hess <joeyh@master.debian.org>
+Standards-Version: 2.4.0.0
+
+Package: xroach
+Architecture: any
+Depends: ${shlibs:Depends}
+Description: displays disgusting cockroaches on your root window
+ Xroach infests X with roaches. They hide under windows and scurry around.
+ Click on them with the mouse to kill them.
--- xroach-1.5.orig/debian/changelog
+++ xroach-1.5/debian/changelog
@@ -0,0 +1,69 @@
+xroach (1.5-8.2) unstable; urgency=low
+
+  * Install in /usr/bin instead /usr/X11R6/bin, to avoid dpkg error messages
+    in combination with Xorg-7.1
+
+ -- Roman Hodek <roman@hodek.net>  Mon,  1 Jan 2007 15:38:48 +0100
+
+xroach (1.5-8.1) unstable; urgency=low
+
+  * Add a usleep() after moving roaches, otherwise they're too fast to see
+    on fast machines.
+  * Max. numbers of steps now depends on roachSpeed, otherwise roaches start
+    to run in circles with small speeds.
+  
+ -- Roman Hodek <roman@hodek.net>  Sun, 27 Feb 2005 17:36:27 +0100
+
+xroach (1.5-8) unstable; urgency=low
+
+  * Fixed minor lintian errors.
+
+ -- Joey Hess <joeyh@master.debian.org>  Sat, 14 Mar 1998 20:33:56 -0800
+
+xroach (1.5-7) unstable; urgency=low
+
+  * Updated standards-version.
+  * Rebuilt with debhelper 0.60 to fix file permissions problem.
+
+ -- Joey Hess <joeyh@master.debian.org>  Mon,  9 Feb 1998 14:15:12 -0800
+
+xroach (1.5-6) unstable; urgency=low
+
+  * Use debhelper.
+
+ -- Joey Hess <joeyh@master.debian.org>  Sat,  7 Feb 1998 20:40:54 -0800
+
+xroach (1.5-5) unstable; urgency=low
+
+  * libc6.
+  * New format menu file.
+  * Routine update of debian/rules:
+    Fixed binary-indep target.
+
+ -- Joey Hess <joeyh@master.debian.org>  Mon,  8 Sep 1997 19:18:44 -0400
+
+xroach (1.5-4) unstable; urgency=low
+
+  * Added a menu-file.
+  * Routine update of debian/rules:
+    Use debmake.
+    New email address.
+
+ -- Joey Hess <joeyh@master.debian.org>  Mon, 16 Dec 1996 23:01:53 -0500
+
+xroach (1.5-3) unstable; urgency=low
+
+  * Moved manpage into proper location.
+  * New source format.
+
+ -- Joey Hess <joeyh@master.debian.org>  Mon, 16 Sep 1996 20:43:57 -0400
+
+1.5-2  31 Aug 96 02:06 UT
+* Small change to /usr/doc/copyright/xroach
+
+1.5-1  Fri Aug 30 22:04:08 EDT 1996
+* Initial release
+
+Local variables:
+mode: debian-changelog
+End:
--- xroach-1.5.orig/debian/rules
+++ xroach-1.5/debian/rules
@@ -0,0 +1,60 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+build: build-stamp
+build-stamp:
+	dh_testdir
+	xmkmf -a
+	$(MAKE)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+	-$(MAKE) -i clean
+	dh_clean Makefile
+
+# Build architecture-independent files here.
+binary-indep: build
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build
+#	dh_testversion
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	$(MAKE) PREFIX=debian/tmp install
+	$(MAKE) PREFIX=debian/tmp install.man
+	install -d -m755 debian/tmp/usr/bin
+	mv debian/tmp/usr/X11R6/bin/* debian/tmp/usr/bin/
+	rmdir debian/tmp/usr/X11R6/bin
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+#	dh_installinit
+	dh_installcron
+	dh_installmanpages
+#	dh_undocumented
+	dh_installchangelogs
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_suidregister
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+#	dh_makeshlibs
+	dh_md5sums
+	dh_builddeb
+
+source diff:                                                                  
+	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary
