--- python-kinterbasdb-3.2.0.orig/_kinterbasdb.c
+++ python-kinterbasdb-3.2.0/_kinterbasdb.c
@@ -77,6 +77,9 @@
 static PyObject *ProgrammingError          = NULL;
 static PyObject *NotSupportedError         = NULL;
 
+#ifndef LONG_LONG
+# define LONG_LONG PY_LONG_LONG
+#endif
 
 /* 2005.11.04: */
 static int global_concurrency_level = UNKNOWN_CONCURRENCY_LEVEL;
--- python-kinterbasdb-3.2.0.orig/_kievents.h
+++ python-kinterbasdb-3.2.0/_kievents.h
@@ -30,11 +30,7 @@
 #include "_kisupport.h"
 #include "_kisupport_threadsafe_fifo_queue.h"
 
-#ifdef FIREBIRD_2_0_OR_LATER
-  #define EVENT_CALLBACK_FUNCTION ISC_EVENT_CALLBACK
-#else
-  #define EVENT_CALLBACK_FUNCTION isc_callback
-#endif
+#define EVENT_CALLBACK_FUNCTION isc_callback
 
 #define DV_VOID(void_ptr) DEVOLATILE(void *, void_ptr)
 #define DV_STR(char_ptr) DEVOLATILE(char *, char_ptr)
