[uget] - Patch for libnotify 0.7.0 API
Mamoru Tasaka
mtasaka at fedoraproject.org
Thu Nov 11 19:49:02 UTC 2010
commit 505d5d4f54a01c3cf893db1df83305436eeff254
Author: Mamoru Tasaka <tasaka1 at localhost.localdomain>
Date: Fri Nov 12 04:48:56 2010 +0900
- Patch for libnotify 0.7.0 API
uget-1.6.1-libnotify07-morefix.patch | 11 +++
uget-1.6.1-libnotify07.patch | 114 ++++++++++++++++++++++++++++++++++
uget.spec | 21 +++++--
3 files changed, 140 insertions(+), 6 deletions(-)
---
diff --git a/uget-1.6.1-libnotify07-morefix.patch b/uget-1.6.1-libnotify07-morefix.patch
new file mode 100644
index 0000000..9cc48c7
--- /dev/null
+++ b/uget-1.6.1-libnotify07-morefix.patch
@@ -0,0 +1,11 @@
+--- uget-1.6.1/uget-gtk/uget-gtk-timeout.c.debug 2010-11-12 04:34:26.000000000 +0900
++++ uget-1.6.1/uget-gtk/uget-gtk-timeout.c 2010-11-12 04:40:28.000000000 +0900
+@@ -604,7 +604,7 @@
+ // set title and body
+ string = g_strconcat (UGET_GTK_NAME " - ", title, NULL);
+ if (notification == NULL) {
+-#if LIBNOTIFY_VERSION_MINOR >= 7
++#if NOTIFY_VERSION_MINOR >= 7
+ notification = notify_notification_new (string,
+ body, UGET_GTK_ICON_NAME);
+ #else
diff --git a/uget-1.6.1-libnotify07.patch b/uget-1.6.1-libnotify07.patch
new file mode 100644
index 0000000..f0b0bfd
--- /dev/null
+++ b/uget-1.6.1-libnotify07.patch
@@ -0,0 +1,114 @@
+------------------------------------------------------------------------
+r330 | plushuang | 2010-11-11 19:39:36 +0900 (Thu, 11 Nov 2010) | 6 lines
+
+* ug_plugin_curl.c
+(ug_plugin_curl_progress): send progress message every 2 times.
+
+
+* uget-gtk-timeout.c
+(uget_gtk_notify): support libnotify 0.7
+------------------------------------------------------------------------
+Index: configure.ac
+===================================================================
+--- configure.ac (revision 329)
++++ configure.ac (revision 330)
+@@ -55,7 +55,7 @@
+ )
+ if test "x$enable_notify" = "xyes"; then
+ PKG_CHECK_MODULES(LIBNOTIFY, libnotify)
+- AC_DEFINE(HAVE_NOTIFY, 1, [Define to 1 if libnotify support is required.])
++ AC_DEFINE(HAVE_LIBNOTIFY, 1, [Define to 1 if libnotify support is required.])
+ # for ArchLinux
+ AC_SUBST(LIBNOTIFY_CFLAGS)
+ AC_SUBST(LIBNOTIFY_LIBS)
+Index: uget-gtk/uget-gtk-timeout.c
+===================================================================
+--- uget-gtk/uget-gtk-timeout.c (revision 329)
++++ uget-gtk/uget-gtk-timeout.c (revision 330)
+@@ -36,7 +36,7 @@
+
+ #ifdef HAVE_CONFIG_H
+ #include <config.h>
+-# if HAVE_NOTIFY
++# if HAVE_LIBNOTIFY
+ # include <libnotify/notify.h>
+ # endif
+ # if HAVE_GSTREAMER
+@@ -496,7 +496,7 @@
+
+ // static void uget_play_sound (const gchar* sound_file);
+ // GStreamer
+-#if defined (HAVE_GSTREAMER) && HAVE_GSTREAMER == 1
++#ifdef HAVE_GSTREAMER
+ static gboolean ugst_bus_func (GstBus* bus, GstMessage* msg, gpointer data)
+ {
+ GstElement* playbin = data;
+@@ -588,12 +588,12 @@
+ {
+ gdk_beep ();
+ }
+-#endif // HAVE_GSTREAMER
++#endif // HAVE_GSTREAMER
+
+ // ----------------------------------------------------------------------------
+ // notification
+ //
+-#if defined (HAVE_NOTIFY) && HAVE_NOTIFY == 1
++#ifdef HAVE_LIBNOTIFY
+ static void uget_gtk_notify (UgetGtk* ugtk, const gchar* title, const gchar* body)
+ {
+ static NotifyNotification* notification = NULL;
+@@ -604,8 +604,13 @@
+ // set title and body
+ string = g_strconcat (UGET_GTK_NAME " - ", title, NULL);
+ if (notification == NULL) {
++#if LIBNOTIFY_VERSION_MINOR >= 7
++ notification = notify_notification_new (string,
++ body, UGET_GTK_ICON_NAME);
++#else
+ notification = notify_notification_new_with_status_icon (string,
+ body, UGET_GTK_ICON_NAME, ugtk->tray_icon.self);
++#endif
+ notify_notification_set_timeout (notification, 7000); // milliseconds
+ }
+ else {
+@@ -657,7 +662,7 @@
+ {
+ // do nothing
+ }
+-#endif
++#endif // HAVE_LIBNOTIFY
+
+ #define NOTIFICATION_STARTING_TITLE _("Download Starting")
+ #define NOTIFICATION_STARTING_STRING _("Starting download queue.")
+Index: uget-gtk/main.c
+===================================================================
+--- uget-gtk/main.c (revision 329)
++++ uget-gtk/main.c (revision 330)
+@@ -118,7 +118,7 @@
+ #endif
+
+ // libnotify
+-#ifdef HAVE_NOTIFY
++#ifdef HAVE_LIBNOTIFY
+ #include <libnotify/notify.h>
+ #endif
+
+@@ -235,7 +235,7 @@
+ goto exit;
+ }
+ // libnotify
+-#ifdef HAVE_NOTIFY
++#ifdef HAVE_LIBNOTIFY
+ notify_init ("Uget");
+ #endif
+
+@@ -251,7 +251,7 @@
+ gdk_threads_leave ();
+
+ // libnotify
+-#ifdef HAVE_NOTIFY
++#ifdef HAVE_LIBNOTIFY
+ if (notify_is_initted ())
+ notify_uninit ();
+ #endif
diff --git a/uget.spec b/uget.spec
index 198897e..6ff5336 100644
--- a/uget.spec
+++ b/uget.spec
@@ -1,12 +1,16 @@
Name: uget
Version: 1.6.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Download manager using GTK+ and libcurl
Group: Applications/Internet
License: LGPLv2+
URL: http://urlget.sourceforge.net/
Source0: http://downloads.sourceforge.net/urlget/%{name}-%{version}.tar.gz
+# libnotify 0.7.0 API, from upstream
+Patch0: uget-1.6.1-libnotify07.patch
+# ... and Patch0 contains typo..
+Patch1: uget-1.6.1-libnotify07-morefix.patch
BuildRequires: desktop-file-utils
BuildRequires: gstreamer-devel
@@ -16,7 +20,8 @@ BuildRequires: libcurl-devel
BuildRequires: libnotify-devel
# Autotools related
-#BuildRequires: automake
+# For Patch0
+BuildRequires: automake
Obsoletes: urlgfe < 1.0.4
Provides: urlgfe = %{name}-%{version}
@@ -31,12 +36,13 @@ Uget is the successor of urlgfe, which was called URLget before.
%prep
%setup -q
+%patch0 -p0 -b .notify07
+%patch1 -p1 -b .morefix
+autoreconf -fi
+
%build
-%configure \
-%if 0%{?fedora} >= 15
- --disable-notify
-%endif
+%configure
make -k %{?_smp_mflags}
%install
@@ -81,6 +87,9 @@ exit 0
%{_datadir}/sounds/%{name}/
%changelog
+* Fri Nov 12 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.6.1-3
+- Patch for libnotify 0.7.0 API
+
* Sat Nov 6 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 1.6.1-2
- F-15: kill libnotify suuport for now
More information about the scm-commits
mailing list