--- gobby-0.4.6.orig/src/header.cpp
+++ gobby-0.4.6/src/header.cpp
@@ -16,6 +16,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <cstring>
 #include <gtkmm/stock.h>
 #include <obby/format_string.hpp>
 
--- gobby-0.4.6.orig/src/unix.cpp
+++ gobby-0.4.6/src/unix.cpp
@@ -17,6 +17,7 @@
  */
 
 #include <stdexcept>
+#include <cstring>
 #include "unix.hpp"
 
 namespace
--- gobby-0.4.6.orig/src/preferencesdialog.cpp
+++ gobby-0.4.6/src/preferencesdialog.cpp
@@ -16,6 +16,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <cstring>
 #include <stdexcept>
 #include <gtkmm/stock.h>
 #include <gtkmm/messagedialog.h>
--- gobby-0.4.6.orig/src/preferences.cpp
+++ gobby-0.4.6/src/preferences.cpp
@@ -16,6 +16,7 @@
  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <cstring>
 #include "features.hpp"
 
 #ifdef WITH_GTKSOURCEVIEW2
@@ -319,7 +320,7 @@
 		add_by_mime_type("*.xml", "text/xml", lang_mgr);
 		add_by_mime_type(
 			"*.desktop",
-			"application/x-gnome-app-info",
+			"application/x-desktop",
 			lang_mgr
 		);
 		add_by_mime_type("*.tcl", "text/x-tcl", lang_mgr);
--- gobby-0.4.6.orig/contrib/gobby.desktop
+++ gobby-0.4.6/contrib/gobby.desktop
@@ -1,5 +1,4 @@
 [Desktop Entry]
-Encoding=UTF-8
 Name=Gobby Collaborative Editor
 Name[de]=Gobby-Gemeinschaftseditor
 Comment=Edit text files collaboratively
@@ -8,6 +7,7 @@
 Terminal=false
 Type=Application
 Icon=gobby.png
-Categories=Application;TextEditor;Network;
+Categories=TextEditor;Network;
 StartupNotify=true
 MimeType=text/plain;
