--- wmfishtime-1.24.orig/debian/control
+++ wmfishtime-1.24/debian/control
@@ -1,20 +1,23 @@
 Source: wmfishtime
 Section: x11
 Priority: optional
-Maintainer: Marcel May <marcel.may@web.de>
-Build-Depends: debhelper (>> 3.0.0)
-Standards-Version: 3.5.2
+Maintainer: Sandro Tosi <matrixhasu@gmail.com>
+Uploaders: tony mancill <tmancill@debian.org>
+Build-Depends: debhelper (>= 5), libgdk-pixbuf-dev, libx11-dev, libgtk2.0-dev, dpatch, pkg-config, libxext-dev
+Standards-Version: 3.7.3
+Homepage: http://www.ne.jp/asahi/linux/timecop/
 
 Package: wmfishtime
 Architecture: any
 Depends: ${shlibs:Depends}
-Description: Dockable clock app for WMaker, BlackBox, E, SawFish etc. .
+Description: Dockable clock app for WMaker, BlackBox, E, SawFish etc
  Welcome to WMFishTime, winner of the "Best Waste Of CPU Power" award!
  This is a dockable clock application for WMaker, BlackBox, E, SawFish etc. .
  .
- The features include gradient backdrop, anti-aliased hour, minute, second hands
- alpha-blended bubbles, real-time sprite engine, precision accuracy,
- and shows if you have unread mail (in the form of swaying weed blocking the day/month numbers).
+ The features include gradient backdrop, anti-aliased hour, minute, second
+ hands alpha-blended bubbles, real-time sprite engine, precision accuracy,
+ and shows if you have unread mail (in the form of swaying weed blocking
+ the day/month numbers).
  .
  Well, this is just your standard time dockapp. Top part has the clock face,
  bottom part has day of the week, followed by day, followed by month. Yellow
--- wmfishtime-1.24.orig/debian/rules
+++ wmfishtime-1.24/debian/rules
@@ -1,49 +1,36 @@
 #!/usr/bin/make -f
-# Sample debian/rules that uses debhelper.
-# GNU copyright 1997 to 1999 by Joey Hess.
 
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
 
-# This is the debhelper compatability version to use.
-export DH_COMPAT=3
+include /usr/share/dpatch/dpatch.make
 
-configure: configure-stamp
-configure-stamp:
-	dh_testdir
-	# Add here commands to configure the package.
-	
-
-	touch configure-stamp
-
-build: configure-stamp build-stamp
+build: patch build-stamp
 build-stamp:
 	dh_testdir
 
 	# Add here commands to compile the package.
 	$(MAKE)
-	#/usr/bin/docbook-to-man debian/wmfishtime.sgml > wmfishtime.1
 
 	touch build-stamp
 
-clean:
+clean: unpatch
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp configure-stamp
+	rm -f build-stamp debian/dirs
 
 	# Add here commands to clean up after the build process.
-	-$(MAKE) clean
+	[ ! -f Makefile ] || $(MAKE) clean
 
 	dh_clean
 
 install: build
 	dh_testdir
 	dh_testroot
-	dh_clean -k
-	dh_installdirs
+	dh_installdirs usr/bin
 
 	# Add here commands to install the package into debian/wmfishtime.
-	$(MAKE) install DESTDIR=$(CURDIR)/debian/wmfishtime
+	$(MAKE) install PREFIX=$(CURDIR)/debian/wmfishtime/usr
 
 
 # Build architecture-independent files here.
@@ -54,31 +41,19 @@
 binary-arch: build install
 	dh_testdir
 	dh_testroot
-#	dh_installdebconf	
-	dh_installdocs
-#dh_installexamples
-#	dh_installmenu
-#	dh_installlogrotate
-#	dh_installemacsen
-#	dh_installpam
-#	dh_installmime
-#	dh_installinit
-#dh_installcron
-	dh_installman
-#dh_installinfo
-#	dh_undocumented
+	dh_installdocs		README ALL_I_GET_IS_A_GRAY_BOX AUTHORS CODING
+	dh_installmenu
 	dh_installchangelogs 
