From: Miguel A. Colón Vélez <debian.micove@gmail.com>
Date: Mon, 23 Apr 2012 01:45:30 -0400
Subject: [PATCH] NMU bzr1539

---
 debian/awn-applets-python-core.install   |    5 ++++
 debian/changelog                         |   34 ++++++++++++++++++++++++
 debian/control                           |   20 +++++++++-----
 debian/patches/03-libnotify07.patch      |   16 ------------
 debian/patches/03-weather.patch          |   42 ++++++++++++++++++++++++++++++
 debian/patches/05-no-settings-menu.patch |   35 +++++++++++++++++++++++++
 debian/patches/series                    |    3 ++-
 debian/rules                             |   27 ++++++++++++++++++-
 8 files changed, 157 insertions(+), 25 deletions(-)
 delete mode 100644 debian/patches/03-libnotify07.patch
 create mode 100644 debian/patches/03-weather.patch
 create mode 100644 debian/patches/05-no-settings-menu.patch

diff --git a/debian/awn-applets-python-core.install b/debian/awn-applets-python-core.install
index b18afb6..f5524d0 100644
--- a/debian/awn-applets-python-core.install
+++ b/debian/awn-applets-python-core.install
@@ -43,6 +43,11 @@ usr/share/avant-window-navigator/applets/comics.desktop
 usr/share/avant-window-navigator/schemas/awn-applet-comics.schema-ini
 usr/share/avant-window-navigator/applets/comics/comics.sh
 #
+# Common-folder
+#
+usr/share/avant-window-navigator/applets/common-folder/
+usr/share/avant-window-navigator/applets/common-folder.desktop
+#
 # CPU Freq
 #
 etc/gconf/schemas/awn-applet-cpufreq.schemas