+X-Ubuntu-Gettext-Domain=gobby
--- gobby-0.4.6.orig/debian/docs
+++ gobby-0.4.6/debian/docs
@@ -0,0 +1,3 @@
+AUTHORS
+NEWS
+README
--- gobby-0.4.6.orig/debian/watch
+++ gobby-0.4.6/debian/watch
@@ -0,0 +1,2 @@
+version=2
+http://releases.0x539.de/gobby/ gobby-(\d\.\d\.\d)\.tar\.gz
--- gobby-0.4.6.orig/debian/control
+++ gobby-0.4.6/debian/control
@@ -0,0 +1,43 @@
+Source: gobby
+Section: net
+Priority: optional
+Maintainer: Philipp Kern <pkern@debian.org>
+Build-Depends: debhelper (>= 5.0.0), autotools-dev, libxml++2.6-dev (>= 2.6.1-2.2), libgtkmm-2.4-dev (>= 1:2.6.5-1), libnet6-1.3-dev (>= 1:1.3.6-1~bpo40+1), libobby-0.4-dev (>= 0.4.5-1~bpo40+1), libgtksourceview-dev, libgnomevfs2-dev
+Standards-Version: 3.7.3
+VCS-Git: git://git.debian.org/git/users/pkern/gobby.git
+VCS-Browser: http://git.debian.org/?p=users/pkern/gobby.git
+Homepage: http://gobby.0x539.de
+
+Package: gobby
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Suggests: avahi-daemon
+Description: collaborative text editor
+ Gobby is an editor which allows to edit text documents and source files
+ collaboratively over a network. All users could work on the file
+ simultaneously without the need to lock it. The parts the various users
+ wrote are highlighted in different colours and it supports syntax
+ highlighting of various programming and markup languages. A chat is
+ also included.
+ .
+ Gobby is portable to both Windows and Unix-like platforms and makes use of
+ the Gtk+ toolkit.
+
+Package: gobby-dbg
+Section: devel
+Priority: extra
+Architecture: any
+Depends: gobby (= ${binary:Version})
+Description: collaborative text editor - debugging symbols
+ Gobby is an editor which allows to edit text documents and source files
+ collaboratively over a network. All users could work on the file
+ simultaneously without the need to lock it. The parts the various users
+ wrote are highlighted in different colours and it supports syntax
+ highlighting of various programming and markup languages. A chat is
+ also included.
+ .
+ Gobby is portable to both Windows and Unix-like platforms and makes use of
+ the Gtk+ toolkit.
+ .
+ These are the debugging symbols for gobby, needed only if you try to
+ debug it.
--- gobby-0.4.6.orig/debian/compat
+++ gobby-0.4.6/debian/compat
@@ -0,0 +1 @@
+5
--- gobby-0.4.6.orig/debian/changelog
+++ gobby-0.4.6/debian/changelog
@@ -0,0 +1,168 @@
+gobby (0.4.6-3~bpo40+2) etch-backports; urgency=low
+
+  * Use correct epoch for the net6 build dependency.
+
+ -- Philipp Kern <pkern@debian.org>  Mon, 16 Jun 2008 16:44:40 +0200
+
+gobby (0.4.6-3~bpo40+1) etch-backports; urgency=low
+
+  * Rebuild for etch-backports.
+  * Use gtksourceview 1.x instead of 2.x.
+
+ -- Philipp Kern <pkern@debian.org>  Mon, 16 Jun 2008 10:26:19 +0200
+
+gobby (0.4.6-3) unstable; urgency=low
+
+  * Merge from Ubuntu branch.
+    - Add translation domain to `contrib/gobby.desktop' to get
+      language pack support.
+    - Fix build failure with g++-4.3.
+
+ -- Philipp Kern <pkern@debian.org>  Tue, 05 Feb 2008 08:29:14 +0100
+
+gobby (0.4.6-2) unstable; urgency=low
+
+  * Suggest avahi-daemon to give an indicator how to get rid of
+    the howl warning.
+  * Fix desktop file to adhere to the freedesktop.org Desktop
+    Entry Specification v1.0.
+
+ -- Philipp Kern <pkern@debian.org>  Tue, 08 Jan 2008 14:59:23 +0100
+
+gobby (0.4.6-1) unstable; urgency=low
+
+  * New upstream version.
+  * Updated `debian/rules' to cope with tarball generation out of the
+    git repository and refactored it a bit.
+  * Added VCS and Homepage header to source stanza.
+  * Depend on newer obby as required by source.
+  * Build against gtksourceview2.
+  * Build a debug package, bump debhelper version to 5.
+  * Set menu section to `Applications/Editors'.
+
+ -- Philipp Kern <pkern@debian.org>  Thu, 03 Jan 2008 19:49:42 +0100
+
+gobby (0.4.5-1) unstable; urgency=low
+
+  * New upstream release (Closes: #436145)
+
+ -- Philipp Kern <pkern@debian.org>  Sun, 19 Aug 2007 17:00:07 +0200
+
+gobby (0.4.4-1) unstable; urgency=low
+
+  * New upstream release
+    - Fixes a crash triggered on rejoin (Closes: #428500)
+  * Recompile against current obby which declares more strict shlibs
+    dependencies (Closes: #428496)
+
+ -- Philipp Kern <pkern@debian.org>  Sun, 17 Jun 2007 00:14:57 +0200
+
+gobby (0.4.3-1) unstable; urgency=low
+
+  * New upstream release
+  * Dropped many of the Debian patches
+
+ -- Philipp Kern <pkern@debian.org>  Mon,  7 May 2007 10:45:04 +0200
+
+gobby (0.4.1-2) unstable; urgency=medium
+
+  * Fix mime type mapping.
+  * Lack of avahi-daemon now fails silently instead of a verbose message
+    confusing the user. Zeroconf is a `nice to have' but in no means
+    required.
+
+ -- Philipp Kern <pkern@debian.org>  Mon, 12 Mar 2007 19:41:21 +0100
+
+gobby (0.4.1-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Philipp Kern <pkern@debian.org>  Mon, 28 Aug 2006 17:43:30 +0200
+
+gobby (0.4.0~rc4-1) experimental; urgency=low
+
+  * New upstream release
+
+ -- Philipp Kern <pkern@debian.org>  Fri, 18 Aug 2006 01:23:12 +0200
+
+gobby (0.4.0~rc3-1) experimental; urgency=low
+
+  * New upstream release
+
+ -- Philipp Kern <pkern@debian.org>  Sat, 12 Aug 2006 12:48:27 +0200
+
+gobby (0.3.99+0.4.0rc2-1) experimental; urgency=low
+
+  * New upstream release, which is incompatible to previous versions
+    and still a release candidate; pushing to experimental to receive
+    more testing (Closes: #366621)
+  * Encryption is now handled by GNUTLS, so no GMP is needed anymore
+    (Closes: #367862)
+  * Fix minor spelling mistake in package description (Closes: #363616)
+
+ -- Philipp Kern <pkern@debian.org>  Tue, 13 Jun 2006 20:42:23 +0200
+
+gobby (0.3.0-2) unstable; urgency=low
+
+  * Enabled Zeroconf support through linking against Avahi's
+    compatibility layer for Howl lagacy applications
+    (Closes: #346499)
+  * Minor fixes for `debian/rules' related to cross-compilation and
+    autotools handling
+  * Updated `debian/watch' to version 3
+
+ -- Philipp Kern <pkern@debian.org>  Mon, 19 Dec 2005 19:24:00 +0100
+
+gobby (0.3.0-1) unstable; urgency=low
+
+  * New upstream release (Closes: #336694, #337047, #337067, #343829)
+  * Comply to the most recent C++ ABI transition
+  * Fix the removal of config.{guess,sub}
+
+ -- Philipp Kern <pkern@debian.org>  Mon, 19 Dec 2005 17:36:52 +0100
+
+gobby (0.2.2-2) unstable; urgency=medium
+
+  * Build against fixed gtksourceview (Closes: #327861)
+
+ -- Philipp Kern <pkern@debian.org>  Mon, 17 Oct 2005 21:13:02 +0200
+
+gobby (0.2.2-1) unstable; urgency=low
+
+  * New upstream release
+  * Added a link pointing to the package's homepage to the package
+    description (Closes: #321262)
+
+ -- Philipp Kern <pkern@debian.org>  Thu,  8 Sep 2005 13:35:34 +0200
+
+gobby (0.2.0-2) unstable; urgency=low
+
+  * Tightened the build dependencies
+
+ -- Philipp Kern <pkern@debian.org>  Sat, 20 Aug 2005 06:51:57 +0200
+
+gobby (0.2.0-1) unstable; urgency=low
+
+  * New upstream release
+
+ -- Philipp Kern <pkern@debian.org>  Sat, 30 Jul 2005 18:33:55 +0200
+
+gobby (0.1.1-1) experimental; urgency=low
+
+  * New upstream release
+
+ -- Philipp Kern <pkern@debian.org>  Mon,  6 Jun 2005 21:40:02 +0200
+
+gobby (0.0+20050521-2) experimental; urgency=medium
+
+  * Added epoch to the dependencies specified by libgtkmm-2.4-1's shlibs file
+    through a temporary local fix in debian/shlibs.local. (Closes: #310503)
+
+ -- Philipp Kern <pkern@debian.org>  Wed, 25 May 2005 11:14:44 +0000
+
+gobby (0.0+20050521-1) experimental; urgency=low
+
+  * Initial release (Closes: #308047)
+
+ -- Philipp Kern <pkern@debian.org>  Wed, 11 May 2005 13:06:39 +0200
+
--- gobby-0.4.6.orig/debian/copyright
+++ gobby-0.4.6/debian/copyright
@@ -0,0 +1,24 @@
+This package was debianized by Philipp Kern <pkern@debian.org> on
+Tue, 10 May 2005 22:47:31 +0200.
+
+It was downloaded from <http://releases.0x539.de/gobby/>.
+
+Copyright (C) 2005-2007 0x539 dev group <crew@0x539.de>
+
+License:
+
+  This program is written by the 0x539 dev group and is licensed
+  under the GNU General Public License (GPL) version 2 or any
+  later version. A copy of the license is included in the
+  distribution.
+
+  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.
+
+  Copyright (C) 2005-2007 0x539 dev group <crew@0x539.de>
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
--- gobby-0.4.6.orig/debian/dirs
+++ gobby-0.4.6/debian/dirs
@@ -0,0 +1,3 @@
+usr/bin
+usr/share/applications
+usr/share/pixmaps
--- gobby-0.4.6.orig/debian/rules
+++ gobby-0.4.6/debian/rules
@@ -0,0 +1,98 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+#export DH_VERBOSE=1
+
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+srcpkg = $(shell dpkg-parsechangelog | sed -ne 's/Source: *//p')
+srcver = $(shell dpkg-parsechangelog | sed -ne 's/Version: *\([0-9]*:\)\?\(.*\)-[^-]*$$/\2/p')
+dbgpkg = $(srcpkg)-dbg
+
+CFLAGS = -g -Wall -Wextra $(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),-O0,-O2)
+LDFLAGS= -Wl,-z,defs
+
+#{{{ generic rules
+
+../$(srcpkg)_$(srcver).orig.tar.gz:
+	@if git rev-parse --git-dir >/dev/null 2>&1; then                    \
+	    echo -n 'Regenerating $(@F)';                                    \
+	    git archive --prefix=tmp/ v$(srcver) | tar x;                    \
+	    cd tmp;                                                          \
+	    git show pristine-tar:$(@F).delta | pristine-tar gentar - ../$@; \
+	    cd ..;                                                           \
+	    rm -rf tmp;                                                      \
+	    echo .;                                                          \
+	fi
+
+check-tarball: ../$(srcpkg)_$(srcver).orig.tar.gz
+
+.PHONY: check-tarball
+
+#}}}
+
+config.status: configure
+	dh_testdir
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+	cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+	cp -f /usr/share/misc/config.guess config.guess
+endif
+	./configure --prefix=/usr \
+		--host=$(DEB_HOST_GNU_TYPE) \
+		--build=$(DEB_BUILD_GNU_TYPE) \
+		--mandir=\$${prefix}/share/man \
+		--infodir=\$${prefix}/share/info \
+		--with-gnome \
+		CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)"
+
+build: build-stamp
+
+build-stamp: config.status
+	dh_testdir
+	$(MAKE)
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+	[ ! -f Makefile ] || $(MAKE) distclean
+	rm -rf config.guess config.log config.sub
+	dh_clean
+
+install: build-stamp
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+	$(MAKE) install DESTDIR=$(CURDIR)/debian/gobby
+	# Copy some additional files.
+	gunzip -c $(CURDIR)/contrib/artwork/gobby.xpm.gz \
+	   > $(CURDIR)/debian/gobby/usr/share/pixmaps/gobby.xpm
+
+binary-indep: build install
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_installexamples
+	dh_installmenu
+	dh_installman
+	dh_link
+	dh_strip --dbg-package=$(dbgpkg)
+	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 clean
+
--- gobby-0.4.6.orig/debian/menu
+++ gobby-0.4.6/debian/menu
@@ -0,0 +1,3 @@
+?package(gobby):needs="X11" section="Applications/Editors"\
+  title="Gobby" longtitle="Collaborative Gtk+ text editor"\
+  command="/usr/bin/gobby" icon="/usr/share/pixmaps/gobby.xpm"
