Hello community, here is the log from the commit of package google-gadgets for openSUSE:Factory checked in at Thu Jun 30 10:38:56 CEST 2011.
-------- --- google-gadgets/google-gadgets.changes 2010-09-06 16:12:27.000000000 +0200 +++ /mounts/work_src_done/STABLE/google-gadgets/google-gadgets.changes 2011-06-28 10:46:32.000000000 +0200 @@ -1,0 +2,8 @@ +Tue Jun 28 08:34:54 UTC 2011 - dims...@opensuse.org + +- Add google-gadgets-nm09.patch: Adapt google-gadgets for Linux to + NetworkManager 0.9 API. Patch taken from upstream bug tracker, + issue #377. +- Clean spec file using spec-cleaner. + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- google-gadgets-nm09.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ google-gadgets.spec ++++++ --- /var/tmp/diff_new_pack.XqY7ED/_old 2011-06-30 10:31:57.000000000 +0200 +++ /var/tmp/diff_new_pack.XqY7ED/_new 2011-06-30 10:31:57.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package google-gadgets (Version 0.11.2) +# spec file for package google-gadgets # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,18 +20,21 @@ Name: google-gadgets Version: 0.11.2 -Release: 6 +Release: 7 License: Apache Software License .. -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: autoconf gcc-c++ update-desktop-files zip +BuildRequires: autoconf BuildRequires: flex +BuildRequires: gcc-c++ BuildRequires: gtk2-devel >= 2.8.0 BuildRequires: libcurl-devel >= 7.15.0 BuildRequires: librsvg-devel BuildRequires: libsoup-devel BuildRequires: libwebkit-devel BuildRequires: libxml2-devel >= 2.6.0 +BuildRequires: update-desktop-files +BuildRequires: zip BuildRequires: zlib-devel >= 1.2.0 +BuildRoot: %{_tmppath}/%{name}-%{version}-build %if 0%{suse_version} > 1120 BuildRequires: mozilla-xulrunner192-devel %else @@ -42,14 +45,17 @@ BuildRequires: mozilla-xulrunner190-devel >= 1.9.0 %endif %endif +Summary: Google Gadgets for Linux +Group: Productivity/Networking/Web/Utilities +Source0: %{name}-for-linux-%{version}.tar.bz2 +# PATCH-FIX-UPSTREAM google-gadgets-nm09.patch dims...@opensuse.org -- Adapt build to NM 0.9 API, patch taken from upstream bug tracker, issue #377. +Patch0: %{name}-nm09.patch +BuildRequires: NetworkManager-devel +BuildRequires: dbus-1-devel >= 1.0.2 BuildRequires: gstreamer-0_10-plugins-base-devel BuildRequires: libQtWebKit-devel -BuildRequires: dbus-1-devel >= 1.0.2 BuildRequires: libqt4-devel >= 4.3 -BuildRequires: NetworkManager-devel startup-notification-devel -Group: Productivity/Networking/Web/Utilities -Source0: %{name}-for-linux-%{version}.tar.bz2 -Summary: Google Gadgets for Linux +BuildRequires: startup-notification-devel %description Google Gadgets provides a platform for running desktop gadgets. It's @@ -85,9 +91,14 @@ Summary: Google Gadgets for Linux - Development files Group: Development/Libraries/C and C++ Requires: %{name} = %{version} -Requires: %{name}-qt = %{version} Requires: %{name}-gtk = %{version} -Requires: dbus-1-devel gtk2-devel libqt4-devel libtool zlib-devel libuuid-devel +Requires: %{name}-qt = %{version} +Requires: dbus-1-devel +Requires: gtk2-devel +Requires: libqt4-devel +Requires: libtool +Requires: libuuid-devel +Requires: zlib-devel %if 0%{suse_version} > 1120 BuildRequires: mozilla-xulrunner192-devel %else @@ -106,17 +117,18 @@ %prep %setup -q -n %{name}-for-linux-%{version} +%patch0 -p1 %build %{suse_update_config -f} %configure --disable-werror --disable-static -make %{?jobs:-j%jobs} +make %{?_smp_mflags} %install -make DESTDIR=$RPM_BUILD_ROOT install +%makeinstall # disabled static. removed *.la -rm -f $RPM_BUILD_ROOT/%{_libdir}/*.la -rm -f $RPM_BUILD_ROOT/%{_libdir}/google-gadgets/modules/*.la +rm -f %{buildroot}%{_libdir}/*.la +rm -f %{buildroot}%{_libdir}/google-gadgets/modules/*.la %suse_update_desktop_file -r ggl-gtk System Applet %suse_update_desktop_file -r ggl-qt System Applet %suse_update_desktop_file ggl-designer @@ -134,7 +146,7 @@ %postun qt -p /sbin/ldconfig %clean -rm -rf "$RPM_BUILD_ROOT" +rm -rf %{buildroot} %files gtk %defattr(-,root,root) ++++++ google-gadgets-nm09.patch ++++++ diff -up google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/network.cc.nm09 google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/network.cc --- google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/network.cc.nm09 2009-03-14 23:12:42.000000000 -0500 +++ google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/network.cc 2011-03-25 10:58:29.022771149 -0500 @@ -23,19 +23,21 @@ namespace ggadget { namespace framework { namespace linux_system { -#ifdef NM_DEVICE_TYPE_WIFI -static const int kDeviceTypeWifi = NM_DEVICE_TYPE_WIFI; -#else -static const int kDeviceTypeWifi = DEVICE_TYPE_802_11_WIRELESS; -#endif - -#ifdef NM_DEVICE_TYPE_ETHERNET -static const int kDeviceTypeEthernet = NM_DEVICE_TYPE_ETHERNET; -#else -static const int kDeviceTypeEthernet = DEVICE_TYPE_802_3_ETHERNET; -#endif - static const int kDeviceTypeUnknown = 0; +static const int kDeviceTypeEthernet = 1; +static const int kDeviceTypeWifi = 2; + +// 0.6, 0.7, and 0.8 connected state +static const int kOldConnected = 3; +// New 0.9 connected states +static const int kConnectedLocal = 50; +static const int kConnectedSite = 60; +static const int kConnectedGlobal = 70; + +// 0.6, 0.7, and 0.8 activated device state +static const int kOldDeviceStateActivated = 8; +// New 0.9 activated device state +static const int kDeviceStateActivated = 100; Network::Network() : is_new_api_(false), @@ -59,14 +61,14 @@ Network::Network() is_new_api_ = true; int state; if (network_manager_->GetProperty("State").v().ConvertToInt(&state)) { - is_online_ = (state == NM_STATE_CONNECTED); + is_online_ = IsOnlineState(state); } } else { DLOG("network manager 0.6.x might be used."); DBusIntReceiver result; if (network_manager_->CallMethod("state", true, kDefaultDBusTimeout, result.NewSlot(), MESSAGE_TYPE_INVALID)) { - is_online_ = (result.GetValue() == NM_STATE_CONNECTED); + is_online_ = IsOnlineState(result.GetValue()); } } @@ -87,14 +89,21 @@ Network::~Network() { delete network_manager_; } +bool Network::IsOnlineState(int state) { + return (state == kOldConnected || + state == kConnectedLocal || + state == kConnectedSite || + state == kConnectedGlobal); +} + void Network::OnSignal(const std::string &name, int argc, const Variant *argv) { DLOG("Got signal from network manager: %s", name.c_str()); bool need_update = false; - // nm 0.6.x uses "StateChange", 0.7.x uses "StateChanged". + // nm 0.6.x uses "StateChange", 0.7.x and later use "StateChanged". if (name == "StateChange" || name == "StateChanged") { int state; if (argc >= 1 && argv[0].ConvertToInt(&state)) { - is_online_ = (state == NM_STATE_CONNECTED); + is_online_ = IsOnlineState(state); DLOG("Network is %s.", is_online_ ? "connected" : "disconnected"); if (is_online_) { need_update = true; @@ -133,7 +142,8 @@ void Network::Update() { if (is_new_api_) { int state; if (dev->GetProperty("State").v().ConvertToInt(&state)) - active = (state == 8); // NM_DEVICE_STATE_ACTIVATED + active = (state == kOldDeviceStateActivated || + state == kDeviceStateActivated); } else { DBusBooleanReceiver result; if (dev->CallMethod("getLinkActive", true, kDefaultDBusTimeout, diff -up google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/network.h.nm09 google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/network.h --- google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/network.h.nm09 2011-03-25 10:51:31.120995640 -0500 +++ google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/network.h 2011-03-25 10:52:03.881586075 -0500 @@ -55,6 +55,7 @@ class Network : public NetworkInterface private: void OnSignal(const std::string &name, int argc, const Variant *argv); void Update(); + bool IsOnlineState(int state); private: // true if using nm 0.7 or above, false if using nm 0.6.x diff -up google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/wireless.cc.nm09 google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/wireless.cc --- google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/wireless.cc.nm09 2011-03-25 10:53:42.462353647 -0500 +++ google-gadgets-for-linux-0.11.2/extensions/linux_system_framework/wireless.cc 2011-03-25 11:01:53.707212241 -0500 @@ -28,11 +28,10 @@ #include <ggadget/string_utils.h> #include <ggadget/slot.h> -// defined in <linux/wireless.h>, but we don't want to introduce such -// dependency. -#define IW_MODE_AUTO 0 -#define IW_MODE_ADHOC 1 -#define IW_MODE_INFRA 2 +// Define them anyway for all versions of NM +static const int kNmWifiModeUnknown = 0; +static const int kNmWifiModeAdhoc = 1; +static const int kNmWifiModeInfra = 2; #if !defined(NM_DBUS_SERVICE) || !defined(NM_DBUS_PATH) || \ !defined(NM_DBUS_INTERFACE) @@ -77,15 +76,15 @@ namespace linux_system { using namespace ggadget::dbus; -#ifdef NM_DEVICE_TYPE_WIFI -static const int kDeviceTypeWifi = NM_DEVICE_TYPE_WIFI; -#else -static const int kDeviceTypeWifi = DEVICE_TYPE_802_11_WIRELESS; -#endif +static const int kDeviceTypeWifi = 2; // Defined in nm 0.7 -static const int kDeviceStateActivated = 8; -static const int kDeviceStateFailed = 9; +static const int kOldDeviceStateActivated = 8; +static const int kOldDeviceStateFailed = 9; +// New 0.9 activated device state +static const int kDeviceStateActivated = 100; +static const int kDeviceStateDeactivating = 110; +static const int kDeviceStateFailed = 120; class Wireless::Impl { class WirelessAccessPoint : public WirelessAccessPointInterface { @@ -191,7 +190,7 @@ class Wireless::Impl { void UpdateInfo() { if (ap_) { - int mode = IW_MODE_AUTO; + int mode = kNmWifiModeUnknown; if (new_api_) { // nm 0.7.x ResultVariant prop = ap_->GetProperty("Ssid"); if (prop.v().type() == Variant::TYPE_SCRIPTABLE) { @@ -223,9 +222,9 @@ class Wireless::Impl { } } - if (mode == IW_MODE_ADHOC) + if (mode == kNmWifiModeAdhoc) type_ = WIRELESS_TYPE_INDEPENDENT; - else if (mode == IW_MODE_INFRA) + else if (mode == kNmWifiModeInfra) type_ = WIRELESS_TYPE_INFRASTRUCTURE; else type_ = WIRELESS_TYPE_ANY; @@ -404,9 +403,13 @@ class Wireless::Impl { } else if (signal == "StateChanged") { // nm 0.7.x int new_state; if (argc >= 1 && argv[0].ConvertToInt(&new_state)) { - connected_ = (new_state == kDeviceStateActivated); + connected_ = (new_state == kDeviceStateActivated || + new_state == kOldDeviceStateActivated); connect_performed = (new_state == kDeviceStateActivated || - new_state == kDeviceStateFailed); + new_state == kDeviceStateDeactivating || + new_state == kDeviceStateFailed || + new_state == kOldDeviceStateActivated || + new_state == kOldDeviceStateFailed); } } else if (signal == "AccessPointAdded") { // nm 0.7.x std::string ap_path; @@ -441,7 +444,9 @@ class Wireless::Impl { if (new_api_ && dev_ && dev_wireless_) { ResultVariant prop = dev_->GetProperty("State"); if (prop.v().type() == Variant::TYPE_INT64) { - connected_ = (VariantValue<int>()(prop.v()) == kDeviceStateActivated); + int state = VariantValue<int>()(prop.v()); + connected_ = (state == kDeviceStateActivated || + state == kOldDeviceStateActivated); } } else if (!new_api_ && dev_) { DBusBooleanReceiver bool_receiver; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org For additional commands, e-mail: opensuse-commit+h...@opensuse.org