--- python-kinterbasdb-3.2.0.orig/debian/control
+++ python-kinterbasdb-3.2.0/debian/control
@@ -0,0 +1,18 @@
+Source: python-kinterbasdb
+Section: python
+Priority: optional
+Maintainer: Ed Boraas <ed@debian.org>
+Build-Depends: debhelper (>= 5.0.37.2), firebird2.0-dev, python-all-dev (>= 2.3.5-11), python-egenix-mx-base-dev, python-support (>= 0.3)
+Standards-Version: 3.7.2
+
+Package: python-kinterbasdb
+Architecture: any
+Depends: ${python:Depends}, ${shlibs:Depends}
+Provides: ${python:Provides}
+Replaces: python2.3-kinterbasdb (<< 3.1.2-0.1), python2.4-kinterbasdb (<< 3.1.2-0.1)
+Conflicts: python2.3-kinterbasdb (<< 3.1.2-0.1), python2.4-kinterbasdb (<< 3.1.2-0.1)
+XB-Python-Version: ${python:Versions}
+Description: InterBase/Firebird support for Python 
+ This package allows access to InterBase and/or Firebird databases from
+ Python via the standard Python Database API version 2.0.
+
--- python-kinterbasdb-3.2.0.orig/debian/rules
+++ python-kinterbasdb-3.2.0/debian/rules
@@ -0,0 +1,105 @@
+#!/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 compatibility version to use.
+export DH_COMPAT=5
+export DH_PYCOMPAT=2
+
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+	INSTALL_PROGRAM += -s
+endif
+
+PYVERS=$(shell pyversions -r)
+
+build: build-stamp
+build-stamp: 
+	dh_testdir
+
+	set-e; \
+	for py in $(PYVERS); do $$py setup.py build; done
+
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+
+	-for py in $(PYVERS); do $$py setup.py clean; done
+	rm -rf build/*
+	dh_clean -A
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	set -e; \
+	for py in $(PYVERS); do \
+	    $$py setup.py install --root=debian/python-kinterbasdb; \
+	done
+	-find debian -name '*.py[co]' | xargs rm -f
+
+	: # these are wrongly installed by the script above:
+	rm -rf debian/python-kinterbasdb/usr/lib/python*/site-packages/kinterbasdb/docs
+
+docs_to_install = \
+	docs/*.html docs/*.css
+
+# Build architecture-independent files here.
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs -i $(docs_to_install)
+	dh_installmenu -i
+	dh_installcron -i
+	dh_installman -i
+	dh_installinfo -i
+	dh_installchangelogs -i docs/changelog.txt
+	dh_link -i
+	dh_compress -i
+	dh_fixperms -i
+	dh_pysupport -i
+	dh_python -i
+	dh_installdeb -i
+	dh_gencontrol -i
+	dh_md5sums -i
+	dh_builddeb -i
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installdocs -a -A $(docs_to_install)
+	dh_installexamples -a -A
+	dh_installmenu -a
+	dh_installcron -a
+	dh_installman -a
+	dh_installinfo -a
+	dh_installchangelogs -a -A docs/changelog.txt
+	dh_link -a
+	dh_strip -a
+	dh_compress -a
+	dh_fixperms -a
+	dh_pysupport -a
+	dh_python -a
+	dh_installdeb -a
+	# Any form of libfirebird2 should work -- manually override this
+	# in control
+	dh_shlibdeps -a
+	dh_gencontrol -a
+	dh_md5sums -a
+	dh_builddeb -a
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
+
--- python-kinterbasdb-3.2.0.orig/debian/changelog
+++ python-kinterbasdb-3.2.0/debian/changelog
@@ -0,0 +1,104 @@
+python-kinterbasdb (3.2.0-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- root <root@jam-spinfoserver.jamesons>  Sat, 25 Aug 2007 11:22:57 +1000
+
+python-kinterbasdb (3.1.2-0.4) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Build-Depend on firebird2.0-dev (Closes: #427184)
+  * Drop usage of private firebird define from _kievents.h
+
+ -- Damyan Ivanov <dmn@debian.org>  Mon, 09 Jul 2007 23:32:59 +0300
+
+python-kinterbasdb (3.1.2-0.3) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * ${shlibs:Depends} was forgotten ...
+
+ -- Pierre Habouzit <madcoder@debian.org>  Thu, 29 Jun 2006 11:50:53 +0200
+
+python-kinterbasdb (3.1.2-0.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Update package to the new Python policy (closes: #373323).
+
+ -- Pierre Habouzit <madcoder@debian.org>  Thu, 29 Jun 2006 10:36:08 +0200
+
+python-kinterbasdb (3.1.2-0.1) unstable; urgency=low
+
+  * Non-maintainer upload with approval by maintainer
+  * New upstream release
+  * Updated to Policy 3.6.2.1
+  * Drop support for python 2.1 and 2.2 (closes: #332389)
+  * Add support for 2.4 (closes: #301404)
+
+ -- Jan Luebbe <jluebbe@lasnet.de>  Thu, 13 Oct 2005 14:09:13 +0200
+
+python-kinterbasdb (3.1-1) unstable; urgency=low
+
+  * New upstream release 
+
+ -- Ed Boraas <ed@debian.org>  Sun,  6 Mar 2005 11:48:52 -0700
+
+python-kinterbasdb (3.0.1-6) unstable; urgency=high
+
+  * Fix inaccurate (binary) dependencies resulting from
+    the changes in 3.0.1-5
+
+ -- Ed Boraas <ed@debian.org>  Thu,  9 Sep 2004 07:22:57 -0600
+
+python-kinterbasdb (3.0.1-5) unstable; urgency=high
+
+  * Update build-depends so that this package is
+    buildable in sarge (Closes: #269658)
+  * Urgency high as this is a simple change which
+    is necessary to close an RC bug in sarge
+
+ -- Ed Boraas <ed@debian.org>  Mon,  6 Sep 2004 19:52:41 -0600
+
+python-kinterbasdb (3.0.1-4) unstable; urgency=low
+
+  * Updated to Policy 3.6.1
+  * Acknowledge NMUs (Closes: #213134, #259129)
+
+ -- Ed Boraas <ed@debian.org>  Sat,  7 Aug 2004 23:51:06 -0600
+
+python-kinterbasdb (3.0.1-3.2) unstable; urgency=low
+
+  * NMU
+  * Add a Build-Depends on python (closes: #259129)
+
+ -- Pierre Machard <pmachard@debian.org>  Sun, 18 Jul 2004 12:01:18 +0200
+
+python-kinterbasdb (3.0.1-3.1) unstable; urgency=low
+
+  * Add support for python2.3.
+  * Make the package buildable on non-i386 machines.
+  * Remove the postinst/prerm scripts, use dh_python instead.
+  * Change the package section to `python'.
+  * _kinterbasdb.c: Define LONG_LONG in terms of PY_LONG_LONG.
+  * Make dependency package architecture all.
+  * Make package lintian clean.
+
+ -- Matthias Klose <doko@debian.org>  Sun, 28 Sep 2003 15:52:16 +0200
+
+python-kinterbasdb (3.0.1-3) unstable; urgency=low
+
+  * Build separate packages for both python 2.1 and 2.2
+
+ -- Ed Boraas <ed@debian.org>  Sat, 24 Aug 2002 21:44:12 -0600
+
+python-kinterbasdb (3.0.1-2) unstable; urgency=low
+
+  * Clean up postinst/prerm scripts
+
+ -- Ed Boraas <ed@debian.org>  Sat, 24 Aug 2002 15:43:13 -0600
+
+python-kinterbasdb (3.0.1-1) unstable; urgency=low
+
+  * Initial Release (Closes: #158071)
+
+ -- Ed Boraas <ed@debian.org>  Sat, 24 Aug 2002 15:38:52 -0600
+
--- python-kinterbasdb-3.2.0.orig/debian/copyright
+++ python-kinterbasdb-3.2.0/debian/copyright
@@ -0,0 +1,52 @@
+This package was debianized by Ed Boraas <kronos@boraas.ca> on
+Sat, 24 Aug 2002 15:38:52 -0600.
+
+It was downloaded from http://kinterbasdb.sf.net 
+
+Upstream Authors: 	Alexander Kuznetsov 	<alexan@users.sourceforge.net>
+			Marek Isalski		<kinterbasdb@maz.nu>
+			David Rushby         	<woodsplitter@rocketmail.com>
+			et al.
+
+Copyright (taken from upstream docs/license.txt):
+
+KInterbasDB Python Database Module - LICENSE
+
+The following contributors hold Copyright (C) over their respective
+portions of code and documentation:
+
+[Author of original version; maintained through version 2.0:]
+  1998-2001 [alex]  Alexander Kuznetsov   <alexan@users.sourceforge.net>
+
+[Author of ~90% of current code and 100% of current documentation:]
+  2002-2004 [dsr]   David Rushby          <woodsplitter@rocketmail.com>
+
+[Significant Contributors:]
+  2001-2002 [maz]   Marek Isalski         <kinterbasdb@maz.nu>
+    Marek made important first steps in removing the limitations of
+    version 2.0 in preparation for version 3.0.
+
+  2001      [eac]   Evgeny A. Cherkashin  <eugeneai@icc.ru>
+    Evgeny wrote the first version of the distutils build script,
+    which was included in a 2.x point release.
+
+  2001-2002 [janez] Janez Jere            <janez.jere@void.si>
+    Janez contributed several bugfixes, including fixes for the date
+    and time parameter conversion code in preparation for version 3.0.
+
+
+Permission to use, copy, modify, and distribute this software and
+its documentation for any purpose and without fee or royalty
+is hereby granted, provided that the above copyright notice appears
+in all copies and that both the copyright notice and this
+permission notice appear in supporting documentation or portions
+thereof, including modifications, that you make.
+
+The authors disclaim all warranties with regard to this software,
+including all implied warranties of merchantability and fitness.
+In no event shall any author be liable for any special, indirect
+or consequential damages or any damages whatsoever resulting
+from loss of use, data or profits, whether in an action of
+contract, negligence or other tortious action, arising out of or
+in connection with the use or performance of this software.
+
--- python-kinterbasdb-3.2.0.orig/__ki_platform_config.h
+++ python-kinterbasdb-3.2.0/__ki_platform_config.h
@@ -0,0 +1,9 @@
+#define SIZEOF_POINTER 4
+#define SIZEOF_INT 4
+#define SIZEOF_LONG 4
+#define ENABLE_CONCURRENCY
+#define ENABLE_DB_EVENT_SUPPORT
+#define ENABLE_CONNECTION_TIMEOUT
+#define ENABLE_FIELD_PRECISION_DETERMINATION
+#define ENABLE_DB_ARRAY_SUPPORT
+#define ENABLE_DB_SERVICES_API
--- python-kinterbasdb-3.2.0.orig/__init__.py
+++ python-kinterbasdb-3.2.0/__init__.py
@@ -24,7 +24,7 @@
 # underscore cannot be expected to have stable interfaces.
 
 __version__ = (3, 2, 0, 'final', 0)
-__timestamp__ = '2006.08.11.15.17.16.UTC'
+__timestamp__ = '2007.08.25.01.26.32.UTC'
 
 import os, struct, sys
 