+	dh_installman		wmfishtime.1
 	dh_link
 	dh_strip
 	dh_compress
 	dh_fixperms
-#	dh_makeshlibs
 	dh_installdeb
-#	dh_perl
 	dh_shlibdeps
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
+.PHONY: build clean binary-indep binary-arch binary install
--- wmfishtime-1.24.orig/debian/changelog
+++ wmfishtime-1.24/debian/changelog
@@ -1,9 +1,108 @@
-wmfishtime (1.23-1) unstable; urgency=low
+wmfishtime (1:1.24-8) unstable; urgency=low
 
-  * Initial Release.
+  * debian/control
+    - bump Standard-Version to 3.7.3
+    - moved Homepage field from binary to source stanza
+    - added build-depend against libxext-dev since libx11-dev will no longer
+      depends on it
+    - removed cdbs dependency
+  * debian/dirs
+    - removed since not needed
+  * debian/wmfishtime.dirs
+    - removed since not needed
+  * debian/menu
+    - added
+  * debian/rules
+    - migrated from cdbs to debhelper style
+    - removing debian/dirs from upstream, since it generates errors
+  * debian/patches/01_gtk2.dpatch
+    - updated to avoid upstream code modification
+    - removed header commented line
+  * debian/patches/10_fix_makefile.dpatch
+    - added to change upstream makefile
+  * debian/docs
+    - removed since integrated into debian/rules
+  * debian/wmfishtime.docs
+    - removed since integrated into debian/rules
+  * debian/wmfishtime.manpages
+    - removed since integrated into debian/rules
+  * debian/patches/20_bts-389575_digital_clock.dpatch
+    - added to implement a digital clock (Closes: #389575)
+  * debian/patches/30_fix_manpage.dpatch
+    - added to avoid direct code modification
+  * debian/copyright
+    - clear separation of copyright and license
+    - upsteam authors, copyright and license indented with 4 spaces
 
- -- Marcel May <marcel.may@web.de>  Thu, 19 Apr 2001 21:00:13 +0200
+ -- Sandro Tosi <matrixhasu@gmail.com>  Mon, 31 Dec 2007 10:37:02 +0100
+
+wmfishtime (1:1.24-7) unstable; urgency=low
+
+  * Set DEB_MAKE_INVOKE=make in debian/rules, otherwise cdbs calls
+    make in a way that overwrites CFLAGS. (closes: #439765)
+  * restore CDBS makefile.mk include
+
+ -- tony mancill <tmancill@debian.org>  Mon, 27 Aug 2007 07:57:20 -0700
+
+wmfishtime (1:1.24-6) unstable; urgency=low
+
+  * add GTK2 patch provided by Julien BLACHE
+  * add dpatch and gtk2.0-dev to build-depends; remove gtk1.2-dev
+  * remove CDBS makefile.mk include because it overrides CFLAGS
+  * add tony mancill to Uploaders in debian/control
+
+ -- tony mancill <tmancill@debian.org>  Tue, 14 Aug 2007 22:17:39 -0700
+
+wmfishtime (1:1.24-5) unstable; urgency=low
+
+  * debian/control
+    - new maintainer (Closes: #324587)
+    - bump to Standard-version 3.7.2
+    - dependency on debhelper >= 5
+    - add Homepage
+  * debian/compat
+    - bump to 5
+  * debian/watch
+    - changed to version 3 of uscan
+  * debian/copyright
+    - correctly set Copyright:
+    - add full copyright notes
+    - add myself as maintainer of the package
+
+ -- Sandro Tosi <matrixhasu@gmail.com>  Sun, 27 Aug 2006 23:34:07 +0200
+
+wmfishtime (1:1.24-4) unstable; urgency=low
+
+  * Orphaning the package (see #324587)
+  * Standards version 3.6.2 (no changes required)
+  * Replace old xlibs-dev build-dep with libx11-dev
+  * Remove unneeded orig source line from wmfishtime.1
+
+ -- Bastian Kleineidam <calvin@debian.org>  Mon, 29 Aug 2005 11:38:53 +0200
+
+wmfishtime (1:1.24-3) unstable; urgency=low
+
+  * use -O2, not -O3
+
+ -- Bastian Kleineidam <calvin@debian.org>  Tue, 24 Aug 2004 23:14:35 +0200
+
+wmfishtime (1:1.24-2) unstable; urgency=low
+
+  * added a debian/watch file
+  * use cdbs to build the package
+
+ -- Bastian Kleineidam <calvin@debian.org>  Wed, 28 Jul 2004 16:25:44 +0200
+
+wmfishtime (1:1.24-1) unstable; urgency=low
+
+  * New upstream release. (Closes: #261422)
+  * Standards version 3.6.1
+
+ -- Bastian Kleineidam <calvin@debian.org>  Mon, 26 Jul 2004 23:42:31 +0200
+
+wmfishtime (1:1.23-1) unstable; urgency=low
+
+  * Initial Release (Closes: #186511)
+
+ -- Bastian Kleineidam <calvin@debian.org>  Thu, 27 Mar 2003 20:05:45 +0100
 
-Local variables:
-mode: debian-changelog
-End:
--- wmfishtime-1.24.orig/debian/copyright
+++ wmfishtime-1.24/debian/copyright
@@ -1,14 +1,39 @@
 This package was debianized by Marcel May <marcel.may@web.de> on
 Thu, 19 Apr 2001 21:00:13 +0200.
 
-It was downloaded from http://www.ne.jp/asahi/linux/timecop/software/wmfishtime-1.2.tar.gz
+Now it is maintained by Sandro Tosi <matrixhasu@gmail.com>
 
-Upstream Author(s): timecop <timecop@japan.co.jp>, martijn pieterse <pieterse@xs4all.nl>,
- antoine nulle <warp@xs4all.nl>, Marcel May <marcel.may@web.de>, tarzeau <tarzeau@space.ch>,
- Jason Thomas <jason@debian.org>
+It was downloaded from http://www.ne.jp/asahi/linux/timecop/ .
+
+Upstream Authors:
+    timecop <timecop@japan.co.jp>
+    martijn pieterse <pieterse@xs4all.nl>
+    antoine nulle <warp@xs4all.nl>
+    Marcel May <marcel.may@web.de>
+    tarzeau <tarzeau@space.ch>
+    Jason Thomas <jason@debian.org>
 
 Copyright:
- You are free to distribute this software under the terms of
- the GNU General Public License (GPL V2).
- On Debian systems, the complete text of the GNU General Public 
- License can be found in /usr/share/common-licenses/GPL file.
+
+    2001 timecop <timecop@japan.co.jp>
+
+License:
+
+  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; either version 2 of the License, or
+  (at your option) any later version.
+ 
+  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 did not receive a copy of the GNU General Public License along with
+  this program; chances are, you already have at least 10 copies of this
+  license somewhere on your system.  If you still want it, 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-2 file.
--- wmfishtime-1.24.orig/debian/patches/01_gtk2.dpatch
+++ wmfishtime-1.24/debian/patches/01_gtk2.dpatch
@@ -0,0 +1,54 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_gtk2.dpatch by  <jblache@debian.org>
+##
+## DP: Patch build to use GTK2.0; bts 437429
+
+diff -ru wmfishtime~/Makefile wmfishtime/Makefile
+--- wmfishtime~/Makefile	2007-08-12 15:49:11.000000000 +0200
++++ wmfishtime/Makefile	2007-08-12 15:51:26.670078369 +0200
+@@ -6,7 +6,7 @@
+ 
+ # no user serviceable parts below this line
+ # optimization cflags
+-CFLAGS = -O3 -Wall `gtk-config --cflags` ${EXTRA}
++CFLAGS = -O2 -Wall `pkg-config gtk+-2.0 --cflags` ${EXTRA}
+ # profiling cflags
+ # CFLAGS=-ansi -pedantic -Wall -pg -O3 `gtk-config --cflags` ${EXTRA} -DPRO
+ # test coverage cflags
+@@ -16,7 +16,7 @@
+ CC = gcc
+ SHELL = sh
+ OBJS = fishmon.o
+-LIBS = `gtk-config --libs | sed "s/-lgtk//g"`
++LIBS = `pkg-config gtk+-2.0 --libs`
+ INSTALL = -m 755
+ 
+ all: wmfishtime
+diff -ru wmfishtime~/fishmon.c wmfishtime/fishmon.c
+--- wmfishtime~/fishmon.c	2004-05-13 01:55:59.000000000 +0200
++++ wmfishtime/fishmon.c	2007-08-12 15:53:18.676461250 +0200
+@@ -648,6 +648,7 @@
+ 
+     /* make a copy for the iconwin - parameters are the same */
+     memcpy(&attri, &attr, sizeof(GdkWindowAttr));
++    attri.window_type = GDK_WINDOW_CHILD;
+ 
+     sizehints.flags = USSize;
+     sizehints.width = 64;
+@@ -679,7 +680,6 @@
+     wmhints.window_group = win;
+     wmhints.flags =
+ 	StateHint | IconWindowHint | IconPositionHint | WindowGroupHint;
+-    XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
+ 
+     bm.gc = gdk_gc_new(bm.win);
+ 
+@@ -693,6 +693,8 @@
+ 
+     gdk_window_show(bm.win);
+ 
++    XSetWMHints(GDK_WINDOW_XDISPLAY(bm.win), win, &wmhints);
++
+ #undef MASK
+ }				/* make_new_fishmon_dockapp */
+ 
--- wmfishtime-1.24.orig/debian/patches/00list
+++ wmfishtime-1.24/debian/patches/00list
@@ -0,0 +1,4 @@
+01_gtk2
+10_fix_makefile
+20_bts-389575_digital_clock
+30_fix_manpage
--- wmfishtime-1.24.orig/debian/patches/20_bts-389575_digital_clock.dpatch
+++ wmfishtime-1.24/debian/patches/20_bts-389575_digital_clock.dpatch
@@ -0,0 +1,96 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20_bts-389575_digital_clock.dpatch by René van Bevern <rvb@debian.org>
+##
+## DP: Implement an optional digital clock display
+
+@DPATCH@
+
+diff -ruN wmfishtime-1.24/fishmon.c wmfishtime-1.24+digital_clock/fishmon.c
+--- wmfishtime-1.24/fishmon.c	2004-05-13 01:55:59.000000000 +0200
++++ wmfishtime-1.24+digital_clock/fishmon.c	2006-09-26 16:10:06.000000000 +0200
+@@ -81,6 +81,8 @@
+ static int enable_check_mail = 0;	/* no mail check for default !!!  */
+ static int new_mail = 0;		/* no new mail for default !!!    */
+ static int broken_wm = 0;		/* need broken windowmanager fix? */
++static int clock_analog = 1;            /* display analog clock           */
++static int clock_digital = 0;           /* display digital clock          */
+ 
+ /* 34 sprites:
+  * 0, 2, 4, 6, 8, 10, 12, 14 - fish left
+@@ -277,6 +279,7 @@
+     struct tm *data;
+     time_t cur_time;
+     static time_t old_time;
++    static char buffer[9];
+ 
+     int hr, min, sec;
+     static int osec = -1;
+@@ -296,6 +299,10 @@
+ 	min = data->tm_min;
+ 	sec = data->tm_sec;
+ 
++	/* build digital clock */
++	sprintf(buffer, "%02d %02d %02d", data->tm_hour,
++		data->tm_min, data->tm_sec);
++
+ 	/* hours */
+ 	if ((sec % 15) == 0) {
+ 	    psi = hr * (M_PI / 6.0);
+@@ -339,10 +346,14 @@
+     }
+ 
+     /* must redraw each frame */
+-    anti_line(28, 24, hdx, hdy, 1, 0xbf0000);
+-    anti_line(28, 24, mdx, mdy, 1, 0x00aa00);
+-    anti_line(28, 24, sdx, sdy, 1, 0xc79f2b);
++    if(clock_analog) {
++      anti_line(28, 24, hdx, hdy, 1, 0xbf0000);
++      anti_line(28, 24, mdx, mdy, 1, 0x00aa00);
++      anti_line(28, 24, sdx, sdy, 1, 0xc79f2b);
++    }
+ 
++    if(clock_digital)
++      draw_string(4, 2, buffer);
+ }
+ 
+ static void weed_update(void)
+@@ -543,7 +554,8 @@
+     }
+ 
+     /* now draw the clock face */
+-    for (i = 0; i < 60; i += 5) {
++    if(clock_analog) {
++      for (i = 0; i < 60; i += 5) {
+ 	psi = i * (M_PI / 30.0);
+ 	dx = floor(sin(psi) * 25 * 0.9) + 29;
+ 	dy = floor(-cos(psi) * 22 * 0.9) + 24;
+@@ -559,6 +571,7 @@
+ 	    idx = 28;
+ 	}
+ 	draw_sprite_alpha(dx, dy, idx, 20);
++      }
+     }
+ 
+     curr_time = time(NULL);
+@@ -1028,6 +1041,10 @@
+ 	{ "check-mail", no_argument, &enable_check_mail, 1 },
+ 	{ "b",		no_argument, &broken_wm, 1 },
+ 	{ "broken",	no_argument, &broken_wm, 1 },
++	{ "a",          no_argument, &clock_analog, 0},
++	{ "no-analog",  no_argument, &clock_analog, 0},
++	{ "d",          no_argument, &clock_digital, 1},
++	{ "digital",    no_argument, &clock_digital, 1},
+ 	{ 0, 0, 0, 0 }
+     };
+ 
+@@ -1051,7 +1068,9 @@
+ 	   " -h\t--help\t\tshow this message and exit\n"
+ 	   " -v\t--version\tshow version and exit\n"
+ 	   " -c\t--check-mail\tenables check for new mail\n"
+-	   " -b\t--broken\tactivates broken window manager fix\n\n"
++	   " -b\t--broken\tactivates broken window manager fix\n"
++	   " -a\t--no-analog\tdisables display of analog clock\n"
++	   " -d\t--digital\tenables display of digital clock\n\n"
+ 	   "Yet Another Waste of CPU Cycles! Dock app clock with\n"
+ 	   "shy fish, bubbles and mail check functionality (disabled by default).\n"
+ 	   "Try out the man page wmfishtime (1x).\n");
--- wmfishtime-1.24.orig/debian/patches/30_fix_manpage.dpatch
+++ wmfishtime-1.24/debian/patches/30_fix_manpage.dpatch
@@ -0,0 +1,59 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_restore_pristine_code.dpatch by Sandro Tosi <matrixhasu@gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: New patch generated from wmfishtime 1.24-8 diff.gz
+
+@DPATCH@
+
+--- wmfishtime-1.24.orig/wmfishtime.1
++++ wmfishtime-1.24/wmfishtime.1
+@@ -2,7 +2,7 @@
+ .\" First parameter, NAME, should be all caps
+ .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+ .\" other parameters are allowed: see man(7), man(1)
+-.TH WMFISHTIME SECTION "April 19, 2001"
++.TH WMFISHTIME 1 "April 19, 2001"
+ .\" Please adjust this date whenever revising the manpage.
+ .\"
+ .\" Some roff macros, for reference:
+@@ -16,7 +16,8 @@
+ .\" .sp <n>    insert n+1 empty lines
+ .\" for manpage-specific macros, see man(7)
+ .SH NAME
+-wmfishtime \- dockable clock app for WMaker, BlackBox, E, SawFish etc. window manager
++wmfishtime \- dockable clock app for WMaker, BlackBox, E, SawFish etc.
++window manager
+ .SH SYNOPSIS
+ .B wmfishtime
+ .\" .RI [ options ] " none" ...
+@@ -33,8 +34,8 @@
+ .\" TeX users may be more comfortable with the \fB<whatever>\fP and
+ .\" \fI<whatever>\fP escape sequences to invode bold face and italics, 
+ .\" respectively.
+-\fBwmfishtime\fP is a dockable clock application for WMaker, BlackBox, E, SawFish etc.
+-window manager.
++\fBwmfishtime\fP is a dockable clock application for WMaker, BlackBox,
++E, SawFish etc. window manager.
+ 
+ The features include gradient backdrop, anti-aliased hour|minute|second hands,
+ alpha-blended bubbles, a real-time sprite engine, precision accuracy
+@@ -68,8 +69,6 @@
+ .SH SEE ALSO
+ http://www.ne.jp/asahi/linux/timecop/
+ 
+-http://www.ne.jp/asahi/linux/timecop/software/wmfishtime-1.23.tar.gz (original source)
+-
+ http://freshmeat.net/projects/wmfishtime/
+ 
+ .BR wmaker (1)
+@@ -79,7 +78,8 @@
+ 
+ wmfishmon was written by timecop <timecop@japan.co.jp> with contribution from
+ martijn pieterse <pieterse@xs4all.nl>,  antoine nulle <warp@xs4all.nl>,
+-Marcel May <marcel.may@web.de>, tarzeau <tarzeau@space.ch> and Jason Thomas <jason@debian.org>
++Marcel May <marcel.may@web.de>, tarzeau <tarzeau@space.ch> and
++Jason Thomas <jason@debian.org>
+ 
+ 
+ This manual page was written by Marcel May <marcel.may@web.de>,
--- wmfishtime-1.24.orig/debian/patches/10_fix_makefile.dpatch
+++ wmfishtime-1.24/debian/patches/10_fix_makefile.dpatch
@@ -0,0 +1,15 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10_fix_makefile.dpatch by Sandro Tosi <matrixhasu@gmail.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad wmfishtime~/Makefile wmfishtime/Makefile
+--- wmfishtime~/Makefile	2007-12-29 18:48:04.860181806 +0100
++++ wmfishtime/Makefile	2007-12-29 18:48:22.057161805 +0100
+@@ -30,4 +30,3 @@
+ # You're going to have to be root to do this!
+ install:
+ 	install $(INSTALL) wmfishtime $(PREFIX)/bin
+-	install $(INSTALL) wmfishtime.1 $(PREFIX)/man/man1
--- wmfishtime-1.24.orig/debian/compat
+++ wmfishtime-1.24/debian/compat
@@ -0,0 +1 @@
+5
--- wmfishtime-1.24.orig/debian/watch
+++ wmfishtime-1.24/debian/watch
@@ -0,0 +1,3 @@
+# watch control file for uscan
+version=3
+http://www.ne.jp/asahi/linux/timecop/  software/wmfishtime-([\d.]*).tar.gz
--- wmfishtime-1.24.orig/debian/menu
+++ wmfishtime-1.24/debian/menu
@@ -0,0 +1,3 @@
+?package(wmfishtime):needs="x11" \
+   section="Applications/System/Administration" hints="Clocks" title="WmFishTime" \
+   command="/usr/bin/wmfishtime"
