commit geoclue for openSUSE:Factory
Hello community, here is the log from the commit of package geoclue for openSUSE:Factory checked in at Thu May 5 16:15:26 CEST 2011. -------- --- geoclue/geoclue.changes 2010-09-10 14:55:02.000000000 +0200 +++ /mounts/work_src_done/STABLE/geoclue/geoclue.changes 2011-05-04 17:33:38.000000000 +0200 @@ -1,0 +2,7 @@ +Wed May 4 15:22:25 UTC 2011 - idoenmez@novell.com + +- Add geoclue-use-libnm-glib.patch: use networkmanager glib interface +- Drop gpsd support, it doesn't compile +- Add geoclue-0.12.0-gcc46.patch: remove write-only variable + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- geoclue-0.12.0-gcc46.patch geoclue-use-libnm-glib.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ geoclue.spec ++++++ --- /var/tmp/diff_new_pack.dowzZ0/_old 2011-05-05 16:13:02.000000000 +0200 +++ /var/tmp/diff_new_pack.dowzZ0/_new 2011-05-05 16:13:02.000000000 +0200 @@ -1,7 +1,7 @@ # -# spec file for package geoclue (Version 0.12.0) +# spec file for package geoclue # -# 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 @@ -19,21 +19,24 @@ Name: geoclue Version: 0.12.0 -Release: 5 +Release: 6 License: LGPLv2.0 Summary: Modular Geoinformation Service Url: http://geoclue.freedesktop.org/ Group: Development/Libraries/Other Source0: %{name}-%{version}.tar.bz2 Source1: baselibs.conf -# PATCH-FIX-UPSTREAM geoclue-nm08.patch vuntz@opensuse.org -- Take from Fedora, to build against NM 0.8 +# PATCH-FIX-UPSTREAM geoclue-nm08.patch vuntz@opensuse.org -- Taken from Fedora, to build against NM 0.8 Patch0: geoclue-nm08.patch +# PATCH-FIX-UPSTREAM geoclue-use-libnm-glib.patch idoenmez@suse.de -- Taken from Fedora, use NM glib interface +Patch1: geoclue-use-libnm-glib.patch +# PATCH-FIX-UPSTREAM geoclue-0.12.0-gcc46.patch idoenmez@suse.de -- Fix compilation with gcc 4.6 +Patch2: geoclue-0.12.0-gcc46.patch BuildRequires: NetworkManager-devel BuildRequires: dbus-1-glib-devel BuildRequires: glib2-devel BuildRequires: gconf2-devel BuildRequires: gtk2-devel -BuildRequires: gpsd-devel BuildRequires: libgypsy-devel BuildRequires: libsoup-devel BuildRequires: libxml2-devel @@ -73,20 +76,6 @@ This package provides an example backend. -%package gpsd -Summary: Modular Geoinformation Service - GPS (gpsd) backend -License: LGPLv2.0 -Group: Development/Libraries/Other -Supplements: packageand(libgeoclue0:gpsd) - -%description gpsd -Geoclue is a modular geoinformation service built on top of the D-Bus -messaging system. The goal of the Geoclue project is to make creating -location-aware applications as simple as possible. - -This package provides a backend, using information coming from a GPS -device (through gpsd). - %package gsmloc Summary: Modular Geoinformation Service - GSM backend License: LGPLv2.0 @@ -141,16 +130,27 @@ %setup -q %if 0%{?suse_version} > 1120 %patch0 -p1 +%patch1 -p1 +%patch2 -p1 %endif %build %if 0%{?suse_version} > 1120 autoreconf -fi -%configure --disable-static +%endif + +%configure \ + --disable-static \ + --enable-networkmanager=yes \ + --enable-gypsy=yes \ + --enable-gpsd=no \ +%if 0%{?suse_version} > 1120 + --enable-skyhook=yes %else -%configure --disable-static --enable-skyhook=no + --enable-skyhook=no %endif -%__make %{?jobs:-j%jobs} + +make %{?_smp_mflags} %install %makeinstall @@ -212,12 +212,6 @@ %{_datadir}/geoclue-providers/geoclue-example.provider %{_datadir}/dbus-1/services/org.freedesktop.Geoclue.Providers.Example.service -%files gpsd -%defattr(-, root, root) -%{_libexecdir}/geoclue-gpsd -%{_datadir}/geoclue-providers/geoclue-gpsd.provider -%{_datadir}/dbus-1/services/org.freedesktop.Geoclue.Providers.Gpsd.service - %files gsmloc %defattr(-, root, root) %{_libexecdir}/geoclue-gsmloc ++++++ geoclue-0.12.0-gcc46.patch ++++++ diff -up geoclue-0.12.0/src/master-provider.c.blah geoclue-0.12.0/src/master-provider.c --- geoclue-0.12.0/src/master-provider.c.blah 2011-03-07 17:32:55.926713653 -0600 +++ geoclue-0.12.0/src/master-provider.c 2011-03-07 17:33:02.177635505 -0600 @@ -846,10 +846,6 @@ gc_master_provider_initialize_interfaces static gboolean gc_master_provider_initialize (GcMasterProvider *provider) { - GcMasterProviderPrivate *priv; - - priv = GET_PRIVATE (provider); - if (!gc_master_provider_initialize_interfaces (provider)) { return FALSE; } ++++++ geoclue-use-libnm-glib.patch ++++++ diff -up geoclue-0.12.0/src/connectivity-networkmanager.c.use-libnm-glib geoclue-0.12.0/src/connectivity-networkmanager.c --- geoclue-0.12.0/src/connectivity-networkmanager.c.use-libnm-glib 2010-02-19 06:40:40.000000000 -0600 +++ geoclue-0.12.0/src/connectivity-networkmanager.c 2011-03-07 17:36:15.324220841 -0600 @@ -27,11 +27,19 @@ #include <dbus/dbus-glib.h> +#include <string.h> + +#include <netinet/in.h> +#include <arpa/inet.h> + #include <NetworkManager.h> /*for DBus strings */ -#ifdef HAVE_NETWORK_MANAGER #include <nm-client.h> #include <nm-device-wifi.h> +#include <nm-setting-ip4-config.h> + +#if !defined(NM_CHECK_VERSION) +#define NM_CHECK_VERSION(x,y,z) 0 #endif #include "connectivity-networkmanager.h" @@ -48,7 +56,7 @@ static int get_status (GeoclueConnectivity *iface) { GeoclueNetworkManager *nm = GEOCLUE_NETWORKMANAGER (iface); - + return nm->status; } @@ -57,7 +65,7 @@ get_ap_mac (GeoclueConnectivity *iface) { GeoclueNetworkManager *self = GEOCLUE_NETWORKMANAGER (iface); - return self->cache_ap_mac; + return g_strdup (self->cache_ap_mac); } static void @@ -89,16 +97,12 @@ cache_ap_mac (GeoclueNetworkManager *sel guint i; devices = nm_client_get_devices (self->client); - if (devices == NULL) { - g_free (self->cache_ap_mac); - self->cache_ap_mac = NULL; - } g_free (self->cache_ap_mac); self->cache_ap_mac = NULL; self->ap_strength = 0; - for (i = 0; i < devices->len; i++) { + for (i = 0; devices != NULL && i < devices->len; i++) { NMDevice *device = g_ptr_array_index (devices, i); if (NM_IS_DEVICE_WIFI (device)) { get_best_ap (self, device); @@ -107,19 +111,10 @@ cache_ap_mac (GeoclueNetworkManager *sel } static void -finalize (GObject *object) -{ - /* free everything */ - - ((GObjectClass *) geoclue_networkmanager_parent_class)->finalize (object); -} - -static void dispose (GObject *object) { GeoclueNetworkManager *self = GEOCLUE_NETWORKMANAGER (object); - dbus_g_connection_unref (self->connection); g_free (self->cache_ap_mac); self->cache_ap_mac = NULL; g_object_unref (self->client); @@ -132,7 +127,6 @@ geoclue_networkmanager_class_init (Geocl { GObjectClass *o_class = (GObjectClass *) klass; - o_class->finalize = finalize; o_class->dispose = dispose; } @@ -144,11 +138,20 @@ nmstate_to_geocluenetworkstatus (NMState return GEOCLUE_CONNECTIVITY_UNKNOWN; case NM_STATE_ASLEEP: case NM_STATE_DISCONNECTED: +#if NM_CHECK_VERSION(0,8,992) + case NM_STATE_DISCONNECTING: +#endif return GEOCLUE_CONNECTIVITY_OFFLINE; case NM_STATE_CONNECTING: return GEOCLUE_CONNECTIVITY_ACQUIRING; +#if NM_CHECK_VERSION(0,8,992) + case NM_STATE_CONNECTED_LOCAL: + case NM_STATE_CONNECTED_SITE: + case NM_STATE_CONNECTED_GLOBAL: +#else case NM_STATE_CONNECTED: +#endif return GEOCLUE_CONNECTIVITY_ONLINE; default: g_warning ("Unknown NMStatus: %d", status); return GEOCLUE_CONNECTIVITY_UNKNOWN; @@ -156,66 +158,52 @@ nmstate_to_geocluenetworkstatus (NMState } static void -geoclue_networkmanager_state_changed (DBusGProxy *proxy, - NMState status, - gpointer userdata) +update_status (GeoclueNetworkManager *self, gboolean do_signal) { - GeoclueNetworkManager *self = GEOCLUE_NETWORKMANAGER (userdata); - GeoclueNetworkStatus gc_status; - - gc_status = nmstate_to_geocluenetworkstatus (status); - - if (gc_status != self->status) { + GeoclueNetworkStatus old_status; + NMState state; + + old_status = self->status; + + if (nm_client_get_manager_running (self->client)) { + state = nm_client_get_state (self->client); + self->status = nmstate_to_geocluenetworkstatus (state); cache_ap_mac (self); - self->status = gc_status; + } else { + self->status = GEOCLUE_CONNECTIVITY_OFFLINE; + } + + if ((self->status != old_status) && do_signal) { geoclue_connectivity_emit_status_changed (GEOCLUE_CONNECTIVITY (self), self->status); } } - -#define NM_DBUS_SIGNAL_STATE_CHANGE "StateChange" +static void +nm_update_status_cb (GObject *obj, GParamSpec *spec, gpointer userdata) +{ + update_status (GEOCLUE_NETWORKMANAGER (userdata), TRUE); +} static void geoclue_networkmanager_init (GeoclueNetworkManager *self) { - GError *error = NULL; - DBusGProxy *proxy; - NMState state; - self->status = GEOCLUE_CONNECTIVITY_UNKNOWN; - - self->connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error); - if (self->connection == NULL) { - g_warning ("%s was unable to create a connection to D-Bus: %s", - G_OBJECT_TYPE_NAME (self), error->message); - g_error_free (error); + self->client = nm_client_new (); + if (self->client == NULL) { + g_warning ("%s was unable to create a connection to NetworkManager", + G_OBJECT_TYPE_NAME (self)); return; } - - proxy = dbus_g_proxy_new_for_name (self->connection, - NM_DBUS_SERVICE, - NM_DBUS_PATH, - NM_DBUS_INTERFACE); - dbus_g_proxy_add_signal (proxy, NM_DBUS_SIGNAL_STATE_CHANGE, - G_TYPE_UINT, G_TYPE_INVALID); - dbus_g_proxy_connect_signal (proxy, NM_DBUS_SIGNAL_STATE_CHANGE, - G_CALLBACK (geoclue_networkmanager_state_changed), - self, NULL); - - if (dbus_g_proxy_call (proxy, "state", &error, - G_TYPE_INVALID, - G_TYPE_UINT, &state, G_TYPE_INVALID)){ - self->status = nmstate_to_geocluenetworkstatus (state); - } else { - g_warning ("Could not get connectivity state from NetworkManager: %s", error->message); - g_error_free (error); - } - self->client = nm_client_new (); - cache_ap_mac (self); -} + g_signal_connect (G_OBJECT (self->client), "notify::running", + G_CALLBACK (nm_update_status_cb), self); + g_signal_connect (G_OBJECT (self->client), "notify::state", + G_CALLBACK (nm_update_status_cb), self); + /* get initial status */ + update_status (self, FALSE); +} static void geoclue_networkmanager_connectivity_init (GeoclueConnectivityInterface *iface) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de