diff --git a/debian/changelog b/debian/changelog
index 3997001..f276664 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,38 @@
+awn-extras-applets (0.4.1~bzr1539-0.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * New upstream snapshot. (Closes: #668967)
+    - Fix various applets. (Closes: #621762)
+    - No python string exceptions since 0.4.0. (Closes: #585223)
+  * debian/awn-applets-python-core.install:
+    - Add the common-folder applet due to "dh_install --fail-missing".
+  * debian/control:
+    - Build-depends against dh-autoreconf.
+    - Build-depends against valac-0.12 | valac to fix a FTBFS.
+    - Recommend fortune-mod | fortune instead of just the virtual package.
+    - Recommend python-gtop for bandwidth-monitor.
+    - Replace hal with upower. Upower is used by default now. (Closes: #615244)
+    - Remove python-gweather since it's no longer in the archive and cairo-clock
+      does not use it if it's not found. (Closes: #646410)
+    - Suggest gnome-applets instead of recommending it. This will avoid pulling
+      all of the gnome dependency tree just for the cpufreq applet. The cpufreq
+      SysFSBackend requires cpufreq-selector which is found in gnome-applets. If
+      it's not found cpufreq will switch to the ProcCPUInfoBackend which
+      requires just /proc/cpuinfo.
+    - Recommend python-gnomekeyring for the mail applet.
+    - Add common-folder to the description of awn-applets-python-core.
+    - Recommend python-vobject for the calendar applet. (Closes: #648778)
+  * debian/patches:
+    - Drop 03-libnotify07.patch: Fixed upstream.
+    - Add 03-weather.patch: Fixes the weather applet. (Closes: #619387, #648412)
+    - Add 05-no-settings-menu.patch: Makes the main-menu applet works when no
+      settings.menu is found.
+  * debian/rules:
+    - Use autoreconf via dh_autoreconf to clean properly. (Closes: #558540)
+    - Add a get-orig-source routine to fetch the source from the bzr repository.
+
+ -- Miguel A. Colón Vélez <debian.micove@gmail.com>  Sun, 22 Apr 2012 21:54:04 -0400
+
 awn-extras-applets (0.4.0-5) unstable; urgency=low
 
   * debian/patches:
diff --git a/debian/control b/debian/control
index f126f56..14bed7f 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: gnome
 Priority: optional
 Maintainer: Julien Lavergne <julien.lavergne@gmail.com>
 Build-Depends: debhelper (>= 7.0.50~),
+               dh-autoreconf,
                intltool, 
                libgnome-menu-dev, 
                libgconf2-dev,
@@ -16,7 +17,7 @@ Build-Depends: debhelper (>= 7.0.50~),
                python (>= 2.6.6-3~),
                python-gtk2-dev,
                python-cairo-dev,
-               valac (>= 0.7.7),
+               valac-0.12 | valac,
                libwebkitgtk-dev,
                libdesktop-agnostic-bin
 Standards-Version: 3.9.3
@@ -94,29 +95,32 @@ Recommends: awn-settings (>= 0.3~bzr489),
 # hardware-sensors, cairo-clock, comics
             python-rsvg | python-gnome2-desktop,
 # animal-farm
-            fortune,
+            fortune-mod | fortune,
+# bandwidth-monitor
+            python-gtop,
 # battery
-            hal,
+            upower,
 # comics, battery
             python-notify,
 # thinkhdaps
             python-pyinotify,
 # cairo-clock
             python-dateutil,
-            python-gweather,
 # comics, feeds
             python-feedparser,
 # volume-control
             python-gst0.10,
-# cpufreq
-            gnome-applets,
+# mail
+            python-gnomekeyring,
 # feeds
             python (>= 2.6) | python-simplejson,
 # Stack
             python-gnomedesktop | python-gnome2-desktop,
 # Dialect
             python-xklavier,
-Suggests: awn-applets-python-extras
+Suggests: awn-applets-python-extras,
+# cpufreq
+          gnome-applets
 Description: Collection of applets for Awn, written in python
  Awn-extras-applets is a collection of applets for avant-window-navigator. It
  provides some extensions to the bar and some new features (like 
@@ -128,6 +132,7 @@ Description: Collection of applets for Awn, written in python
   * battery-applet: This applet displays your computers current power status.
   * cairo-clock: Displays an analog clock.
   * comics: View your favourite comics on your desktop.
+  * common-folder: Launcher for common folders and bookmarks.
   * cpufreq: Monitors and controls the CPU frequency. 
   * dialect: Manages keyboard layouts.
   * feeds: A Python feed launcher.
@@ -163,6 +168,7 @@ Recommends: awn-settings (>= 0.3~bzr489),
             python-wnck | python-gnome2-desktop,
 # calendar
             python-gdata,
+            python-vobject,
 # YAMA
             python-gmenu,
 Suggests: tomboy,
diff --git a/debian/patches/03-libnotify07.patch b/debian/patches/03-libnotify07.patch
deleted file mode 100644
index 5a89ae5..0000000
--- a/debian/patches/03-libnotify07.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Transition to libnotify 0.7
-Author: Laurent Bigonville <bigon@debian.org>
-Date: Tue, 02 Aug 2011 21:31:13 +0200
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=630262
-
---- a/applets/maintained/notification-daemon/daemon.c
-+++ b/applets/maintained/notification-daemon/daemon.c
-@@ -1487,7 +1487,7 @@
-   if (fork() == 0)
-   {
-     notify_init("notify-send");
--    notify = notify_notification_new(summary, body, icon_str, NULL);
-+    notify = notify_notification_new(summary, body, icon_str);
-     notify_notification_set_category(notify, type);
-     notify_notification_set_urgency(notify, urgency);
-     notify_notification_set_timeout(notify, expire_timeout);
diff --git a/debian/patches/03-weather.patch b/debian/patches/03-weather.patch
new file mode 100644
index 0000000..871092e
--- /dev/null
+++ b/debian/patches/03-weather.patch
@@ -0,0 +1,42 @@
+Description: Fix the weather.com url
+ The url changed from http://xoap.weather.com to http://xml.weather.com.
+ .
+ This patch was generated and applies over version 0.4.1~bzr1539.
+ .
+ The changes from 0.4.1~bzr1538 are also required to completely fix the bugs
+ from the weather applet.
+Bug-Debian: http://bugs.debian.org/619387
+Bug-Debian: http://bugs.debian.org/648412
+Author: Miguel A. Colón Vélez <debian.micove@gmail.com>
+Last-Update: 2012-03-04
+
+diff -Naur a/applets/maintained/weather/weather.py b/applets/maintained/weather/weather.py
+--- a/applets/maintained/weather/weather.py	2011-12-28 16:49:56.000000000 -0500
++++ b/applets/maintained/weather/weather.py	2012-03-04 23:43:51.000000000 -0500
+@@ -633,7 +633,7 @@
+         @async_method
+         @network_exception
+         def get_locations(self, text):
+-            url = "http://xoap.weather.com/search/search?where=" + urllib2.quote(text)
++            url = "http://xml.weather.com/search/search?where=" + urllib2.quote(text)
+             with closing(urllib2.urlopen(url)) as usock:
+                 with unlink_xml(usock) as xmldoc:
+                     locations_list = []
+@@ -647,7 +647,7 @@
+         @with_overlays
+         @network_exception
+         def get_conditions(self, location_code):
+-            url = "http://xoap.weather.com/weather/local/" + location_code + "?cc=*" + self.__ws_key
++            url = "http://xml.weather.com/weather/local/" + location_code + "?cc=*" + self.__ws_key
+             with closing(urllib2.urlopen(url)) as usock:
+                 with unlink_xml(usock) as xmldoc:
+                     names = ['CITY', 'SUNRISE', 'SUNSET', 'DESCRIPTION', 'CODE', 'TEMP', 'FEELSLIKE', 'BAR', 'BARDESC', 'WINDSPEED', 'WINDGUST', 'WINDDIR', 'HUMIDITY', 'MOONPHASE']
+@@ -679,7 +679,7 @@
+         @with_overlays
+         @network_exception
+         def get_forecast(self, location_code):
+-            url = "http://xoap.weather.com/weather/local/" + location_code + "?dayf=5" + self.__ws_key
++            url = "http://xml.weather.com/weather/local/" + location_code + "?dayf=5" + self.__ws_key
+             with closing(urllib2.urlopen(url)) as usock:
+                 with unlink_xml(usock) as xmldoc:
+                     try:
diff --git a/debian/patches/05-no-settings-menu.patch b/debian/patches/05-no-settings-menu.patch
new file mode 100644
index 0000000..035098b
--- /dev/null
+++ b/debian/patches/05-no-settings-menu.patch
@@ -0,0 +1,35 @@
+Description: Make the main-menu work even if settings.menu does not exist
+ The file settings.menu is no longer provided in gnome-menus and the "main-menu"
+ applet refuses to work because of this.
+ .
+ Solution:
+ - Comment out the "return FALSE" line which makes the applet abort.
+ - Add a "&& app->settings" so that we only try to add settings.menu to the menu
+   if it exists. The code worked without this when there was and there was not a
+   settings menu present. This just avoids the many "Critical" warning/errors
+   about trying to read a NULL settings.menu when none is not found.
+Author: Miguel A. Colón Vélez <debian.micove@gmail.com>
+Forwarded: no
+Last-Update: 2012-04-21
+
+--- awn-extras-applets-0.4.1~bzr1539.orig/applets/unmaintained/main-menu/applet.c
++++ awn-extras-applets-0.4.1~bzr1539/applets/unmaintained/main-menu/applet.c
+@@ -295,7 +295,7 @@ populate (Menu *app)
+   gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0);
+
+   apps = gmenu_tree_directory_get_contents (app->root);
+-  if (app->root == GMENU_TREE_DIRECTORY(gmenu_tree_get_root_directory ((GMenuTree*)app->apps)))
++  if (app->root == GMENU_TREE_DIRECTORY(gmenu_tree_get_root_directory ((GMenuTree*)app->apps)) && app->settings)
+   {
+     list = g_slist_copy (apps);
+     sets = g_slist_copy (gmenu_tree_directory_get_contents (app->settings));
+@@ -422,7 +422,7 @@ awn_applet_factory_initp (const gchar *n
+   if (!app->settings)
+   {
+     g_warning ("Unable to find settings.menu");
+-    return FALSE;
++    //return FALSE;
+   }
+   app->tree =  (GMenuTree*)app->apps;
+
+   app->menu = awn_applet_create_default_menu (app->applet);
diff --git a/debian/patches/series b/debian/patches/series
index 03706a9..fd92e67 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 02-shinyswitcher-default-layout.patch
-03-libnotify07.patch
+03-weather.patch
 04-glib-single-include.patch
+05-no-settings-menu.patch
diff --git a/debian/rules b/debian/rules
index fbed462..55b1f1e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,7 +8,10 @@ configure_flags += \
 
 
 %:
-	dh --with python2 $@
+	dh $@ --with autoreconf,python2
+
+override_dh_autoreconf:
+	dh_autoreconf '(intltoolize -f -c && autoreconf -vfi)'
 
 override_dh_auto_configure:
 	dh_auto_configure -- 	$(configure_flags)
@@ -47,3 +50,25 @@ override_dh_makeshlibs:
 
 override_dh_strip:
 	dh_strip --dbg-package=awn-applets-c-dbg
+
+DEB_DEBIAN_DIR=$(dir $(firstword $(MAKEFILE_LIST)))
+REV=$(shell dpkg-parsechangelog -l$(DEB_DEBIAN_DIR)/changelog \
+		| sed -rne 's,^Version: .*[+~]bzr([0-9]+).*,\1,p')
+VER=$(shell dpkg-parsechangelog -l$(DEB_DEBIAN_DIR)/changelog \
+		| sed -rne 's,^Version: (.*:)?(.*)-(.*),\2,p')
+
+get-orig-source:
+	bzr export -r $(REV) --per-file-timestamps \
+		awn-extras-applets-$(VER).orig lp:awn-extras
+	rm -rf awn-extras-applets-$(VER).orig/debian
+	# Make the tarball reproducible by changing the mtime of directories.
+	BZR_TIME=$$(bzr version-info -r $(REV) lp:awn-extras | \
+		sed -rne 's,^date: (.*),\1,p') ;\
+	find awn-extras-applets-$(VER).orig -type d | \
+		xargs -r touch -d "$$BZR_TIME"
+	GZIP="-9n" tar czf awn-extras-applets_$(VER).orig.tar.gz \
+		--numeric-owner --owner 0 --group 0 \
+		awn-extras-applets-$(VER).orig
+	rm -rf awn-extras-applets-$(VER).orig
+
+.PHONY: get-orig-source
-- 
1.7.10

