diff -pruN 2.30.1-3/agent/seahorse-agent.c 2.30.1-3ubuntu3/agent/seahorse-agent.c
--- 2.30.1-3/agent/seahorse-agent.c	2010-01-25 02:06:50.000000000 +0000
+++ 2.30.1-3ubuntu3/agent/seahorse-agent.c	2011-09-05 13:21:45.000000000 +0000
@@ -160,9 +160,3 @@ seahorse_agent_uninit (gpointer *data)
     
     return FALSE;
 }
-
-void
-seahorse_agent_exit ()
-{
-    seahorse_agent_uninit (NULL);
-}
diff -pruN 2.30.1-3/agent/seahorse-agent.h 2.30.1-3ubuntu3/agent/seahorse-agent.h
--- 2.30.1-3/agent/seahorse-agent.h	2010-01-25 02:06:50.000000000 +0000
+++ 2.30.1-3ubuntu3/agent/seahorse-agent.h	2011-09-05 13:21:45.000000000 +0000
@@ -55,7 +55,6 @@ void seahorse_agent_childsetup ();
 /* Called in the new child process */
 gboolean seahorse_agent_init ();
 gboolean seahorse_agent_uninit (gpointer *data);
-void     seahorse_agent_exit ();
 
 /* Global options to set from the command line */
 extern gboolean seahorse_agent_cshell;
diff -pruN 2.30.1-3/agent/seahorse-agent-main.c 2.30.1-3ubuntu3/agent/seahorse-agent-main.c
--- 2.30.1-3/agent/seahorse-agent-main.c	2010-01-25 02:06:50.000000000 +0000
+++ 2.30.1-3ubuntu3/agent/seahorse-agent-main.c	2011-09-05 13:21:45.000000000 +0000
@@ -253,7 +253,7 @@ int main(int argc, char* argv[])
      */
     daemonize (seahorse_agent_execvars ? agent_exec_args : NULL);
 
-    atexit (seahorse_agent_exit);
+    atexit (seahorse_agent_io_uninit);
 
     g_strfreev (agent_exec_args);
     agent_exec_args = NULL;
diff -pruN 2.30.1-3/data/seahorse-plugins.schemas.in 2.30.1-3ubuntu3/data/seahorse-plugins.schemas.in
--- 2.30.1-3/data/seahorse-plugins.schemas.in	2010-01-25 02:06:50.000000000 +0000
+++ 2.30.1-3ubuntu3/data/seahorse-plugins.schemas.in	2011-09-05 13:21:45.000000000 +0000
@@ -180,7 +180,7 @@
 			<owner>seahorse</owner>
 			<type>list</type>
 			<list_type>string</list_type>
-			<default>[hkp://pgp.mit.edu:11371,ldap://keyserver.pgp.com]</default>
+			<default>[hkp://keyserver.ubuntu.com:11371,hkp://pgp.mit.edu:11371,ldap://keyserver.pgp.com]</default>
 			<locale name="C">
 				<short>PGP Key servers</short>
 				<long>A list of key server URIs to search for remote PGP keys.
diff -pruN 2.30.1-3/debian/changelog 2.30.1-3ubuntu3/debian/changelog
--- 2.30.1-3/debian/changelog	2010-06-25 17:10:29.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/changelog	2011-09-05 09:57:34.000000000 +0000
@@ -1,3 +1,51 @@
+seahorse-plugins (2.30.1-3ubuntu3) oneiric; urgency=low
+
+  * debian/patch/libnotify_0.7.patch: Fix FTBFS with libnotify 0.7,
+    GEdit plugin is disabled (LP: #832888)
+
+ -- Laurent Bigonville <bigon@ubuntu.com>  Mon, 05 Sep 2011 11:57:33 +0200
+
+seahorse-plugins (2.30.1-3ubuntu2) natty; urgency=low
+
+  * debian/patches/01_nomenu.patch: disable patch to re-enable preferences
+    GUI, as there is no other way to set default GPG key and options.
+
+ -- Marc Deslauriers <marc.deslauriers@ubuntu.com>  Mon, 17 Jan 2011 14:32:42 -0500
+
+seahorse-plugins (2.30.1-3ubuntu1) natty; urgency=low
+
+  * Merge from debian unstable.  Remaining changes: (LP: #701670)
+    - debian/control{.in}:
+      + Replace Build-Depends intltool with libxml-parser-perl.
+      + Add Vcs-Bzr link related to Ubuntu Desktop Team.
+      + seahorse-plugins: Move seahorse from Depends to Recommends.
+    - debian/menu: Add menu file.
+    - debian/patches/01_ubuntu_keyserver.patch:
+      + Added ubuntu keyserver to the defaults.
+    - debian/patches/02_copy_gpg_conf_skeleton.patch:
+      + Copy gpg.conf skel instead of creating blank file.
+    - debian/patches/03_dont_crash_on_exit.patch:
+      + Only clean up the socket dir on exit. Calling GConf functions
+        in the atexit handler is bad, as it conflicts with a handler
+        registered inside liborbit, leading to a crash.
+    - debian/rules:
+      + Remove DEB_DH_MAKESHLIBS_ARGS_seahorse-plugins.
+      + Rename 60seahorse to 60seahorse-plugins.
+      + Remove mime-type catalog, seahorse source package related.
+    - debian/seahorse{-preferences.1, .Xsession, -plugins.manpages}:
+      + Remove due to related with seahorse source package.
+    - debian/seahorse-plugins.Xsession:
+      + Start the seahorse-agent. Replaces debian/seahorse.Xsession.
+  * debian/copyright: Restore from Debian. seahorse-plugins source
+    has been uploaded in Debian after our initial upload.
+  * debian/patches/06_gpgme_check_version.patch:
+    - Dropped, applied upstream.
+  * debian/rules: Drop quilt, Debian has switched to 3.0 source format.
+  * debian/watch: Restore from Debian. There is no point to keep
+    change longer.
+
+ -- Artur Rona <ari-tczew@ubuntu.com>  Tue, 11 Jan 2011 15:13:36 +0100
+
 seahorse-plugins (2.30.1-3) unstable; urgency=low
 
   * 10_gpgme_crash.patch: stolen upstream. Fix a crash caused by a 
@@ -36,6 +84,63 @@ seahorse-plugins (2.30.0-1) unstable; ur
 
  -- Sebastian Dröge <slomo@debian.org>  Mon, 12 Apr 2010 17:37:48 +0200
 
+seahorse-plugins (2.30.0-0ubuntu2) lucid; urgency=low
+
+  * debian/patches/06_gpgme_check_version.patch:
+    - use gpgme_engine_check_version() before gpgm_new() since the current
+      gpgme version requires to do those calls, the change fixes the nautilus
+      entries not working (lp: #514950)
+
+ -- Sebastien Bacher <seb128@ubuntu.com>  Thu, 08 Apr 2010 01:27:05 +0200
+
+seahorse-plugins (2.30.0-0ubuntu1) lucid; urgency=low
+
+  * New upstream release:
+    - updated translations
+
+ -- Didier Roche <didrocks@ubuntu.com>  Wed, 31 Mar 2010 12:03:48 +0200
+
+seahorse-plugins (2.29.91-0ubuntu1) lucid; urgency=low
+
+  * New upstream release:
+    - Unescape URI's before presenting them to the user. [Adam Schreiber]
+    - Set visibility to FALSE on GtkEntries used for passphrase fields.
+      [Adam Schreiber]
+    - Translations
+  * remove debian/patches/90_git_dont_display_gpg_password.patch, was
+    taken from git
+
+ -- Didier Roche <didrocks@ubuntu.com>  Fri, 26 Feb 2010 16:07:24 +0100
+
+seahorse-plugins (2.29.90-0ubuntu3) lucid; urgency=low
+
+  * debian/patches/90_git_dont_display_gpg_password.patch:
+    - git change to fix gpg password being displayed in the text entry
+      (lp: #520099)
+
+ -- Sebastien Bacher <seb128@ubuntu.com>  Fri, 12 Feb 2010 00:41:59 +0100
+
+seahorse-plugins (2.29.90-0ubuntu2) lucid; urgency=low
+
+  * debian/seahorse-plugins.Xsession: avoid starting seahorse-agent if
+    gnupg-agent is installed. This avoids bad interaction between the two,
+    which seems to be known upstream in gnome #578312, closes LP: #183514
+    plus duplicates.
+
+ -- Reinhard Tartler <siretart@tauware.de>  Thu, 11 Feb 2010 21:01:23 +0100
+
+seahorse-plugins (2.29.90-0ubuntu1) lucid; urgency=low
+
+  * new upstream release:
+    - Use GTK+ GtkEntryBuffer for secure password entry. [Stef Walter, Adam Schreiber]
+    - Fix usage of g_strconcat [Adam Schreiber]
+    - Don't use fixed MAXPATHLEN size buffers [Emilio Pozuelo Monfort]
+    - Updated translations
+  * debian/control.in:
+    - remove libglade2-dev build-dep
+
+ -- Didier Roche <didrocks@ubuntu.com>  Tue, 09 Feb 2010 14:55:30 +0100
+
 seahorse-plugins (2.28.1-2) unstable; urgency=low
 
   * Disable epiphany plugin, it doesn’t work at all since it’s still 
@@ -49,6 +154,45 @@ seahorse-plugins (2.28.1-1) unstable; ur
 
  -- Andrea Veri <andrea.veri89@gmail.com>  Thu, 22 Oct 2009 21:45:01 +0200
 
+seahorse-plugins (2.28.1-0ubuntu5) lucid; urgency=low
+
+  * debian/seahorse-plugins.Xsession: Add support for session command
+    containing args (LP: #512235)
+
+ -- Didier Roche <didrocks@ubuntu.com>  Mon, 25 Jan 2010 10:30:43 +0100
+
+seahorse-plugins (2.28.1-0ubuntu4) karmic-proposed; urgency=low
+
+  * debian/patches/03_dont_crash_on_exit.patch:
+    - Only clean up the socket dir on exit. Calling GConf functions
+      in the atexit handler is bad, as it conflicts with a handler
+      registered inside liborbit, leading to a crash (LP: #429322)
+
+ -- Chris Coulson <chrisccoulson@ubuntu.com>  Mon, 09 Nov 2009 22:34:57 +0000
+
+seahorse-plugins (2.28.1-0ubuntu3) karmic; urgency=low
+
+  * fix ftbfs because of old configure argument leftovers and
+    explicitly disable epiphany
+
+ -- Alexander Sack <asac@ubuntu.com>  Tue, 20 Oct 2009 13:58:11 +0200
+
+seahorse-plugins (2.28.1-0ubuntu2) karmic; urgency=low
+
+  * LP: #455517 - supersede firefox 3.0 and xulrunner-1.9 in karmic;
+    drop xulrunner build-dependency
+  * also drop epiphany-browser-dev build-dependency to finish
+    epiphany demotion to universe.
+
+ -- Alexander Sack <asac@ubuntu.com>  Tue, 20 Oct 2009 11:39:00 +0200
+
+seahorse-plugins (2.28.1-0ubuntu1) karmic; urgency=low
+
+  * New upstream release: (LP: #455180)
+    - Add the get-info command to seahorse-agent
+
+ -- Robert Ancell <robert.ancell@canonical.com>  Mon, 19 Oct 2009 17:00:18 +1100
+
 seahorse-plugins (2.28.0-1) unstable; urgency=low
 
   * New upstream release.
@@ -58,6 +202,24 @@ seahorse-plugins (2.28.0-1) unstable; ur
 
  -- Andrea Veri <andrea.veri89@gmail.com>  Thu, 15 Oct 2009 23:17:26 +0200
 
+seahorse-plugins (2.28.0-0ubuntu1) karmic; urgency=low
+
+  * New upstream release: (LP: #435562)
+    - Fix configure script portability
+    - Fix crash in seahorse-preferences
+    - Fix single glib include
+    - Translation updates
+
+ -- Robert Ancell <robert.ancell@canonical.com>  Thu, 24 Sep 2009 10:09:58 +1000
+
+seahorse-plugins (2.27.1-0ubuntu1) karmic; urgency=low
+
+  * New upstream release: (LP: #370604)
+    - Clean up socket directory [Adam Schreiber]
+    - New and updated translations
+
+ -- Andreas Moog <amoog@ubuntu.com>  Sat, 02 May 2009 01:30:06 +0200
+
 seahorse-plugins (2.26.2-1) unstable; urgency=low
 
   [ Andreas Moog ]
@@ -85,6 +247,76 @@ seahorse-plugins (2.26.1-1) unstable; ur
 
  -- Josselin Mouette <joss@debian.org>  Wed, 20 May 2009 16:45:40 +0200
 
+seahorse-plugins (2.26.1-0ubuntu1) jaunty; urgency=low
+
+  * New upstream release: (LP: #360711)
+    - New and updated translations
+
+ -- Andreas Moog <andreas.moog@warperbbs.de>  Tue, 14 Apr 2009 10:39:58 +0200
+
+seahorse-plugins (2.26.0-0ubuntu2) jaunty; urgency=low
+
+  * libseahorse/seahorse-gpg-options.c:
+    - Copy gpg.conf skel instead of creating blank file
+    (LP: #345727)
+
+ -- Mackenzie Morgan <maco.m@ubuntu.com>  Fri, 20 Mar 2009 02:58:29 -0400
+
+seahorse-plugins (2.26.0-0ubuntu1) jaunty; urgency=low
+
+  * New upstream release (LP: #343968)
+
+ -- Andreas Moog <andreas.moog@warperbbs.de>  Tue, 17 Mar 2009 00:33:18 +0100
+
+seahorse-plugins (2.25.92-0ubuntu2) jaunty; urgency=low
+
+  * debian/patches/01_ubuntu_keyserver.patch:
+    - Added ubuntu keyserver to the defaults (LP: #86796)
+
+ -- Ken VanDine <ken.vandine@canonical.com>  Thu, 05 Mar 2009 16:47:20 -0500
+
+seahorse-plugins (2.25.92-0ubuntu1) jaunty; urgency=low
+
+  * New upstream release (LP: #337339)
+    - Connect the uninit function to gtk_quit signal. Fixes bug #560784
+    - Only use 16 characters when generating a key identifier for
+      notifications. Fixes bug #551012
+    - Fix reference counting to close windows properly
+    - Fixed Jesse's patch as per Paolo Borelli's suggestions. See
+      bug #571477 (LP: #333558)
+    - Switch to chaining to finalize instead of dispose. Patch from
+      Jesse van den Kieboom. Fixes bug #571477 (LP: #327252)
+    - Don't print replacement text to stderr.  Fixes bug #573044 (LP: 307863)
+    - Remove deprecated GTK+ symbols.  Fixes bug #572183
+    - Removed unused screenshots
+    - Update epiphany checking code. Patch from Christian Persch.  Fixes 
+      bugs #570525 and #570494
+  * debian/control.in:
+    - Updated build-depends for epiphany-browser-dev to >= 2.24.0
+
+ -- Ken VanDine <ken.vandine@canonical.com>  Tue, 03 Mar 2009 15:16:25 -0500
+
+seahorse-plugins (2.25.90-0ubuntu1) jaunty; urgency=low
+
+  * New upstream version (LP: #329832)
+    - Don't prompt for signer if only one private key (LP: #271137)
+    - Bring name of preferences window into alignment with desktop file and
+      documentation
+    - Finish removing libgnome calls
+    - Fix display of error messages
+    - Translations: ko, bn_IN
+  * Fix (wrong url) and update debian/watch to take into account unstable version
+  * Add Vcs-Bzr tag to debian/control.in
+  * Re-generate debian/control
+
+ -- Didier Roche <didrocks@ubuntu.com>  Sun, 15 Feb 2009 21:59:58 +0100
+
+seahorse-plugins (2.25.3-0ubuntu1) jaunty; urgency=low
+
+  * New upstream version (LP: #316555).
+
+ -- Christophe Sauthier <christophe.sauthier@gmail.com>  Thu, 08 Jan 2009 18:24:20 +0100
+
 seahorse-plugins (2.24.1-3) unstable; urgency=low
 
   * Upload to unstable.
@@ -129,6 +361,12 @@ seahorse-plugins (2.24.1-1) experimental
 
  -- Josselin Mouette <joss@debian.org>  Tue, 09 Dec 2008 22:42:45 +0100
 
+seahorse-plugins (2.24.1-0ubuntu2) jaunty; urgency=low
+
+  * no changes upload for nss/nspr SONAME mini-transition
+
+ -- Alexander Sack <asac@ubuntu.com>  Mon, 12 Jan 2009 16:22:14 +0100
+
 seahorse-plugins (2.24.1-0ubuntu1) intrepid; urgency=low
 
   * New upstream version (LP: #286505). 
diff -pruN 2.30.1-3/debian/control 2.30.1-3ubuntu3/debian/control
--- 2.30.1-3/debian/control	2010-06-25 17:33:46.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/control	2011-09-05 09:57:39.000000000 +0000
@@ -6,13 +6,14 @@
 Source: seahorse-plugins
 Section: gnome
 Priority: optional
-Maintainer: Emilio Pozuelo Monfort <pochu@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Emilio Pozuelo Monfort <pochu@debian.org>
 Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers@lists.alioth.debian.org>, Josselin Mouette <joss@debian.org>, Sebastian Dröge <slomo@debian.org>
 Build-Depends: debhelper (>= 5),
                cdbs (>= 0.4.41),
                scrollkeeper,
                libgpgme11-dev,
-               intltool (>= 0.35),
+               libxml-parser-perl,
                libnotify-dev,
                libdbus-glib-1-dev,
                gnome-doc-utils,
@@ -27,24 +28,21 @@ Build-Depends: debhelper (>= 5),
                gnome-pkg-tools,
                libnautilus-extension-dev (>= 2.12)
 Standards-Version: 3.8.3
-Vcs-Svn: svn://svn.debian.org/svn/pkg-gnome/desktop/unstable/seahorse-plugins
-Vcs-Browser: http://svn.debian.org/viewsvn/pkg-gnome/desktop/unstable/seahorse-plugins
+Vcs-Bzr: https://code.launchpad.net/~ubuntu-desktop/seahorse-plugins/ubuntu
 Homepage: http://live.gnome.org/Seahorse
 
 Package: seahorse-plugins
 Architecture: any
 Depends: ${shlibs:Depends},
          ${misc:Depends},
-         seahorse (>= 2.24.0)
-Recommends: openssh-client
+Recommends: openssh-client, seahorse (>= 2.24.0)
 Replaces: seahorse (<< 2.24.0)
 Description: seahorse plugins and utilities for encryption in GNOME
- Seahorse is a front end for GnuPG - the GNU Privacy Guard program -
- that integrates to the GNOME desktop. It is a tool for secure
- communications and data storage.  Data encryption and digital signature
- creation can easily be performed through a GUI and Key  Management
- operations can easily be carried out through an intuitive interface.
+ Seahorse is a Gnome front end for GnuPG - the Gnu Privacy Guard program. It
+ is a tool for secure communications and data storage.  Data encryption and
+ digital signature creation can easily be performed through a GUI and Key
+ Management operations can easily be carried out through an intuitive
+ interface.
  .
- This package provides several plugins for different applications to use
- seahorse, as well as an agent for storing private passphrases and a
- GnuPG and OpenSSH key manager.
+ In addition it includes an agent for storing private passphrases, 
+ as well as a GnuPG and OpenSSH key manager.
diff -pruN 2.30.1-3/debian/control.in 2.30.1-3ubuntu3/debian/control.in
--- 2.30.1-3/debian/control.in	2010-04-12 15:38:33.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/control.in	2011-09-05 09:53:37.000000000 +0000
@@ -1,13 +1,14 @@
 Source: seahorse-plugins
 Section: gnome
 Priority: optional
-Maintainer: Emilio Pozuelo Monfort <pochu@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Emilio Pozuelo Monfort <pochu@debian.org>
 Uploaders: @GNOME_TEAM@
 Build-Depends: debhelper (>= 5),
                cdbs (>= 0.4.41),
                scrollkeeper,
                libgpgme11-dev,
-               intltool (>= 0.35),
+               libxml-parser-perl,
                libnotify-dev,
                libdbus-glib-1-dev,
                gnome-doc-utils,
@@ -22,24 +23,21 @@ Build-Depends: debhelper (>= 5),
                gnome-pkg-tools,
                libnautilus-extension-dev (>= 2.12)
 Standards-Version: 3.8.3
-Vcs-Svn: svn://svn.debian.org/svn/pkg-gnome/desktop/unstable/seahorse-plugins
-Vcs-Browser: http://svn.debian.org/viewsvn/pkg-gnome/desktop/unstable/seahorse-plugins
+Vcs-Bzr: https://code.launchpad.net/~ubuntu-desktop/seahorse-plugins/ubuntu
 Homepage: http://live.gnome.org/Seahorse
 
 Package: seahorse-plugins
 Architecture: any
 Depends: ${shlibs:Depends},
          ${misc:Depends},
-         seahorse (>= 2.24.0)
-Recommends: openssh-client
+Recommends: openssh-client, seahorse (>= 2.24.0)
 Replaces: seahorse (<< 2.24.0)
 Description: seahorse plugins and utilities for encryption in GNOME
- Seahorse is a front end for GnuPG - the GNU Privacy Guard program -
- that integrates to the GNOME desktop. It is a tool for secure
- communications and data storage.  Data encryption and digital signature
- creation can easily be performed through a GUI and Key  Management
- operations can easily be carried out through an intuitive interface.
+ Seahorse is a Gnome front end for GnuPG - the Gnu Privacy Guard program. It
+ is a tool for secure communications and data storage.  Data encryption and
+ digital signature creation can easily be performed through a GUI and Key
+ Management operations can easily be carried out through an intuitive
+ interface.
  .
- This package provides several plugins for different applications to use
- seahorse, as well as an agent for storing private passphrases and a
- GnuPG and OpenSSH key manager.
+ In addition it includes an agent for storing private passphrases, 
+ as well as a GnuPG and OpenSSH key manager.
diff -pruN 2.30.1-3/debian/menu 2.30.1-3ubuntu3/debian/menu
--- 2.30.1-3/debian/menu	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/menu	2011-01-17 15:53:55.000000000 +0000
@@ -0,0 +1,7 @@
+?package(seahorse):needs="X11" \
+  section="Applications/System/Security" \
+  hints="Gnome" \
+  title="Seahorse" \
+  longtitle="A GNOME frontend for GnuPG" \
+  command="/usr/bin/seahorse" \
+  icon="/usr/share/pixmaps/seahorse.xpm"
diff -pruN 2.30.1-3/debian/patches/01_ubuntu_keyserver.patch 2.30.1-3ubuntu3/debian/patches/01_ubuntu_keyserver.patch
--- 2.30.1-3/debian/patches/01_ubuntu_keyserver.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/patches/01_ubuntu_keyserver.patch	2011-01-17 15:53:55.000000000 +0000
@@ -0,0 +1,17 @@
+Description: Added ubuntu keyserver to the defaults.
+Bug-Ubuntu: https://launchpad.net/bugs/86796
+Forwarded: not-needed
+Author: Andrew Starr-Bochicchio (andrewsomething) <a.starr.b@gmail.com>
+
+diff -r 26d5db3010fc data/seahorse-plugins.schemas.in
+--- a/data/seahorse-plugins.schemas.in	Thu Mar 05 16:43:19 2009 -0500
++++ b/data/seahorse-plugins.schemas.in	Thu Mar 05 16:44:48 2009 -0500
+@@ -180,7 +180,7 @@
+ 			<owner>seahorse</owner>
+ 			<type>list</type>
+ 			<list_type>string</list_type>
+-			<default>[hkp://pgp.mit.edu:11371,ldap://keyserver.pgp.com]</default>
++			<default>[hkp://keyserver.ubuntu.com:11371,hkp://pgp.mit.edu:11371,ldap://keyserver.pgp.com]</default>
+ 			<locale name="C">
+ 				<short>PGP Key servers</short>
+ 				<long>A list of key server URIs to search for remote PGP keys.
diff -pruN 2.30.1-3/debian/patches/02_copy_gpg_conf_skeleton.patch 2.30.1-3ubuntu3/debian/patches/02_copy_gpg_conf_skeleton.patch
--- 2.30.1-3/debian/patches/02_copy_gpg_conf_skeleton.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/patches/02_copy_gpg_conf_skeleton.patch	2011-01-17 15:53:55.000000000 +0000
@@ -0,0 +1,46 @@
+From: Mackenzie Morgan <maco.m@ubuntu.com>
+Description: Copy gpg.conf skel instead of creating blank file.
+Bug: https://bugzilla.gnome.org/585535
+Bug-Ubuntu: https://launchpad.net/bugs/345727
+Forwarded: yes
+
+--- seahorse-plugins-2.26.0.orig/libseahorse/seahorse-gpg-options.c
++++ seahorse-plugins-2.26.0/libseahorse/seahorse-gpg-options.c
+@@ -30,6 +30,7 @@
+ #include <fcntl.h>
+ #include <unistd.h>
+ #include <sys/stat.h>
++#include <glib/gstdio.h>
+ 
+ #include "seahorse-gpgmex.h"
+ #include "seahorse-util.h"
+@@ -45,22 +46,14 @@
+ static gboolean
+ create_file (const gchar *file, mode_t mode, GError **err)
+ {
+-    int fd;
+-    g_assert (err && !*err);
+-    
+-    if ((fd = open (file, O_CREAT | O_TRUNC | O_WRONLY, mode)) == -1) {
+-        g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
+-                     strerror (errno), NULL);     
+-        return FALSE;
++    gchar *contents;
++	const char *skel = "/usr/share/gnupg/options.skel";
++    if (g_file_get_contents(skel, &contents, NULL, err)) {
++        if (g_file_set_contents(file, contents, -1, err)) {
++			g_chmod(file, mode);
++        } 
+     }
+-
+-    /* Write the header when we make a new file */
+-    if (write (fd, GPG_CONF_HEADER, strlen (GPG_CONF_HEADER)) == -1) {
+-        g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
+-                     strerror (errno), NULL);     
+-    }
+-    
+-    close (fd);
++	g_free(contents);
+     return *err ? FALSE : TRUE;
+ }
+ 
diff -pruN 2.30.1-3/debian/patches/03_dont_crash_on_exit.patch 2.30.1-3ubuntu3/debian/patches/03_dont_crash_on_exit.patch
--- 2.30.1-3/debian/patches/03_dont_crash_on_exit.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/patches/03_dont_crash_on_exit.patch	2011-01-17 15:53:55.000000000 +0000
@@ -0,0 +1,50 @@
+Author: Chris Coulson <chrisccoulson@ubuntu.com>
+Description: Fix a crash on exit
+
+Only clean up the socket dir on exit. Calling GConf functions
+in the atexit handler is bad, as it conflicts with a handler
+registered inside liborbit, leading to a crash
+
+Bug-Ubuntu: https://launchpad.net/bugs/429322
+Bug: http://bugzilla.gnome.org/579738
+Forwarded: yes
+
+Index: seahorse-plugins-2.28.1/agent/seahorse-agent-main.c
+===================================================================
+--- seahorse-plugins-2.28.1.orig/agent/seahorse-agent-main.c	2009-11-09 22:24:42.000000000 +0000
++++ seahorse-plugins-2.28.1/agent/seahorse-agent-main.c	2009-11-09 22:24:59.000000000 +0000
+@@ -253,7 +253,7 @@
+      */
+     daemonize (seahorse_agent_execvars ? agent_exec_args : NULL);
+ 
+-    atexit (seahorse_agent_exit);
++    atexit (seahorse_agent_io_uninit);
+ 
+     g_strfreev (agent_exec_args);
+     agent_exec_args = NULL;
+Index: seahorse-plugins-2.28.1/agent/seahorse-agent.c
+===================================================================
+--- seahorse-plugins-2.28.1.orig/agent/seahorse-agent.c	2009-11-09 22:19:28.000000000 +0000
++++ seahorse-plugins-2.28.1/agent/seahorse-agent.c	2009-11-09 22:19:35.000000000 +0000
+@@ -160,9 +160,3 @@
+     
+     return FALSE;
+ }
+-
+-void
+-seahorse_agent_exit ()
+-{
+-    seahorse_agent_uninit (NULL);
+-}
+Index: seahorse-plugins-2.28.1/agent/seahorse-agent.h
+===================================================================
+--- seahorse-plugins-2.28.1.orig/agent/seahorse-agent.h	2009-11-09 22:19:42.000000000 +0000
++++ seahorse-plugins-2.28.1/agent/seahorse-agent.h	2009-11-09 22:19:56.000000000 +0000
+@@ -55,7 +55,6 @@
+ /* Called in the new child process */
+ gboolean seahorse_agent_init ();
+ gboolean seahorse_agent_uninit (gpointer *data);
+-void     seahorse_agent_exit ();
+ 
+ /* Global options to set from the command line */
+ extern gboolean seahorse_agent_cshell;
diff -pruN 2.30.1-3/debian/patches/06_gpgme_check_version.patch 2.30.1-3ubuntu3/debian/patches/06_gpgme_check_version.patch
--- 2.30.1-3/debian/patches/06_gpgme_check_version.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/patches/06_gpgme_check_version.patch	2011-01-17 15:53:55.000000000 +0000
@@ -0,0 +1,52 @@
+# Description: use gpgme_check_version () since gpgme_new () requires it now
+# Bug-Ubuntu: https://bugs.launchpad.net/bugs/514950
+# Bug: https://bugzilla.gnome.org/show_bug.cgi?id=607423
+Index: seahorse-plugins-2.30.0/plugins/nautilus/seahorse-tool.c
+===================================================================
+--- seahorse-plugins-2.30.0.orig/plugins/nautilus/seahorse-tool.c	2010-02-13 15:31:34.000000000 +0100
++++ seahorse-plugins-2.30.0/plugins/nautilus/seahorse-tool.c	2010-04-08 02:46:54.000000000 +0200
+@@ -170,6 +170,9 @@
+         recips = cryptui_prompt_recipients (keyset, _("Choose Recipients"), &signer);
+         
+         if (recips) {
++            gpgme_check_version (NULL);
++            gerr = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
++            g_return_val_if_fail (GPG_IS_OK (gerr), NULL);
+             
+             gerr = gpgme_new (&ctx);
+             g_return_val_if_fail (GPG_IS_OK (gerr), NULL);
+@@ -328,6 +331,10 @@
+         id = cryptui_keyset_key_raw_keyid (keyset, signer);
+         g_free (signer);
+         
++        gpgme_check_version (NULL);
++        gerr = gpgme_engine_check_version (GPGME_PROTOCOL_OpenPGP);
++        g_return_val_if_fail (GPG_IS_OK (gerr), NULL);
++
+         gerr = gpgme_new (&ctx);
+         g_return_val_if_fail (GPG_IS_OK (gerr), NULL);
+         
+Index: seahorse-plugins-2.30.0/agent/seahorse-agent-cache.c
+===================================================================
+--- seahorse-plugins-2.30.0.orig/agent/seahorse-agent-cache.c	2010-01-25 03:06:50.000000000 +0100
++++ seahorse-plugins-2.30.0/agent/seahorse-agent-cache.c	2010-04-08 02:46:54.000000000 +0200
+@@ -237,6 +237,7 @@
+         g_cache =
+             g_hash_table_new_full (g_str_hash, g_str_equal, NULL, destroy_cache_item);
+ 
++        gpgme_check_version (NULL);
+         err = gpgme_engine_check_version (proto);
+         g_return_if_fail (GPG_IS_OK (err));
+         
+Index: seahorse-plugins-2.30.0/libseahorse/seahorse-pgp-operation.c
+===================================================================
+--- seahorse-plugins-2.30.0.orig/libseahorse/seahorse-pgp-operation.c	2010-01-25 03:06:50.000000000 +0100
++++ seahorse-plugins-2.30.0/libseahorse/seahorse-pgp-operation.c	2010-04-08 02:46:54.000000000 +0200
+@@ -323,6 +323,7 @@
+     gpgme_error_t err;
+     gpgme_ctx_t ctx;
+  
++    gpgme_check_version (NULL);
+     err = gpgme_engine_check_version (proto);
+     g_return_if_fail (GPG_IS_OK (err));
+    
diff -pruN 2.30.1-3/debian/patches/libnotify_0.7.patch 2.30.1-3ubuntu3/debian/patches/libnotify_0.7.patch
--- 2.30.1-3/debian/patches/libnotify_0.7.patch	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/patches/libnotify_0.7.patch	2011-09-05 09:50:59.000000000 +0000
@@ -0,0 +1,52 @@
+From fb74a75aa237c97c90dc1df2cfe36656a320e93e Mon Sep 17 00:00:00 2001
+From: Nirbheek Chauhan <nirbheek.chauhan@gmail.com>
+Date: Fri, 14 Jan 2011 06:32:17 +0530
+Subject: [PATCH] libseahorse: fix build with libnotify-0.7
+
+* notify_notification_new cannot attach itself to widgets with 0.7
+---
+ libseahorse/seahorse-notification.c |   14 ++++++++++++--
+ 1 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/libseahorse/seahorse-notification.c b/libseahorse/seahorse-notification.c
+index 5660bf7..cc92cd2 100644
+--- a/libseahorse/seahorse-notification.c
++++ b/libseahorse/seahorse-notification.c
+@@ -34,6 +34,11 @@
+ 
+ #ifdef HAVE_LIBNOTIFY
+ #include <libnotify/notify.h>
++
++#ifndef NOTIFY_CHECK_VERSION
++#define NOTIFY_CHECK_VERSION(x,y,z) 0
++#endif
++
+ #endif
+ 
+ /* -----------------------------------------------------------------------------
+@@ -199,7 +204,7 @@ libnotify_closed (NotifyNotification *notif, SeahorseNotification *snotif)
+ }
+ 
+ static void
+-setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent, 
++setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent,
+                               GtkWidget *attachto)
+ {
+     NotifyNotification *notif;
+@@ -212,8 +217,13 @@ setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent,
+     
+     heading = format_key_text (snotif->heading);
+     message = format_key_text (snotif->message);
+-    
++
++/* libnotify 0.7.0 and later has no support for attaching to widgets */
++#if NOTIFY_CHECK_VERSION(0,7,0)
++    notif = notify_notification_new (heading, message, snotif->icon);
++#else
+     notif = notify_notification_new (heading, message, snotif->icon, attachto);
++#endif
+     
+     g_free (heading);
+     g_free (message);
+-- 
+1.7.2.5
diff -pruN 2.30.1-3/debian/patches/series 2.30.1-3ubuntu3/debian/patches/series
--- 2.30.1-3/debian/patches/series	2010-06-25 17:10:29.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/patches/series	2011-09-05 09:39:56.000000000 +0000
@@ -1,2 +1,6 @@
-01_nomenu.patch
+#01_nomenu.patch
+01_ubuntu_keyserver.patch
+02_copy_gpg_conf_skeleton.patch
+03_dont_crash_on_exit.patch
 10_gpgme_crash.patch
+libnotify_0.7.patch
diff -pruN 2.30.1-3/debian/rules 2.30.1-3ubuntu3/debian/rules
--- 2.30.1-3/debian/rules	2010-05-07 20:18:54.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/rules	2011-01-17 15:53:55.000000000 +0000
@@ -12,13 +12,8 @@ DEB_CONFIGURE_EXTRA_FLAGS += --disable-u
 			     --disable-scrollkeeper \
 			     --disable-epiphany
 
-DEB_DH_MAKESHLIBS_ARGS_seahorse-plugins := --no-act
-
 binary-post-install/seahorse-plugins::
 	mkdir -p $(CURDIR)/debian/seahorse-plugins/etc/X11/Xsession.d
-	cp debian/seahorse.Xsession \
-		$(CURDIR)/debian/seahorse-plugins/etc/X11/Xsession.d/60seahorse
+	cp debian/seahorse-plugins.Xsession $(CURDIR)/debian/seahorse-plugins/etc/X11/Xsession.d/60seahorse-plugins
 	find debian/seahorse-plugins -name '*.a' -exec rm -f {} \;
 	find debian/seahorse-plugins -name '*.la' -exec rm -f {} \;
-	# Remove mime-type catalog, it's in shared-mime-info since 0.20
-	rm -f debian/seahorse/usr/share/mime/packages/seahorse.xml
diff -pruN 2.30.1-3/debian/seahorse-plugins.manpages 2.30.1-3ubuntu3/debian/seahorse-plugins.manpages
--- 2.30.1-3/debian/seahorse-plugins.manpages	2009-08-30 22:59:10.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/seahorse-plugins.manpages	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-debian/seahorse-preferences.1
diff -pruN 2.30.1-3/debian/seahorse-plugins.Xsession 2.30.1-3ubuntu3/debian/seahorse-plugins.Xsession
--- 2.30.1-3/debian/seahorse-plugins.Xsession	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/seahorse-plugins.Xsession	2011-01-17 15:53:55.000000000 +0000
@@ -0,0 +1,15 @@
+# This file is sourced by Xsession(5), not executed.
+
+SEAHORSE=/usr/bin/seahorse-agent
+GPGAGENT=/usr/bin/gpg-agent
+
+if [ -n "$GNOMERC" ] && [ -x $SEAHORSE ] &&  ! [ -x $GPGAGENT ]; then
+	BINARY="${STARTUP%% *}"
+	OPTIONS="${STARTUP#* }"
+	# BINARY and OPTIONS are the same if no option in STARTUP
+	if [ "$BINARY" != "$OPTIONS" ]; then
+		STARTUP="$BINARY -- $OPTIONS"
+	fi
+	STARTUP="$SEAHORSE --execute $STARTUP"
+fi
+
diff -pruN 2.30.1-3/debian/seahorse-preferences.1 2.30.1-3ubuntu3/debian/seahorse-preferences.1
--- 2.30.1-3/debian/seahorse-preferences.1	2009-08-30 22:59:10.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/seahorse-preferences.1	1970-01-01 00:00:00.000000000 +0000
@@ -1,40 +0,0 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.36.
-.TH SEAHORSE-PREFERENCES "1" "August 2009" "SEAHORSE-PREFERENCES" "User Commands"
-.SH NAME
-seahorse-preferences \- View and set encryption preferences
-.SH SYNOPSIS
-seahorse [OPTION...]
-.SH DESCRIPTION
-Seahorse is a front end for GnuPG - the GNU Privacy Guard program -
-that integrates to the GNOME desktop. It is a tool for secure
-communications and data storage.  Data encryption and digital signature
-creation can easily be performed through a GUI and Key  Management
-operations can easily be carried out through an intuitive interface.
-.TP
-This tool allows to view and set settings related to encryption.
-.SH OPTIONS
-.TP
-\-?, \fB\-\-help\fR
-Show help options
-.TP
-\fB\-\-help\-all\fR
-Show all help options
-.TP
-\fB\-\-help\-gtk\fR
-Show GTK+ Options
-.SS "Application Options:"
-.TP
-\fB\-\-display\fR=\fIDISPLAY\fR
-X display to use
-.SH BUGS
-If you find a bug, please report it at http://bugzilla.gnome.org/enter_bug.cgi?product=seahorse-plugins.
-.SH AUTHORS
-Jacob Perkins <jap1@users.sourceforge.net>
-.TP
-Jose Carlos Garcia Sogo <jsogo@users.sourceforge.net>
-.TP
-Jean Schurger <jk24@users.sourceforge.net>
-.TP
-Stef Walter <stef@memberwebs.com>
-.TP
-Adam Schreiber <sadam@clemson.edu>
diff -pruN 2.30.1-3/debian/seahorse.Xsession 2.30.1-3ubuntu3/debian/seahorse.Xsession
--- 2.30.1-3/debian/seahorse.Xsession	2009-05-10 18:28:34.000000000 +0000
+++ 2.30.1-3ubuntu3/debian/seahorse.Xsession	1970-01-01 00:00:00.000000000 +0000
@@ -1,8 +0,0 @@
-# This file is sourced by Xsession(5), not executed.
-
-SEAHORSE=/usr/bin/seahorse-agent
-
-if [ -n "$GNOMERC" ] && [ -x $SEAHORSE ] && [ -z "$GPG_AGENT_INFO" ]; then
-	STARTUP="$SEAHORSE --execute $STARTUP"
-fi
-
diff -pruN 2.30.1-3/libseahorse/seahorse-gpg-options.c 2.30.1-3ubuntu3/libseahorse/seahorse-gpg-options.c
--- 2.30.1-3/libseahorse/seahorse-gpg-options.c	2010-01-25 02:14:21.000000000 +0000
+++ 2.30.1-3ubuntu3/libseahorse/seahorse-gpg-options.c	2011-09-05 13:21:45.000000000 +0000
@@ -32,6 +32,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <glib/gstdio.h>
 
 #include "seahorse-gpgmex.h"
 #include "seahorse-util.h"
@@ -47,22 +48,14 @@ static gboolean gpg_options_inited = FAL
 static gboolean
 create_file (const gchar *file, mode_t mode, GError **err)
 {
-    int fd;
-    g_assert (err && !*err);
-    
-    if ((fd = open (file, O_CREAT | O_TRUNC | O_WRONLY, mode)) == -1) {
-        g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
-                     strerror (errno), NULL);     
-        return FALSE;
+    gchar *contents;
+	const char *skel = "/usr/share/gnupg/options.skel";
+    if (g_file_get_contents(skel, &contents, NULL, err)) {
+        if (g_file_set_contents(file, contents, -1, err)) {
+			g_chmod(file, mode);
+        } 
     }
-
-    /* Write the header when we make a new file */
-    if (write (fd, GPG_CONF_HEADER, strlen (GPG_CONF_HEADER)) == -1) {
-        g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
-                     strerror (errno), NULL);     
-    }
-    
-    close (fd);
+	g_free(contents);
     return *err ? FALSE : TRUE;
 }
 
diff -pruN 2.30.1-3/libseahorse/seahorse-notification.c 2.30.1-3ubuntu3/libseahorse/seahorse-notification.c
--- 2.30.1-3/libseahorse/seahorse-notification.c	2010-02-13 14:36:31.000000000 +0000
+++ 2.30.1-3ubuntu3/libseahorse/seahorse-notification.c	2011-09-05 13:21:45.000000000 +0000
@@ -34,6 +34,11 @@
 
 #ifdef HAVE_LIBNOTIFY
 #include <libnotify/notify.h>
+
+#ifndef NOTIFY_CHECK_VERSION
+#define NOTIFY_CHECK_VERSION(x,y,z) 0
+#endif
+
 #endif
 
 /* -----------------------------------------------------------------------------
@@ -199,7 +204,7 @@ libnotify_closed (NotifyNotification *no
 }
 
 static void
-setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent, 
+setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent,
                               GtkWidget *attachto)
 {
     NotifyNotification *notif;
@@ -212,8 +217,13 @@ setup_libnotify_notification (SeahorseNo
     
     heading = format_key_text (snotif->heading);
     message = format_key_text (snotif->message);
-    
+
+/* libnotify 0.7.0 and later has no support for attaching to widgets */
+#if NOTIFY_CHECK_VERSION(0,7,0)
+    notif = notify_notification_new (heading, message, snotif->icon);
+#else
     notif = notify_notification_new (heading, message, snotif->icon, attachto);
+#endif
     
     g_free (heading);
     g_free (message);
diff -pruN 2.30.1-3/.pc/01_nomenu.patch/plugins/nautilus/seahorse-pgp-preferences.desktop.in 2.30.1-3ubuntu3/.pc/01_nomenu.patch/plugins/nautilus/seahorse-pgp-preferences.desktop.in
--- 2.30.1-3/.pc/01_nomenu.patch/plugins/nautilus/seahorse-pgp-preferences.desktop.in	2010-01-25 02:06:50.000000000 +0000
+++ 2.30.1-3ubuntu3/.pc/01_nomenu.patch/plugins/nautilus/seahorse-pgp-preferences.desktop.in	1970-01-01 00:00:00.000000000 +0000
@@ -1,13 +0,0 @@
-[Desktop Entry]
-_Name=Encryption and Keyrings
-_Comment=Configure key servers and other encryption settings
-Exec=seahorse-preferences
-Terminal=false
-Type=Application
-Icon=seahorse-preferences
-Categories=GNOME;GTK;Settings;X-GNOME-PersonalSettings;
-StartupNotify=true
-X-GNOME-Bugzilla-Bugzilla=GNOME
-X-GNOME-Bugzilla-Product=seahorse
-X-GNOME-Bugzilla-Component=general
-X-GNOME-DocPath=seahorse/seahorse.xml
diff -pruN 2.30.1-3/.pc/01_ubuntu_keyserver.patch/data/seahorse-plugins.schemas.in 2.30.1-3ubuntu3/.pc/01_ubuntu_keyserver.patch/data/seahorse-plugins.schemas.in
--- 2.30.1-3/.pc/01_ubuntu_keyserver.patch/data/seahorse-plugins.schemas.in	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/.pc/01_ubuntu_keyserver.patch/data/seahorse-plugins.schemas.in	2010-01-25 02:06:50.000000000 +0000
@@ -0,0 +1,192 @@
+<gconfschemafile>
+	<schemalist>
+		<schema>
+			<key>/schemas/apps/seahorse/agent/cache_enabled</key>
+			<applyto>/apps/seahorse/agent/cache_enabled</applyto>
+			<owner>seahorse</owner>
+			<type>bool</type>
+			<default>TRUE</default>
+			<locale name="C">
+				<short>Whether the GPG password cache is enabled</short>
+				<long>This option enables the GPG password cache in the 
+				seahorse-agent program. The 'use-agent' setting in gpg.conf
+				affects this setting.</long>
+			</locale>
+		</schema>
+        <schema>
+            <key>/schemas/apps/seahorse/agent/cache_method</key>
+            <applyto>/apps/seahorse/agent/cache_method</applyto>
+            <owner>seahorse</owner>
+            <type>string</type>
+            <default>internal</default>
+            <locale name="C">
+                <short>Where to store cached passwords.</short>
+                <long>If set to 'gnome' uses gnome-keyring to cache passwords. 
+                When set to 'internal' uses internal cache.</long>
+            </locale>
+        </schema>
+		<schema>
+			<key>/schemas/apps/seahorse/agent/cache_expire</key>
+			<applyto>/apps/seahorse/agent/cache_expire</applyto>
+			<owner>seahorse</owner>
+			<type>bool</type>
+			<default>TRUE</default>
+			<locale name="C">
+				<short>Expire passwords in the cache</short>
+				<long>When set, seahorse-agent expires GPG passwords in 
+				its cache after a period of time. </long>
+			</locale>
+		</schema>
+		<schema>
+			<key>/schemas/apps/seahorse/agent/cache_ttl</key>
+			<applyto>/apps/seahorse/agent/cache_ttl</applyto>
+			<owner>seahorse</owner>
+			<type>int</type>
+			<default>300</default>
+			<locale name="C">
+				<short>The time (in minutes) to cache GPG passwords</short>
+				<long>This is the amount of time, specified in minutes,
+				to cache GPG passwords in seahorse-agent. </long>
+			</locale>
+		</schema>
+		<schema>
+			<key>/schemas/apps/seahorse/agent/cache_authorize</key>
+			<applyto>/apps/seahorse/agent/cache_authorize</applyto>
+			<owner>seahorse</owner>
+			<type>bool</type>
+			<default>TRUE</default>
+			<locale name="C">
+				<short>Prompt before using GPG passwords in cache</short>
+				<long>Set to 'true' to have seahorse-agent prompt before
+				giving out passwords it has cached.</long>
+			</locale>
+		</schema>
+        <schema>
+            <key>/schemas/apps/seahorse/agent/cache_display</key>
+            <applyto>/apps/seahorse/agent/cache_display</applyto>
+            <owner>seahorse</owner>
+            <type>bool</type>
+            <default>FALSE</default>
+            <locale name="C">
+                <short>Display cache reminder in the notification area</short>
+                <long>Set to 'true' to enable display of the cache reminder in the
+                notification area of your panel.</long>
+            </locale>
+        </schema> 
+    </schemalist>
+    <schemalist>
+        <schema>
+            <key>/schemas/apps/seahorse/applet/show_clipboard_state</key>
+            <applyto>/apps/seahorse/applet/show_clipboard_state</applyto>
+            <owner>seahorse</owner>
+            <type>bool</type>
+            <default>FALSE</default>
+            <locale name="C">
+                <short>Show clipboard state in panel</short>
+                <long>Reflect the contents of the clipboard (whether encrypted, 
+                signed, etc...) in the panel applet icon.</long>
+            </locale>
+        </schema>
+        <schema>
+            <key>/schemas/apps/seahorse/applet/display_encrypted_clipboard</key>
+            <applyto>/apps/seahorse/applet/display_encrypted_clipboard</applyto>
+            <owner>seahorse</owner>
+            <type>bool</type>
+            <default>TRUE</default>
+            <locale name="C">
+                <short>Display clipboard after encrypting</short>
+                <long>After performing an encrypt or signing operation from the applet,
+                display the resulting text in a window.</long>
+            </locale>
+        </schema>
+        <schema>
+            <key>/schemas/apps/seahorse/applet/display_decrypted_clipboard</key>
+            <applyto>/apps/seahorse/applet/display_decrypted_clipboard</applyto>
+            <owner>seahorse</owner>
+            <type>bool</type>
+            <default>FALSE</default>
+            <locale name="C">
+                <short>Display clipboard after decrypting</short>
+                <long>After performing an decrypt or verify operation from the applet,
+                display the resulting text in a window.</long>
+            </locale>
+        </schema>
+    </schemalist>
+	<schemalist>
+		<schema>
+			<key>/schemas/desktop/pgp/ascii_armor</key>
+			<applyto>/desktop/pgp/ascii_armor</applyto>
+			<owner>seahorse</owner>
+			<type>bool</type>
+			<default>FALSE</default>
+			<locale name="C">
+				<short>Whether to use ASCII Armor</short>
+				<long>If set to true, then files encrypted with seahorse
+                will be ASCII armor encoded.</long>
+			</locale>
+		</schema>
+		<schema>
+			<key>/schemas/desktop/pgp/default_key</key>
+			<applyto>/desktop/pgp/default_key</applyto>
+			<owner>seahorse</owner>
+			<type>string</type>
+			<default></default>
+			<locale name="C">
+				<short>ID of the default key</short>
+				<long>This specifies the default key to use for
+				certain operations, mainly signing.</long>
+			</locale>
+		</schema>
+		<schema>
+			<key>/schemas/desktop/pgp/encrypt_to_self</key>
+			<applyto>/desktop/pgp/encrypt_to_self</applyto>
+			<owner>seahorse</owner>
+			<type>bool</type>
+			<default>FALSE</default>
+			<locale name="C">
+				<short>Whether to always encrypt to default key</short>
+				<long>If set to true, then the default key will
+				always be added to an encryption recipients list.</long>
+			</locale>
+		</schema>
+        <schema>
+            <key>/schemas/desktop/pgp/last_signer</key>
+            <applyto>/desktop/pgp/last_signer_openpgp</applyto>
+            <applyto>/desktop/pgp/last_signer_openssh</applyto>
+            <owner>seahorse</owner>
+            <type>string</type>
+            <default></default>
+            <locale name="C">
+                <short>Last key used to sign a message.</short>
+                <long>The ID of the last secret key used to sign a message.</long>
+            </locale>
+        </schema>
+        <schema>
+            <key>/schemas/desktop/pgp/recipients/sort_by</key>
+            <applyto>/desktop/pgp/recipients/sort_by</applyto>
+            <owner>seahorse</owner>
+            <type>string</type>
+            <default>name</default>
+            <locale name="C">
+                <short>The column to sort the recipients by</short>
+                <long>Specify the column to sort the recipients window by. 
+                Columns are: 'name' and 'id'. Put a '-' in front of the 
+                column name to sort in descending order.</long>
+            </locale>
+        </schema>
+		<schema>
+			<key>/schemas/desktop/pgp/keyservers/all_keyservers</key>
+			<applyto>/desktop/pgp/keyservers/all_keyservers</applyto>
+			<owner>seahorse</owner>
+			<type>list</type>
+			<list_type>string</list_type>
+			<default>[hkp://pgp.mit.edu:11371,ldap://keyserver.pgp.com]</default>
+			<locale name="C">
+				<short>PGP Key servers</short>
+				<long>A list of key server URIs to search for remote PGP keys.
+				In later versions a display name can be included, by appending a 
+				space and then the name.</long>
+			</locale>
+		</schema>
+	</schemalist>
+</gconfschemafile>
diff -pruN 2.30.1-3/.pc/02_copy_gpg_conf_skeleton.patch/libseahorse/seahorse-gpg-options.c 2.30.1-3ubuntu3/.pc/02_copy_gpg_conf_skeleton.patch/libseahorse/seahorse-gpg-options.c
--- 2.30.1-3/.pc/02_copy_gpg_conf_skeleton.patch/libseahorse/seahorse-gpg-options.c	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/.pc/02_copy_gpg_conf_skeleton.patch/libseahorse/seahorse-gpg-options.c	2010-01-25 02:14:21.000000000 +0000
@@ -0,0 +1,551 @@
+/*
+ * Seahorse
+ *
+ * Copyright (C) 2003 Stefan Walter
+ *
+ * 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 should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+
+#include <sys/param.h>
+#include <sys/wait.h>
+#include <sys/file.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <gpgme.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#include "seahorse-gpgmex.h"
+#include "seahorse-util.h"
+#include "seahorse-gpg-options.h"
+
+#define  GPG_CONF_HEADER    "# FILE CREATED BY SEAHORSE\n\n"
+#define  GPG_VERSION_PREFIX1   "1."
+#define  GPG_VERSION_PREFIX2   "2."
+
+static gchar *gpg_homedir;
+static gboolean gpg_options_inited = FALSE;
+
+static gboolean
+create_file (const gchar *file, mode_t mode, GError **err)
+{
+    int fd;
+    g_assert (err && !*err);
+    
+    if ((fd = open (file, O_CREAT | O_TRUNC | O_WRONLY, mode)) == -1) {
+        g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
+                     strerror (errno), NULL);     
+        return FALSE;
+    }
+
+    /* Write the header when we make a new file */
+    if (write (fd, GPG_CONF_HEADER, strlen (GPG_CONF_HEADER)) == -1) {
+        g_set_error (err, G_IO_CHANNEL_ERROR, g_io_channel_error_from_errno (errno),
+                     strerror (errno), NULL);     
+    }
+    
+    close (fd);
+    return *err ? FALSE : TRUE;
+}
+
+/* Finds relevant configuration file, creates if not found */
+static gchar *
+find_config_file (gboolean read, GError **err)
+{
+    gchar *conf = NULL;
+
+    g_assert (gpg_options_inited);
+    g_assert (!err || !*err);
+
+    if (!gpg_homedir)
+        return NULL;
+
+    /* Check for and open ~/.gnupg/gpg.conf */
+    conf = g_strconcat (gpg_homedir, "/gpg.conf", NULL);
+    if (g_file_test (conf, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS)) 
+        return conf;
+    g_free (conf);
+    
+    /* Check for and open ~/.gnupg/options */
+    conf = g_strconcat (gpg_homedir, "/options", NULL);
+    if (g_file_test (conf, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_EXISTS)) 
+        return conf;
+    g_free (conf);
+
+    /* Make sure directory exists */
+    if (!g_file_test (gpg_homedir, G_FILE_TEST_EXISTS)) {
+        if (mkdir (gpg_homedir, 0700) == -1) {
+            g_set_error (err, G_IO_CHANNEL_ERROR, 
+                         g_io_channel_error_from_errno (errno),
+                         strerror (errno), NULL);     
+            return NULL;
+        }
+    }
+
+    /* For writers just return the file name */
+    conf = g_strconcat (gpg_homedir, "/gpg.conf", NULL);
+    if (!read)
+        return conf;
+
+    /* ... for readers we create ~/.gnupg/gpg.conf */
+    if (create_file (conf, 0600, err))
+        return conf;
+    g_free (conf);
+
+    return NULL;
+}
+
+static GArray*
+read_config_file (GError **err)
+{
+    GError *e = NULL;
+    gboolean ret;
+    GArray *array;
+    gchar *conf, *contents;
+    gchar **lines, **l;
+
+    g_assert (!err || !*err);
+    if (!err)
+        err = &e;
+    
+    conf = find_config_file (TRUE, err);
+    if (conf == NULL)
+        return NULL;
+    
+    ret = g_file_get_contents (conf, &contents, NULL, err);
+    g_free (conf);
+    
+    if (!ret)
+        return FALSE;
+        
+    lines = g_strsplit (contents, "\n", -1);
+    g_free (contents);
+    
+    array = g_array_new (TRUE, TRUE, sizeof (gchar**));
+    for (l = lines; *l; l++)
+        g_array_append_val (array, *l);
+    
+    /* We took ownership of the individual lines */
+    g_free (lines);
+    return array;
+}    
+
+static gboolean
+write_config_file (GArray *array, GError **err)
+{
+    GError *e = NULL;
+    gchar *conf, *contents;
+
+    g_assert (!err || !*err);
+    if (!err)
+        err = &e;
+    
+    conf = find_config_file (FALSE, err);
+    if (conf == NULL)
+        return FALSE;
+
+    contents = g_strjoinv ("\n", (gchar**)(array->data));
+    seahorse_util_write_file_private (conf, contents, err);
+    g_free (contents);
+
+    return *err ? FALSE : TRUE;
+}
+
+static void
+free_string_array (GArray *array)
+{
+    gchar** lines = (gchar**)g_array_free (array, FALSE);
+    g_strfreev (lines);
+}
+
+#define HOME_PREFIX "\nHome: "
+
+/* Discovers .gnupg home directory by running gpg */
+static gboolean
+parse_home_directory (gpgme_engine_info_t engine, GError **err)
+{
+    gboolean found = FALSE;
+    gchar *sout = NULL;
+    gchar *serr = NULL;
+    gchar *t;
+    gchar *x;
+    gint status;
+    gboolean b;
+
+    g_assert (engine);
+    g_assert (engine->file_name);
+
+    /* We run /usr/bin/gpg --version */
+    t = g_strconcat (engine->file_name, " --version", NULL);
+    b = g_spawn_command_line_sync (t, &sout, &serr, &status, err);
+    g_free (t);
+
+    if (b) {
+        if (sout && WIFEXITED (status) && WEXITSTATUS (status) == 0) {
+            /* Look for Home: */
+            t = strstr (sout, HOME_PREFIX);
+            if (t != NULL) {
+                t += strlen (HOME_PREFIX);
+                x = strchr (t, '\n');
+                if (x != NULL && x != t) {
+                    *x = 0;
+                    g_strstrip (t);
+
+                    g_free (gpg_homedir);
+
+                    /* If it's not a rooted path then expand */
+                    if (t[0] == '~') {
+                        gpg_homedir = g_strconcat (g_get_home_dir(), ++t, NULL);
+                    } else {
+                        gpg_homedir = g_strdup (t);
+                    }
+                    found = TRUE;
+                }
+            }
+        }
+
+        if (!found)
+            b = FALSE;
+    }
+
+    if (sout)
+        g_free (sout);
+    if (serr)
+        g_free (serr);
+
+    return b;
+}
+
+/* Initializes the gpg-options static info */
+static gboolean
+gpg_options_init (GError **err)
+{
+    if (!gpg_options_inited) {
+        gpgme_error_t gerr;
+        gpgme_engine_info_t engine;
+
+        gerr = gpgme_get_engine_info (&engine);
+        g_return_val_if_fail (GPG_IS_OK (gerr),
+                              (seahorse_util_gpgme_to_error (gerr, err), FALSE));
+
+        /* Look for the OpenPGP engine */
+        while (engine && engine->protocol != GPGME_PROTOCOL_OpenPGP)
+            engine = engine->next;
+
+        /* 
+         * Make sure it's the right version for us to be messing 
+         * around with the configuration file.
+         */
+        g_return_val_if_fail (engine && engine->version && engine->file_name &&
+                              (g_str_has_prefix (engine->version, GPG_VERSION_PREFIX1) ||
+                               g_str_has_prefix (engine->version, GPG_VERSION_PREFIX2)),
+                              (seahorse_util_gpgme_to_error (GPG_E (GPG_ERR_INV_ENGINE), err), FALSE));
+
+        /* Now run the binary and read in the home directory */
+        if (!parse_home_directory (engine, err))
+            return FALSE;
+
+        gpg_options_inited = TRUE;
+    }
+
+    return TRUE;
+}
+
+/**
+ * seahorse_gpg_homedir
+ * 
+ * Returns: The home dir that GPG uses for it's keys and configuration
+ **/
+const gchar*
+seahorse_gpg_homedir ()
+{
+    /* THis shouldn't normally fail, and as such we return an invalid 
+     * directory to avoid NULL memory access */
+    g_return_val_if_fail (gpg_options_init (NULL), "/invalid/gpg/dir");
+    return gpg_homedir;
+}
+
+/**
+ * seahorse_gpg_options_find
+ * 
+ * @option: The option to find
+ * @value: Returns the value, or NULL when not found
+ * @err: Returns an error value when errors
+ * 
+ * Find the value for a given option in the gpg config file.
+ * Values without a value are returned as an empty string.
+ * On success be sure to free *value after you're done with it. 
+ * 
+ * Returns: TRUE if success, FALSE if not
+ **/
+gboolean
+seahorse_gpg_options_find (const gchar *option, gchar **value, GError **err)
+{
+    const gchar *options[2];
+
+    options[0] = option;
+    options[1] = NULL;
+
+    return seahorse_gpg_options_find_vals (options, value, err);
+}
+
+/**
+ * seahorse_gpg_options_find_vals
+ * 
+ * @option: null terminated array of option names
+ * @value: An array of pointers for return values 
+ * @err: Returns an error value when errors
+ * 
+ * Find the value for a given options in the gpg config file.
+ * Values without a value are returned as an empty string.
+ * On success be sure to free all *value after you're done 
+ * with them. values should be at least as big as options
+ * 
+ * Returns: TRUE if success, FALSE if not
+ **/
+gboolean
+seahorse_gpg_options_find_vals (const gchar *options[], gchar *values[],
+                                GError **err)
+{
+    GError *e = NULL;
+    GArray *lines;
+    const gchar **opt;
+    gchar *line;
+    gchar *t;
+    guint i, j;
+    
+    g_assert (!err || !*err);
+    if (!err)
+        err = &e;
+
+    if (!gpg_options_init (err))
+        return FALSE;
+    
+    lines = read_config_file (err);
+    if (!lines)
+        return FALSE;
+
+    /* Clear out all values */
+    for (i = 0, opt = options; *opt != NULL; opt++, i++)
+        values[i] = NULL;
+
+    for (j = 0; j < lines->len; j++) {
+        line = g_array_index (lines, gchar*, j);
+        g_assert (line != NULL);        
+
+        g_strstrip (line);
+
+        /* Ignore comments and blank lines */
+        if (line[0] != '#' && line[0] != 0) {
+            for (i = 0, opt = options; *opt != NULL; opt++, i++) {
+                if (g_str_has_prefix (line, *opt)) {
+                    t = line + strlen (*opt);
+                    if (t[0] == 0 || g_ascii_isspace (t[0])) {
+                        /* 
+                         * We found a value. Fill it in. The caller
+                         * frees this stuff. Note that we don't short 
+                         * circuit the search because for gpg options 
+                         * can be specified multiple times, and the 
+                         * last one wins.
+                         */
+
+                        g_free (values[i]);
+                        values[i] = g_strdup (t);
+                        g_strstrip (values[i]);
+                        break;  /* Done with this line */
+                    }
+                }
+            }
+        }
+    }
+
+    free_string_array (lines);
+
+    return *err ? FALSE : TRUE;
+}
+
+/* Figure out needed changes to configuration file */
+static void
+process_conf_edits (GArray *lines, const gchar *options[], gchar *values[])
+{
+    gboolean comment;
+    gchar *t;
+    gchar *n;
+    gchar *line;
+    gsize length;
+    guint i, j;
+
+    for (j = 0; j < lines->len; j++) {
+        line = g_array_index (lines, gchar*, j);
+        g_assert (line != NULL);        
+        length = strlen(line);
+        
+        /* 
+         * Does this line have an ending? 
+         * We use this below when appending lines.
+         */
+        n = line;
+
+        /* Don't use g_strstrip as we don't want to modify the line */
+        while (*n && g_ascii_isspace (*n))
+            n++;
+
+        /* Ignore blank lines */
+        if (n[0] != 0) {
+            comment = FALSE;
+
+            /* We look behind comments to see if we need to uncomment them */
+            if (n[0] == '#') {
+                n++;
+                comment = TRUE;
+
+                while (*n && g_ascii_isspace (*n))
+                    n++;
+            }
+
+            for (i = 0; options[i] != NULL; i++) {
+                if (!g_str_has_prefix (n, options[i]))
+                    continue;
+
+                t = n + strlen (options[i]);
+                if (t[0] != 0 && !g_ascii_isspace (t[0]))
+                    continue;
+
+                /* Are we setting this value? */
+                if (values[i]) {
+                    /* At this point we're rewriting the line, so we 
+                     * can modify the old line */
+                    *t = 0;
+
+                    /* A line with a value */
+                    if (values[i][0])
+                        n = g_strconcat (n, " ", values[i], NULL);
+
+                    /* A setting without a value */
+                    else
+                        n = g_strdup (n);
+
+                    /* 
+                     * We're done with this option, all other instances
+                     * of it need to be commented out 
+                     */
+                    values[i] = NULL;
+                }
+
+                /* Otherwise we're removing the value */
+                else if (!comment) {
+                    n = g_strconcat ("# ", n, NULL);
+                }
+
+                line = n;
+
+                /* Done with this line */
+                break;
+            }
+        }
+
+        if (g_array_index (lines, gchar*, j) != line) {
+            g_free (g_array_index (lines, gchar*, j));
+            g_array_index (lines, gchar*, j) = line;
+        }
+    }
+
+    /* Append any that haven't been added but need to */
+    for (i = 0; options[i] != NULL; i++) {
+        /* Are we setting this value? */
+        if (values[i]) {
+
+            /* A line with a value */
+            if (values[i][0])
+                n = g_strconcat (options[i], " ", values[i], NULL);
+
+            /* A setting without a value */
+            else
+                n = g_strdup (options[i]);
+
+            g_array_append_val (lines, n);
+        }
+    }
+}
+
+/**
+ * seahorse_gpg_options_change
+ * 
+ * @option: The option to change
+ * @value: The value to change it to
+ * @err: Returns an error value when errors
+ * 
+ * Changes the given option in the gpg config file.
+ * If value is NULL, the option will be deleted. If you want
+ * an empty value, set value to an empty string. 
+ * 
+ * Returns: TRUE if success, FALSE if not
+ **/
+gboolean
+seahorse_gpg_options_change (const gchar *option, const gchar *value,
+                             GError **err)
+{
+    const gchar *options[2];
+
+    options[0] = option;
+    options[1] = NULL;
+
+    return seahorse_gpg_options_change_vals (options, (gchar **)&value, err);
+}
+
+/**
+ * seahorse_gpg_options_change_vals
+ * 
+ * @option: null-terminated array of option names to change
+ * @value: The values to change respective option to
+ * @err: Returns an error value when errors
+ * 
+ * Changes the given option in the gpg config file.
+ * If a value is NULL, the option will be deleted. If you want
+ * an empty value, set value to an empty string. 
+ * 
+ * Returns: TRUE if success, FALSE if not
+ **/
+gboolean
+seahorse_gpg_options_change_vals (const gchar *options[], gchar *values[],
+                                  GError **err)
+{
+    GError *e = NULL;
+    GArray *lines;
+
+    g_assert (!err || !*err);
+    if (!err)
+        err = &e;
+
+    if (!gpg_options_init (err))
+        return FALSE;
+
+    lines = read_config_file (err);
+    if (!lines)
+        return FALSE;
+
+    process_conf_edits (lines, options, values);
+    
+    write_config_file (lines, err);
+    free_string_array (lines);
+    
+    return *err ? FALSE : TRUE;
+}
diff -pruN 2.30.1-3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent.c 2.30.1-3ubuntu3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent.c
--- 2.30.1-3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent.c	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent.c	2010-01-25 02:06:50.000000000 +0000
@@ -0,0 +1,168 @@
+/*
+ * Seahorse
+ *
+ * Copyright (C) 2004 Stefan Walter
+ *
+ * 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 should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/signal.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <err.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <fcntl.h>
+
+#include "seahorse-agent.h"
+#include "seahorse-gpg-options.h"
+#include "seahorse-passphrase.h"
+
+gboolean seahorse_agent_cshell = FALSE;
+gboolean seahorse_agent_execvars = FALSE;
+
+static gboolean seahorse_agent_enabled = FALSE;
+
+/* PUBLISHING AGENT INFO ---------------------------------------------------- */
+
+/* Print out the socket name info: <name>:<pid>:<protocol_version> */
+static void
+process_display (const gchar *socket, pid_t pid)
+{
+    if (seahorse_agent_cshell) {
+        fprintf (stdout, "setenv GPG_AGENT_INFO %s:%lu:1\n",
+                 socket, (long unsigned int) pid);
+    } else {
+        fprintf (stdout, "GPG_AGENT_INFO=%s:%lu:1; export GPG_AGENT_INFO\n",
+                 socket, (long unsigned int) pid);
+    }
+
+    fflush (stdout);
+}
+
+static void 
+process_setenv (const gchar *socket, pid_t pid)
+{
+    gchar *var;
+
+    /* Memory doesn't need to be freed */
+    var = g_strdup_printf ("%s:%lu:1", socket, (long unsigned int) pid);
+    g_setenv ("GPG_AGENT_INFO", var, TRUE);
+}
+
+/* 
+ * Called before forking as a daemon, creates the GPG agent 
+ * socket. This socket path needs to be present and decided
+ * on before the fork.
+ */
+void
+seahorse_agent_prefork ()
+{
+    /* Detect and see if there's an agent */
+    switch (seahorse_passphrase_detect_agent ()) {
+    case SEAHORSE_AGENT_NONE:
+        break;
+    default:
+        g_message ("Another GPG agent already running\n");
+        return;
+    }
+    
+    seahorse_agent_enabled = TRUE;
+    if (seahorse_agent_io_socket () == -1)
+        _exit (1); /* Message already printed */
+}
+
+/* 
+ * Called after forking off the agent daemon child. At this 
+ * point we communicate the socket path to the environment
+ * as requested.
+ */
+void
+seahorse_agent_postfork (pid_t child)
+{
+    const gchar *socket;
+
+    if(!seahorse_agent_enabled)
+        return;
+    
+    socket = seahorse_agent_io_get_socket ();
+    g_return_if_fail (socket != NULL);
+    
+    /* If any of these fail, they simply exit */
+    if(seahorse_agent_execvars)
+        process_setenv (socket, child);
+    else 
+        process_display (socket, child);
+}
+
+/* 
+ * Called when we run another program (such as seahorse-preferences)
+ * to setup the environment appropriately for that process.
+ */
+void 
+seahorse_agent_childsetup ()
+{
+    const gchar *socket = seahorse_agent_io_get_socket ();
+    g_return_if_fail (socket != NULL);
+
+    process_setenv (socket, getpid ());
+}
+
+gboolean
+seahorse_agent_init ()
+{
+    if(!seahorse_agent_enabled)
+        return TRUE;
+    
+    if (seahorse_agent_io_init () == -1)
+        return FALSE;           /* message already printed */
+    
+    /* Initialize our sub systems */
+    seahorse_agent_actions_init ();
+    seahorse_agent_cache_init ();
+    seahorse_agent_status_init ();
+    
+    return TRUE;
+}
+
+gboolean
+seahorse_agent_uninit (gpointer *data)
+{
+    if(!seahorse_agent_enabled)
+        return FALSE;
+
+    /* If any windows are open this closes them */
+    seahorse_agent_prompt_cleanup ();
+    seahorse_agent_status_cleanup ();
+
+    /* Uninitialize all subsystems */
+    seahorse_agent_cache_uninit ();
+    seahorse_agent_actions_uninit ();
+    seahorse_agent_io_uninit ();
+    
+    return FALSE;
+}
+
+void
+seahorse_agent_exit ()
+{
+    seahorse_agent_uninit (NULL);
+}
diff -pruN 2.30.1-3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent.h 2.30.1-3ubuntu3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent.h
--- 2.30.1-3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent.h	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent.h	2010-01-25 02:06:50.000000000 +0000
@@ -0,0 +1,135 @@
+/*
+ * Seahorse
+ *
+ * Copyright (C) 2004 Stefan Walter
+ *
+ * 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 should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SEAHORSE_AGENT_H__
+#define __SEAHORSE_AGENT_H__
+
+#include <glib.h>
+#include <gconf/gconf-client.h>
+#include <gconf/gconf.h>
+
+#ifndef KL
+#define KL(s)               ((sizeof(s) - 1) / sizeof(s[0]))
+#endif
+
+/* -----------------------------------------------------------------------------
+ * seahorse-agent gconf keys
+ */
+
+#define AGENT_SETTINGS      "/apps/seahorse/agent"
+#define SETTING_CACHE       AGENT_SETTINGS "/cache_enabled"
+#define SETTING_METHOD      AGENT_SETTINGS "/cache_method"
+#define SETTING_TTL         AGENT_SETTINGS "/cache_ttl"
+#define SETTING_EXPIRE      AGENT_SETTINGS "/cache_expire"
+#define SETTING_AUTH        AGENT_SETTINGS "/cache_authorize"
+#define SETTING_DISPLAY     AGENT_SETTINGS "/cache_display"
+#define METHOD_GNOME        "gnome"
+
+/* -----------------------------------------------------------------------------
+ * seahorse-agent.c
+ */
+
+/* Called from the original process before and after fork */
+void seahorse_agent_prefork ();
+void seahorse_agent_postfork (pid_t child);
+void seahorse_agent_childsetup ();
+
+/* Called in the new child process */
+gboolean seahorse_agent_init ();
+gboolean seahorse_agent_uninit (gpointer *data);
+void     seahorse_agent_exit ();
+
+/* Global options to set from the command line */
+extern gboolean seahorse_agent_cshell;
+extern gboolean seahorse_agent_execvars;
+extern gboolean seahorse_agent_any_display;
+
+/* -----------------------------------------------------------------------------
+ * seahorse-agent-io.c
+ */
+
+struct _SeahorseAgentConn;
+typedef struct _SeahorseAgentConn SeahorseAgentConn;
+
+int seahorse_agent_io_socket ();
+const gchar* seahorse_agent_io_get_socket ();
+int seahorse_agent_io_init ();
+void seahorse_agent_io_uninit ();
+void seahorse_agent_io_reply (SeahorseAgentConn *rq, gboolean ok, const gchar *response);
+void seahorse_agent_io_data (SeahorseAgentConn *cn, const gchar *data);
+
+/* -----------------------------------------------------------------------------
+ * seahorse-agent-actions.c
+ */
+
+#define SEAHORSE_AGENT_PASS_AS_DATA    0x00000001
+#define SEAHORSE_AGENT_REPEAT          0x00000002
+
+typedef struct _SeahorseAgentPassReq {
+    const gchar *id;
+    const gchar *errmsg;
+    const gchar *prompt;
+    const gchar *description;
+    SeahorseAgentConn *request;
+    guint32 flags;
+} SeahorseAgentPassReq;
+
+void seahorse_agent_actions_init ();
+void seahorse_agent_actions_uninit ();
+void seahorse_agent_actions_getpass (SeahorseAgentConn *rq, guint32 flags, gchar *id,
+                                     gchar *errmsg, gchar *prompt, gchar *desc);
+void seahorse_agent_actions_clrpass (SeahorseAgentConn *rq, gchar *id);
+void seahorse_agent_actions_doneauth (SeahorseAgentPassReq *pr, gboolean authorized);
+void seahorse_agent_actions_donepass (SeahorseAgentPassReq *pr, const gchar *pass);
+void seahorse_agent_actions_nextgui ();
+
+/* -----------------------------------------------------------------------------
+ * seahorse-agent-cache.c
+ */
+
+void seahorse_agent_cache_init ();
+void seahorse_agent_cache_uninit ();
+const gchar *seahorse_agent_cache_get (const gchar *id);
+void seahorse_agent_cache_set (const gchar *id, const gchar *pass, gboolean lock);
+gboolean seahorse_agent_cache_has (const gchar *id, gboolean lock);
+void seahorse_agent_cache_clear (const gchar *id);
+void seahorse_agent_cache_clearall ();
+guint seahorse_agent_cache_count ();
+GList* seahorse_agent_cache_get_key_names ();
+
+/* -----------------------------------------------------------------------------
+ * seahorse-agent-prompt.c
+ */
+
+gboolean seahorse_agent_prompt_have ();
+void seahorse_agent_prompt_pass (SeahorseAgentPassReq *pr);
+void seahorse_agent_prompt_auth (SeahorseAgentPassReq *pr);
+void seahorse_agent_prompt_cleanup ();
+
+/* -----------------------------------------------------------------------------
+ * seahorse-agent-status.c
+ */
+
+void seahorse_agent_status_init ();
+void seahorse_agent_status_cleanup ();
+void seahorse_agent_status_update ();
+
+#endif /* __SEAHORSE_AGENT_H__ */
diff -pruN 2.30.1-3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent-main.c 2.30.1-3ubuntu3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent-main.c
--- 2.30.1-3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent-main.c	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/.pc/03_dont_crash_on_exit.patch/agent/seahorse-agent-main.c	2010-01-25 02:06:50.000000000 +0000
@@ -0,0 +1,289 @@
+/*
+ * Seahorse
+ *
+ * Copyright (C) 2006 Stefan Walter
+ *
+ * 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 should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#include "config.h"
+
+#include <sys/types.h>
+#include <sys/signal.h>
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <err.h>
+#include <unistd.h>
+#include <syslog.h>
+#include <fcntl.h>
+#include <string.h>
+#include <errno.h>
+  
+#include <glib/gi18n.h>
+
+#include "seahorse-gtkstock.h"
+#include "seahorse-gconf.h"
+#include "seahorse-agent.h"
+#include "seahorse-unix-signal.h"
+#include "seahorse-secure-memory.h"
+
+static gboolean display_vars_dummy = TRUE;
+static gboolean agent_no_daemonize = FALSE;
+static gboolean agent_running = FALSE;
+static gboolean agent_quit = FALSE;
+static gchar **agent_exec_args = NULL;
+
+static const GOptionEntry options[] = {
+    { "no-daemonize", 'd', 0, G_OPTION_ARG_NONE, &agent_no_daemonize, 
+        N_("Do not daemonize seahorse-agent"), NULL },
+
+    /* TRANSLATORS: An example of a 'C type shell' is 'csh' often used by *BSD instead of bash */
+    { "cshell", 'c', 0, G_OPTION_ARG_NONE, &seahorse_agent_cshell, 
+        N_("Print variables in for a C type shell"), NULL },
+
+    /* This is the default but is kept here for backward compatibility */
+    { "variables", 'v', 0, G_OPTION_ARG_NONE, &display_vars_dummy, 
+        N_("Display environment variables (the default)"), NULL },
+
+    { "execute", 'x', 0, G_OPTION_ARG_NONE, &seahorse_agent_execvars, 
+        N_("Execute other arguments on the command line"), NULL },
+      
+    /* TRANSLATORS: A 'display' is a an X display */
+    { "any-display", 'A', 0, G_OPTION_ARG_NONE, &seahorse_agent_any_display, 
+        N_("Allow GPG agent request from any display"), NULL },
+      
+    { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &agent_exec_args, 
+        NULL, N_("command...") },
+
+    { NULL }
+};
+
+static int
+set_cloexec_flag (int fd)
+{
+    int oldflags;
+    
+    oldflags = fcntl (fd, F_GETFD, 0);
+    /* If reading the flags failed, return error indication now.*/
+    if (oldflags < 0)
+    return oldflags;
+    /* Set just the flag we want to set. */
+    oldflags |= FD_CLOEXEC;
+
+    /* Store modified flag word in the descriptor. */
+    return fcntl (fd, F_SETFD, oldflags);
+}
+
+static void
+daemonize (gchar **exec)
+{
+    /* 
+     * We can't use the normal daemon call, because we have
+     * special things to do in the parent after forking 
+     */
+
+    pid_t pid;
+    int i, fd;
+
+    if (agent_no_daemonize) {
+        pid = getpid ();
+
+    } else {
+        switch ((pid = fork ())) {
+        case -1:
+            err (1, _("couldn't fork process"));
+            break;
+
+        /* The child */
+        case 0:
+            if (setsid () == -1)
+                err (1, _("couldn't create new process group"));
+
+            /* Close std descriptors */
+            for (i = 0; i <= 2; i++)
+                close (i);
+            
+            /* Open stdin, stdout and stderr. GPGME doesn't work without this */
+            fd = open ("/dev/null", O_RDONLY, 0666);
+            if (set_cloexec_flag (fd) < 0)
+                g_warning ("can't set close-on-exec flag: %s", strerror (errno));
+                
+            fd = open ("/dev/null", O_WRONLY, 0666);
+            if (set_cloexec_flag (fd) < 0)
+                g_warning ("can't set close-on-exec flag: %s", strerror (errno));
+                
+            fd = open ("/dev/null", O_WRONLY, 0666);
+            if (set_cloexec_flag (fd) < 0)
+                g_warning ("can't set close-on-exec flag: %s", strerror (errno));
+            
+            chdir ("/tmp");
+            return; /* Child process returns */
+        };
+    }
+
+    /* The parent process or not daemonizing ... */
+
+    /* Let the agent do it's thing */
+    seahorse_agent_postfork (pid);
+    
+    if (agent_no_daemonize) {
+
+        /* We can't overlay our process with the exec one if not daemonizing */
+        if (exec && exec[0])
+            g_warning ("cannot execute process when not daemonizing: %s", exec[0]);    
+
+    } else {
+
+        /* If we were asked to exec another program, do that here */
+        if (!exec || !exec[0])
+            exit (0);
+
+        execvp (exec[0], (char**)exec);
+	    g_critical ("couldn't exec %s: %s\n", exec[0], g_strerror (errno));
+	    exit (1);
+
+    }
+}
+
+static void
+unix_signal (int signal)
+{
+    agent_quit = TRUE;
+    if (agent_running)
+        gtk_main_quit ();
+}
+
+static void
+log_handler (const gchar *log_domain, GLogLevelFlags log_level, 
+             const gchar *message, gpointer user_data)
+{
+    int level;
+
+    /* Note that crit and err are the other way around in syslog */
+        
+    switch (G_LOG_LEVEL_MASK & log_level) {
+    case G_LOG_LEVEL_ERROR:
+        level = LOG_CRIT;
+        break;
+    case G_LOG_LEVEL_CRITICAL:
+        level = LOG_ERR;
+        break;
+    case G_LOG_LEVEL_WARNING:
+        level = LOG_WARNING;
+        break;
+    case G_LOG_LEVEL_MESSAGE:
+        level = LOG_NOTICE;
+        break;
+    case G_LOG_LEVEL_INFO:
+        level = LOG_INFO;
+        break;
+    case G_LOG_LEVEL_DEBUG:
+        level = LOG_DEBUG;
+        break;
+    default:
+        level = LOG_ERR;
+        break;
+    }
+    
+    /* Log to syslog first */
+    if (log_domain)
+        syslog (level, "%s: %s", log_domain, message);
+    else
+        syslog (level, "%s", message);
+ 
+    /* And then to default handler for aborting and stuff like that */
+    g_log_default_handler (log_domain, log_level, message, user_data); 
+}
+
+static void
+prepare_logging ()
+{
+    GLogLevelFlags flags = G_LOG_FLAG_FATAL | G_LOG_LEVEL_ERROR | 
+                G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING | 
+                G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO;
+                
+    openlog ("seahorse-agent", LOG_PID, LOG_AUTH);
+    
+    g_log_set_handler (NULL, flags, log_handler, NULL);
+    g_log_set_handler ("Glib", flags, log_handler, NULL);
+    g_log_set_handler ("Gtk", flags, log_handler, NULL);
+    g_log_set_handler ("Gnome", flags, log_handler, NULL);
+}
+
+int main(int argc, char* argv[])
+{
+    GOptionContext *octx = NULL;
+
+    seahorse_secure_memory_init ();
+    
+    bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+    textdomain (GETTEXT_PACKAGE);
+    
+    octx = g_option_context_new ("");
+    g_option_context_add_main_entries (octx, options, GETTEXT_PACKAGE);
+
+    gtk_init_with_args (&argc, &argv, _("Encryption Key Agent (Seahorse)"), (GOptionEntry *) options, GETTEXT_PACKAGE, NULL);
+
+    gtk_quit_add (0, (GtkFunction) seahorse_agent_uninit, NULL);
+    
+    seahorse_agent_prefork ();
+
+    if (seahorse_agent_execvars && 
+        (!agent_exec_args || !agent_exec_args[0]))
+        errx (2, _("no command specified to execute"));
+
+    /* 
+     * All functions after this point have to print messages 
+     * nicely and not just called exit() 
+     */
+    daemonize (seahorse_agent_execvars ? agent_exec_args : NULL);
+
+    atexit (seahorse_agent_exit);
+
+    g_strfreev (agent_exec_args);
+    agent_exec_args = NULL;
+
+    /* Handle some signals */
+    seahorse_unix_signal_register (SIGINT, unix_signal);
+    seahorse_unix_signal_register (SIGTERM, unix_signal);
+
+    /* Force gconf to reconnect after daemonizing */
+    if (!agent_no_daemonize)
+        seahorse_gconf_disconnect ();    
+    
+    /* We log to the syslog */
+    prepare_logging ();
+
+    /* Insert Icons into Stock */
+    seahorse_gtkstock_init ();
+    
+    if (!seahorse_agent_init ())
+        agent_quit = TRUE;
+    
+    /* Sometimes we've already gotten a quit signal */
+    if(!agent_quit) {
+        agent_running = TRUE;
+        gtk_main ();
+        g_message ("left gtk_main\n");
+    }
+
+    /* And now clean them all up */
+    seahorse_agent_uninit (NULL);
+
+    return 0;
+}
diff -pruN 2.30.1-3/.pc/applied-patches 2.30.1-3ubuntu3/.pc/applied-patches
--- 2.30.1-3/.pc/applied-patches	2011-09-05 13:21:44.000000000 +0000
+++ 2.30.1-3ubuntu3/.pc/applied-patches	2011-09-05 13:21:45.000000000 +0000
@@ -1,2 +1,5 @@
-01_nomenu.patch
+01_ubuntu_keyserver.patch
+02_copy_gpg_conf_skeleton.patch
+03_dont_crash_on_exit.patch
 10_gpgme_crash.patch
+libnotify_0.7.patch
diff -pruN 2.30.1-3/.pc/libnotify_0.7.patch/libseahorse/seahorse-notification.c 2.30.1-3ubuntu3/.pc/libnotify_0.7.patch/libseahorse/seahorse-notification.c
--- 2.30.1-3/.pc/libnotify_0.7.patch/libseahorse/seahorse-notification.c	1970-01-01 00:00:00.000000000 +0000
+++ 2.30.1-3ubuntu3/.pc/libnotify_0.7.patch/libseahorse/seahorse-notification.c	2010-02-13 14:36:31.000000000 +0000
@@ -0,0 +1,690 @@
+/*
+ * Seahorse
+ *
+ * Copyright (C) 2006 Stefan Walter
+ *
+ * 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 should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+ 
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+#include <glib.h>
+#include <string.h>
+
+#include <cryptui.h>
+
+#include "seahorse-gpgmex.h"
+#include "seahorse-libdialogs.h"
+#include "seahorse-util.h"
+
+#ifdef HAVE_LIBNOTIFY
+#include <libnotify/notify.h>
+#endif
+
+/* -----------------------------------------------------------------------------
+ * SEAHORSE NOTIFICATION 
+ */
+ 
+#define SEAHORSE_TYPE_NOTIFICATION            (seahorse_notification_get_type ())
+#define SEAHORSE_NOTIFICATION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), SEAHORSE_TYPE_NOTIFICATION, SeahorseNotification))
+#define SEAHORSE_NOTIFICATION_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), SEAHORSE_TYPE_NOTIFICATION, SeahorseNotificationClass))
+#define SEAHORSE_IS_NOTIFICATION(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SEAHORSE_TYPE_NOTIFICATION))
+#define SEAHORSE_IS_NOTIFICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SEAHORSE_TYPE_NOTIFICATION))
+#define SEAHORSE_NOTIFICATION_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), SEAHORSE_TYPE_NOTIFICATION, SeahorseNotificationClass))
+
+typedef struct _SeahorseNotification {
+    GObject parent;
+
+    gchar *heading;
+    gchar *message;
+    const gchar *icon;
+
+    GList *keyids;
+    GObject *widget;
+    
+} SeahorseNotification;
+
+typedef struct _SeahorseNotificationClass {
+    GObjectClass parent_class;
+} SeahorseNotificationClass;
+
+G_DEFINE_TYPE (SeahorseNotification, seahorse_notification, G_TYPE_OBJECT);
+
+static CryptUIKeyset *keyset = NULL;
+
+/* -----------------------------------------------------------------------------
+ * INTERNAL HELPERS 
+ */
+
+static void
+insert_key_field (GString *res, const gchar *key, const gchar *field)
+{
+    gchar *str, *esc;
+
+
+    /* A default field */
+    if (!field)
+        field = "display-name";
+    
+    str = cryptui_keyset_key_get_string (keyset, key, field);
+    if (str) {
+        esc = g_markup_escape_text (str, -1);
+        g_string_append (res, esc);
+        g_free (esc);
+        g_free (str);
+    }
+}
+
+static void
+format_start_element (GMarkupParseContext *ctx, const gchar *element_name,
+                      const gchar **attribute_names, const gchar **attribute_values,
+                      gpointer user_data, GError **error)
+{
+    GString *res = (GString*)user_data;
+    gchar *t;
+    
+    if (strcmp (element_name, "outer") == 0) 
+        return;
+
+    if (strcmp (element_name, "key") == 0) {
+        
+        const gchar *key = NULL;
+        const gchar *field = NULL;
+        
+        for (; *attribute_names && *attribute_values; attribute_names++, attribute_values++) {
+            if (strcmp (*attribute_names, "id") == 0) 
+                key = *attribute_values;
+            else if (strcmp (*attribute_names, "field") == 0)
+                field = *attribute_values;
+        }
+        
+        if (!key)
+            g_warning ("key text <key> element requires the following attributes\n"
+                       "     <key id=\"xxxxx\" field=\"xxxxx\"/>");
+        else 
+            insert_key_field (res, key, field);
+        
+        return;
+    }
+
+    /* Just pass through any other elements */
+    g_string_append_printf (res, "<%s", element_name);
+    for (; *attribute_names && *attribute_values; attribute_names++, attribute_values++) {
+        t = g_markup_printf_escaped ("%s", *attribute_values);
+        g_string_append_printf (res, " %s=\"%s\"", *attribute_names, t);
+        g_free (t);
+    }
+    g_string_append (res, ">");
+}
+
+static void 
+format_end_element (GMarkupParseContext *ctx, const gchar *element_name, 
+                    gpointer user_data, GError **error)
+{
+    GString *res = (GString*)user_data;
+
+    if (strcmp (element_name, "outer") == 0 || 
+        strcmp (element_name, "key") == 0)
+        return;
+    
+    /* Just pass through any other elements */;
+    g_string_append_printf (res, "</%s>", element_name);
+}
+
+static void 
+format_text (GMarkupParseContext *ctx, const gchar *text, gsize text_len,
+             gpointer user_data, GError **error)
+{
+    GString *res = (GString*)user_data;
+    g_string_append_len (res, text, text_len);
+}
+
+static gchar*
+format_key_text (const gchar *text)
+{
+    GError *err = NULL;
+    GMarkupParseContext *ctx;
+    GMarkupParser parser;
+    gboolean ret;
+    GString *res;
+    gchar *outer;
+    
+    if(!text)
+        return g_strdup ("");
+    
+    memset (&parser, 0, sizeof (parser));
+    parser.start_element = format_start_element;
+    parser.end_element = format_end_element;
+    parser.text = format_text;
+    parser.passthrough = format_text;
+    
+    res = g_string_new (NULL);
+    
+    /* We need an outer tag in order to parse */
+    outer = g_strdup_printf("<outer>%s</outer>", text);
+    ctx = g_markup_parse_context_new (&parser, 0, res, NULL);
+    ret = g_markup_parse_context_parse (ctx, outer, strlen (outer), &err);
+    g_markup_parse_context_free (ctx);
+    g_free (outer);
+
+    if (ret)
+        return g_string_free (res, FALSE);
+    
+    g_string_free (res, TRUE);
+    return NULL;
+}
+
+#ifdef HAVE_LIBNOTIFY
+
+static void 
+libnotify_closed (NotifyNotification *notif, SeahorseNotification *snotif)
+{
+    // Make this object go away
+    g_object_unref (snotif);
+}
+
+static void
+setup_libnotify_notification (SeahorseNotification *snotif, gboolean urgent, 
+                              GtkWidget *attachto)
+{
+    NotifyNotification *notif;
+    GError *err = NULL;
+    gchar *heading, *message;
+    gboolean res;
+    
+    if (!notify_is_initted ())
+        notify_init ("seahorse");
+    
+    heading = format_key_text (snotif->heading);
+    message = format_key_text (snotif->message);
+    
+    notif = notify_notification_new (heading, message, snotif->icon, attachto);
+    
+    g_free (heading);
+    g_free (message);
+    
+    g_return_if_fail (notif != NULL);
+    notify_notification_set_urgency (notif, urgent ?
+                                              NOTIFY_URGENCY_CRITICAL : 
+                                              NOTIFY_URGENCY_NORMAL);
+    
+    res = notify_notification_show (notif, &err);
+    if (!res) {
+        g_warning ("couldn't show notification through libnotify: %s", err->message);
+        g_clear_error (&err);
+        g_object_unref (notif);
+        return;
+    } 
+    
+    snotif->widget = G_OBJECT (notif);
+    g_signal_connect (notif, "closed", G_CALLBACK (libnotify_closed), snotif);
+}
+
+static void 
+update_libnotify_notification (SeahorseNotification *snotif)
+{
+    gchar *heading, *message;
+    NotifyNotification *notif = NOTIFY_NOTIFICATION (snotif->widget);
+    g_return_if_fail (notif != NULL);
+    
+    heading = format_key_text (snotif->heading);
+    message = format_key_text (snotif->message);
+    
+    if (!notify_notification_update (notif, heading, message, snotif->icon))
+        g_warning ("couldn't update notification through libnotify");
+    
+    g_free (heading);
+    g_free (message);
+}
+
+#endif /* HAVE_LIBNOTIFY */ 
+
+static void
+fallback_closed (GtkWidget *widget, SeahorseNotification *snotif)
+{
+    /* Make this object go away */
+    g_object_unref (snotif);
+}
+
+static void
+update_fallback_notification (SeahorseNotification *snotif)
+{
+    GList *children, *l;
+    GtkWidget *label, *secondary_label;
+    gchar *heading, *message, *t;
+    GtkContainer *vbox;
+    
+    vbox = GTK_CONTAINER (snotif->widget);
+    g_return_if_fail (vbox != NULL);
+    
+    children = gtk_container_get_children (vbox);
+    for (l = children; l; l = g_list_next (l))
+        gtk_container_remove (vbox, GTK_WIDGET (l->data));
+    g_list_free (children);
+    
+    heading = format_key_text (snotif->heading);
+    message = format_key_text (snotif->message);
+
+    /* Format the heading */
+    t = g_markup_printf_escaped ("<b><big>%s</big></b>", heading);
+    label = gtk_label_new (NULL);
+    gtk_label_set_markup (GTK_LABEL (label), t);
+    gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+    gtk_label_set_selectable (GTK_LABEL (label), TRUE);
+    gtk_misc_set_alignment (GTK_MISC  (label), 0.0, 0.0);
+    g_free (t);
+    
+    /* The subtext */
+    secondary_label = gtk_label_new (NULL);
+    gtk_label_set_markup (GTK_LABEL (secondary_label), message);
+    gtk_widget_set_size_request (secondary_label, 300, -1);
+    gtk_label_set_line_wrap (GTK_LABEL (secondary_label), TRUE);
+    gtk_label_set_selectable (GTK_LABEL (secondary_label), TRUE);
+    gtk_misc_set_alignment (GTK_MISC  (secondary_label), 0.0, 0.0);
+    
+    g_free (heading);
+    g_free (message);
+    
+    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+    gtk_box_pack_start (GTK_BOX (vbox), secondary_label, TRUE, TRUE, 0);
+}
+
+static void
+setup_fallback_notification (SeahorseNotification *snotif, gboolean urgent,
+                             GtkWidget *attachto)
+{
+    SeahorseWidget *swidget;
+    GtkWidget *messages;
+    GtkWidget *hbox, *vbox, *image;
+    
+    swidget = seahorse_widget_find ("notify");
+    if (!swidget) {
+        swidget = seahorse_widget_new ("notify", NULL);
+        g_return_if_fail (swidget != NULL);
+    }
+    
+    messages = seahorse_widget_get_widget (swidget, "message-area");
+    g_return_if_fail (messages != NULL);
+    
+    /* Load up the image */
+    if (snotif->icon)
+        image = gtk_image_new_from_file (snotif->icon);
+    else
+        image = gtk_image_new_from_stock (urgent ? 
+                                            GTK_STOCK_DIALOG_WARNING : 
+                                            GTK_STOCK_DIALOG_INFO, 
+                                          GTK_ICON_SIZE_DIALOG);
+    gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+
+    /* Layout */
+    hbox = gtk_hbox_new (FALSE, 12);
+    vbox = gtk_vbox_new (FALSE, 6);
+    gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+    gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
+    gtk_box_pack_start (GTK_BOX (messages), hbox, FALSE, FALSE, 0);
+    gtk_box_reorder_child (GTK_BOX (messages), hbox, 0);
+    
+    snotif->widget = G_OBJECT (vbox);
+    g_signal_connect (vbox, "destroy", G_CALLBACK (fallback_closed), snotif);
+    update_fallback_notification (snotif);
+    
+    gtk_widget_show_all (messages);
+}
+
+static void 
+key_changed (CryptUIKeyset *keyset, const gchar *key, SeahorseNotification *snotif)
+{
+    GList *l;
+    gboolean matched = FALSE;
+
+    if (!snotif->widget)
+        return;
+
+    g_return_if_fail (key);
+
+    for (l = snotif->keyids; l; l = g_list_next (l)) {
+        if (strcmp (key, l->data) == 0) {
+            matched = TRUE;
+            break;
+        }
+    }
+    
+    if (!matched)
+        return;
+
+#ifdef HAVE_LIBNOTIFY
+    if (NOTIFY_IS_NOTIFICATION (snotif->widget))
+        update_libnotify_notification (snotif);
+    else
+#endif 
+        update_fallback_notification (snotif);
+}
+
+static void
+keys_start_element (GMarkupParseContext *ctx, const gchar *element_name,
+                    const gchar **attribute_names, const gchar **attribute_values,
+                    gpointer user_data, GError **error)
+{
+    SeahorseNotification* snotif = SEAHORSE_NOTIFICATION (user_data);
+
+    if (strcmp (element_name, "key") == 0) {
+        
+        const gchar *key = NULL;
+        const gchar *field = NULL;
+        
+        for (; *attribute_names && *attribute_values; attribute_names++, attribute_values++) {
+            if (strcmp (*attribute_names, "id") == 0) 
+                key = *attribute_values;
+            else if (strcmp (*attribute_names, "field") == 0)
+                field = *attribute_values;
+        }
+        
+        if (!key)
+            g_warning ("key text <key> element requires the following attributes\n"
+                       "     <key id=\"xxxxx\" field=\"xxxxx\"/>");
+        
+        snotif->keyids = g_list_append (snotif->keyids, g_strdup (key));
+    }
+    
+}
+
+void
+free_keyset (void)
+{
+    if (keyset)
+        g_object_unref (keyset);
+    keyset = NULL;
+}
+
+/* -----------------------------------------------------------------------------
+ * OBJECT 
+ */
+
+static void
+seahorse_notification_init (SeahorseNotification *snotif)
+{
+    if (!keyset) {
+        keyset = cryptui_keyset_new ("openpgp", TRUE);
+        g_return_if_fail (keyset);
+        g_atexit (free_keyset);
+    }
+
+    g_signal_connect (keyset, "changed", G_CALLBACK (key_changed), snotif);
+}
+
+static void
+seahorse_notification_dispose (GObject *gobject)
+{
+    SeahorseNotification *snotif = SEAHORSE_NOTIFICATION (gobject);
+    GList *l;
+    
+    if (snotif->widget) {
+#ifdef HAVE_LIBNOTIFY
+        if (NOTIFY_IS_NOTIFICATION (snotif->widget)) {
+            g_signal_handlers_disconnect_by_func (snotif->widget, libnotify_closed, snotif);
+            g_object_unref (snotif->widget);
+        } else
+#endif 
+            g_signal_handlers_disconnect_by_func (snotif->widget, fallback_closed, snotif);
+    }
+
+    snotif->widget = NULL;
+    
+    for (l = snotif->keyids; l; l = g_list_next (l)) 
+        g_free (l->data);
+    g_list_free (snotif->keyids);
+    snotif->keyids = NULL;
+    
+    G_OBJECT_CLASS (seahorse_notification_parent_class)->dispose (gobject);
+}
+
+static void
+seahorse_notification_finalize (GObject *gobject)
+{
+    SeahorseNotification *snotif = SEAHORSE_NOTIFICATION (gobject);
+    
+    g_signal_handlers_disconnect_by_func (keyset, key_changed, snotif);
+    g_assert (!snotif->widget);
+    
+    if (snotif->heading)
+        g_free (snotif->heading);
+    snotif->heading = NULL;
+    
+    if (snotif->message)
+        g_free (snotif->message);
+    snotif->message = NULL;
+ 
+    G_OBJECT_CLASS (seahorse_notification_parent_class)->finalize (gobject);
+}
+
+static void
+seahorse_notification_class_init (SeahorseNotificationClass *klass)
+{
+    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
+    seahorse_notification_parent_class = g_type_class_peek_parent (klass);
+    
+    gobject_class->dispose = seahorse_notification_dispose;
+    gobject_class->finalize = seahorse_notification_finalize;
+}
+
+
+static SeahorseNotification*
+seahorse_notification_new (const gchar *summary, const gchar* body, 
+                           gboolean urgent, const gchar *icon, GtkWidget *attachto)
+{
+    SeahorseNotification* snotif = g_object_new (SEAHORSE_TYPE_NOTIFICATION, NULL);
+    GError *err = NULL;
+    GMarkupParseContext *ctx;
+    GMarkupParser parser;
+    gboolean ret;
+    gchar *osummary, *obody;
+    
+    snotif->heading = g_strdup (summary);
+    snotif->message = g_strdup (body);
+    snotif->icon = icon;
+    
+    memset (&parser, 0, sizeof (parser));
+    parser.start_element = keys_start_element;
+    parser.end_element = NULL;
+    parser.text = NULL;
+    parser.passthrough = NULL;
+    
+    /* We need an outer tag in order to parse */
+    obody = g_strdup_printf("<outer>%s</outer>", body);
+    osummary = g_strdup_printf("<outer>%s</outer>", summary);
+    ctx = g_markup_parse_context_new (&parser, 0, snotif, NULL);
+    if((ret = g_markup_parse_context_parse (ctx, osummary, strlen (osummary), &err)))
+        ret = g_markup_parse_context_parse (ctx, obody, strlen (obody), &err);
+    g_markup_parse_context_free (ctx);
+    g_free (obody);
+    g_free (osummary);
+    
+    if (!ret) {
+        g_warning ("couldn't parse keys out of key text: %s", err->message); 
+        g_clear_error (&err);
+    }
+
+#ifdef HAVE_LIBNOTIFY
+    setup_libnotify_notification (snotif, urgent, attachto);
+#endif 
+    if (!snotif->widget)
+        setup_fallback_notification (snotif, urgent, attachto);
+    
+    if (snotif->widget) {
+        /* Reference kept until widget is closed */
+        g_object_ref (snotif);
+        return snotif;
+    }
+    
+    g_object_unref (snotif);
+    return NULL;
+}
+
+/* -----------------------------------------------------------------------------
+ * PUBLIC STUFF
+ */
+
+gboolean
+seahorse_notification_have ()
+{
+    return seahorse_widget_find ("notify") != NULL;
+}
+
+void 
+seahorse_notification_display (const gchar *summary, const gchar *body,
+                               gboolean urgent, const gchar *icon, GtkWidget *attachto)
+{
+    SeahorseNotification *snotif = seahorse_notification_new (summary, body, urgent, 
+                                                              icon, attachto);
+    
+    // Let object handle and cleanup itself
+    if (snotif)
+        g_object_unref (snotif);
+}
+
+/* -----------------------------------------------------------------------------
+ * SPECIFIC NOTIFICATIONS
+ */
+
+/* Note that we can't use GTK stock here, as we hand these icons off 
+   to other processes in the case of notifications */
+#define ICON_PREFIX     DATA_DIR "/pixmaps/seahorse-plugins/48x48/"
+
+void
+seahorse_notify_import (guint keynum, gchar **keys)
+{
+    gchar *body, *t;
+    gchar **keyptr;
+    const gchar *title = ngettext("Key Imported", "Keys Imported", keynum);
+    const gchar *icon = ICON_PREFIX "seahorse-key.png";
+    
+    if (keynum > 4) 
+        body = g_strdup_printf(ngettext("Imported %i key", "Imported %i keys", keynum), keynum);
+    else {
+        body = g_strdup_printf(ngettext("Imported a key for", "Imported keys for", keynum));
+        
+        for (keyptr = keys; *keyptr; keyptr++) {
+            t = g_strdup_printf ("%s\n<key id='%s' field=\"display-name\"/>", body, *keyptr);
+            g_free (body);
+            body = t;
+        }
+    }
+    
+    /* Always try and display in the daemon */
+    cryptui_display_notification (title, body, icon, FALSE);
+
+    g_free (body);
+}
+
+void
+seahorse_notify_import_local (guint keys, GtkWidget *attachto)
+{
+    gchar *body = g_strdup_printf(ngettext("Imported %i key", "Imported %i keys", keys), keys);
+    seahorse_notification_display (ngettext("Key Imported", "Keys Imported", keys), body, 
+                                   FALSE, ICON_PREFIX "seahorse-key.png", attachto);
+    g_free (body);
+}
+
+void
+seahorse_notify_signatures (const gchar* data, gpgme_verify_result_t status)
+{
+    const gchar *icon = NULL;
+    const gchar *keyid;
+    gchar *title, *body;
+    gboolean sig = FALSE;
+    gsize len;
+    
+    /* Figure out what to display */
+    switch (gpgme_err_code (status->signatures->status))  {
+    case GPG_ERR_KEY_EXPIRED:
+	/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
+        body = _("Signed by <i><key id='%s'/> <b>expired</b></i> on %s.");
+        title = _("Invalid Signature");
+        icon = ICON_PREFIX "seahorse-sign-bad.png";
+        sig = TRUE;
+        break;
+	/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
+    case GPG_ERR_SIG_EXPIRED:
+        body = _("Signed by <i><key id='%s'/></i> on %s <b>Expired</b>.");
+        title = _("Expired Signature");
+        icon = ICON_PREFIX "seahorse-sign-bad.png";
+        sig = TRUE;
+        break;
+	/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
+    case GPG_ERR_CERT_REVOKED:
+        body = _("Signed by <i><key id='%s'/> <b>Revoked</b></i> on %s.");
+        title = _("Revoked Signature");
+        icon = ICON_PREFIX "seahorse-sign-bad.png";
+        sig = TRUE;
+        break;
+    case GPG_ERR_NO_ERROR:
+	/* TRANSLATORS: <key id='xxx'> is a custom markup tag, do not translate. */
+        body = _("Signed by <i><key id='%s'/></i> on %s.");
+        title = _("Good Signature");
+        icon = ICON_PREFIX "seahorse-sign-ok.png";
+        sig = TRUE;
+        break;
+    case GPG_ERR_NO_PUBKEY:
+        body = _("Signing key not in keyring.");
+        title = _("Unknown Signature");
+        icon = ICON_PREFIX "seahorse-sign-unknown.png";
+        break;
+    case GPG_ERR_BAD_SIGNATURE:
+        body = _("Bad or forged signature. The signed data was modified.");
+        title = _("Bad Signature");
+        icon = ICON_PREFIX "seahorse-sign-bad.png";
+        break;
+    case GPG_ERR_NO_DATA:
+        return;
+    default:
+        if (!GPG_IS_OK (status->signatures->status)) 
+            seahorse_util_handle_gpgme (status->signatures->status, 
+                                        _("Couldn't verify signature."));
+        return;
+    };
+    
+    /* TODO: This logic needs to be consolidated somewhere */
+    keyid = status->signatures->fpr;
+    len = strlen (keyid);
+    if (len > 16) 
+	    keyid += len - 16;
+
+    if (sig) {
+        gchar *date = seahorse_util_get_display_date_string (status->signatures->timestamp);
+        gchar *id = g_strdup_printf ("openpgp:%s", keyid);
+        body = g_markup_printf_escaped (body, id, date);
+        g_free (date);
+        g_free (id);
+    } else {
+        body = g_strdup (body);
+    }
+    
+    if (data) {
+        gchar *unesc_uri = g_uri_unescape_string (seahorse_util_uri_get_last (data), NULL);
+        title = g_strdup_printf ("%s: %s", unesc_uri, title);
+        g_free (unesc_uri); 
+    } else {
+        title = g_strdup (title);
+    }
+
+    /* Always try and display in the daemon */
+    cryptui_display_notification (title, body, icon, !sig);
+
+    g_free (title);
+    g_free (body);
+}    
diff -pruN 2.30.1-3/plugins/nautilus/seahorse-pgp-preferences.desktop.in 2.30.1-3ubuntu3/plugins/nautilus/seahorse-pgp-preferences.desktop.in
--- 2.30.1-3/plugins/nautilus/seahorse-pgp-preferences.desktop.in	2011-09-05 13:21:44.000000000 +0000
+++ 2.30.1-3ubuntu3/plugins/nautilus/seahorse-pgp-preferences.desktop.in	2010-01-25 02:06:50.000000000 +0000
@@ -7,7 +7,6 @@ Type=Application
 Icon=seahorse-preferences
 Categories=GNOME;GTK;Settings;X-GNOME-PersonalSettings;
 StartupNotify=true
-NoDisplay=true
 X-GNOME-Bugzilla-Bugzilla=GNOME
 X-GNOME-Bugzilla-Product=seahorse
 X-GNOME-Bugzilla-Component=general
