diff --git a/README.md b/README.md index 48a7515..e420003 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # geoclue +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. + diff --git a/geoclue.spec b/geoclue.spec new file mode 100644 index 0000000..52adfb3 --- /dev/null +++ b/geoclue.spec @@ -0,0 +1,181 @@ +%define majver %(echo %version | cut -d. -f1-2) +Name: geoclue +Version: 1.99.3 +Release: 1mamba +Summary: A modular geoinformation service +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.freedesktop.org/wiki/Software/GeoClue +Source0: http://www.freedesktop.org/software/geoclue/releases/%{majver}/geoclue-%{version}.tar.xz +Patch0: libgeoclue-0.11.1.1-nm08.patch +Patch1: libgeoclue-0.12.0-NMCrash.patch +Patch2: libgeoclue-0.12.0-gcc-4.7.patch +Patch3: libgeoclue-0.12.99-gpsd-3.7.patch +License: LGPL +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libffi-devel +BuildRequires: libGeoIP-devel +BuildRequires: libglib-devel +BuildRequires: libjson-glib-devel +BuildRequires: liblzma-devel +BuildRequires: libselinux-devel +BuildRequires: libsoup-devel +BuildRequires: libsqlite-devel +BuildRequires: libxml2-devel +BuildRequires: libz-devel +## AUTOBUILDREQ-END +Requires: dbus +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +# checking for CONIC... no MAEMO libraries + +%description +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. + +%package apidocs +Group: Documentation +Summary: %{name} API documentation + +%description apidocs +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 contains %{name} API documentation. + +%package devel +Group: Development/Libraries +Summary: Libraries and headers for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description devel +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 contains libraries and header files need for development. + +%package gpsd +Summary: gpsd provider for %{name} +Group: Development/Libraries +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires: 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 contains a gpsd provider for %{name} + +%package gsmloc +Summary: gsmloc provider for %{name} +Group: System/Libraries +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description gsmloc +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 contains a gsmloc provider for %{name} + +%package gui +Summary: Testing gui for %{name} +Group: Development/Libraries +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description gui +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 contains a testing gui for %{name} + +%package gypsy +Summary: gypsy provider for %{name} +Group: System/Libraries +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} +Requires: libgypsy + +%description gypsy +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 contains a libgypsy provider for %{name} + +%package static +Group: Development/Libraries +Summary: Static libraries for %{name} +Requires: %{name}-devel = %{?epoch:%epoch:}%{version}-%{release} + +%description static +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 contains static libraries need for development. + +%prep +%setup -q -n geoclue-%{version} +#%patch0 -p1 -b .nm08 +#%patch1 -p1 -b .nmCrash +#%patch2 -p1 +#%patch3 -p1 + +# +#libtoolize +#gtkdocize +#autoreconf + +%build +%configure \ + --enable-gtk-doc \ + --enable-networkmanager=yes \ + --enable-gypsy=yes \ + --enable-skyhook=yes \ + --enable-gsmloc=yes + +%make + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%makeinstall + +#mkdir %{buildroot}%{_bindir} +#install -pm 755 test/.libs/geoclue-test-gui %{buildroot}%{_bindir}/ + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_bindir}/geoip-lookup +%{_bindir}/geoip-update +%{_libexecdir}/geoclue +%{_sysconfdir}/dbus-1/system.d/org.freedesktop.GeoClue2.conf +%{_datadir}/dbus-1/system-services/org.freedesktop.GeoClue2.service +%{_datadir}/geoclue-2.0/geoclue-interface.xml + +%files devel +%defattr(-,root,root) +%{_libdir}/pkgconfig/geoclue-2.0.pc +%doc README + +%changelog +* Fri Nov 08 2013 Silvan Calarco 1.99.3-1mamba +- update to 1.99.3 (renamed to geoclue) + +* Sun Jun 02 2013 Silvan Calarco 0.12.99-2mamba +- rebuild with gpsd 3.7 + +* Sat Apr 27 2013 Automatic Build System 0.12.99-1mamba +- update to 0.12.99 + +* Wed Sep 05 2012 Silvan Calarco 0.12.0-4mamba +- added gcc 4.7 patch + +* Mon Sep 19 2011 Silvan Calarco 0.12.0-3mamba +- rebuilt with NetworkManager 0.9 + +* Fri Feb 25 2011 Silvan Calarco 0.12.0-2mamba +- rebuilt in devel + +* Tue Nov 09 2010 gil 0.12.0-1mamba +- update to 0.12.0 + +* Wed Apr 01 2009 gil 0.11.1-1mamba +- package created by autospec diff --git a/libgeoclue-0.11.1.1-nm08.patch b/libgeoclue-0.11.1.1-nm08.patch new file mode 100644 index 0000000..a483c66 --- /dev/null +++ b/libgeoclue-0.11.1.1-nm08.patch @@ -0,0 +1,11 @@ +--- geoclue-0.11.1.1/configure.ac.orig 2009-10-26 10:49:36.000000000 +0000 ++++ geoclue-0.11.1.1/configure.ac 2009-10-26 10:50:03.000000000 +0000 +@@ -123,7 +123,7 @@ + if test "x$enable_networkmanager" != "xno"; then + PKG_CHECK_MODULES(NETWORK_MANAGER, + [ +- NetworkManager libnm_glib ++ NetworkManager libnm-glib + ], have_networkmanager="yes", have_networkmanager="no") + + if test "x$have_networkmanager" = "xyes"; then diff --git a/libgeoclue-0.12.0-NMCrash.patch b/libgeoclue-0.12.0-NMCrash.patch new file mode 100644 index 0000000..d2afc87 --- /dev/null +++ b/libgeoclue-0.12.0-NMCrash.patch @@ -0,0 +1,31 @@ +From bcf9ee4f44625eddad4c267fedc507d9eeeaf3f4 Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 29 Jun 2010 18:47:21 +0000 +Subject: Fix crasher when NetworkManager has no devices + +https://bugs.freedesktop.org/show_bug.cgi?id=28066 +--- +diff --git a/src/connectivity-networkmanager.c b/src/connectivity-networkmanager.c +index 1061201..a7b8971 100644 +--- a/src/connectivity-networkmanager.c ++++ b/src/connectivity-networkmanager.c +@@ -248,16 +248,12 @@ cache_ap_mac (GeoclueNetworkManager *self) + 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); +-- +cgit v0.8.3-6-g21f6 diff --git a/libgeoclue-0.12.0-gcc-4.7.patch b/libgeoclue-0.12.0-gcc-4.7.patch new file mode 100644 index 0000000..2120548 --- /dev/null +++ b/libgeoclue-0.12.0-gcc-4.7.patch @@ -0,0 +1,23 @@ +From 90669619d1d621080ef00dcb8db1c3d206ee0bfe Mon Sep 17 00:00:00 2001 +From: Dan Williams +Date: Mon, 07 Mar 2011 23:46:15 +0000 +Subject: master: Fix warning with GCC 4.6 + +--- +diff --git a/src/master-provider.c b/src/master-provider.c +index 790c043..e4ea053 100644 +--- a/src/master-provider.c ++++ b/src/master-provider.c +@@ -846,10 +846,6 @@ gc_master_provider_initialize_interfaces (GcMasterProvider *provider) + static gboolean + gc_master_provider_initialize (GcMasterProvider *provider) + { +- GcMasterProviderPrivate *priv; +- +- priv = GET_PRIVATE (provider); +- + if (!gc_master_provider_initialize_interfaces (provider)) { + return FALSE; + } +-- +cgit v0.9.0.2-2-gbebe diff --git a/libgeoclue-0.12.99-gpsd-3.7.patch b/libgeoclue-0.12.99-gpsd-3.7.patch new file mode 100644 index 0000000..0a15965 --- /dev/null +++ b/libgeoclue-0.12.99-gpsd-3.7.patch @@ -0,0 +1,76 @@ +Submitted By: Randy McMurchy +Date: 2013-01-19 +Initial Package Version: 0.12.0 +Upstream Status: Unsure +Origin: https://bugs.freedesktop.org/attachment.cgi?id=54418 +Description: Fixes building against GPSD-3.7 + + +--- geoclue-0.12.0.orig/providers/gpsd/geoclue-gpsd.c 2011-12-14 10:57:44.000000000 +0000 ++++ geoclue-0.12.0/providers/gpsd/geoclue-gpsd.c 2011-12-14 11:03:11.271878045 +0000 +@@ -40,7 +40,12 @@ + #include + #include + ++#if GPSD_API_MAJOR_VERSION >= 5 ++/* gps_data conflicts with gps_data function */ ++typedef struct gps_data_t gps_data_l; ++#else + typedef struct gps_data_t gps_data; ++#endif + typedef struct gps_fix_t gps_fix; + + /* only listing used tags */ +@@ -59,7 +64,11 @@ + char *host; + char *port; + ++#if GPSD_API_MAJOR_VERSION >= 5 ++ gps_data_l *gpsdata; ++#else + gps_data *gpsdata; ++#endif + + gps_fix *last_fix; + +@@ -394,10 +403,16 @@ + static gboolean + geoclue_gpsd_start_gpsd (GeoclueGpsd *self) + { ++#if GPSD_API_MAJOR_VERSION >= 5 ++ int status = gps_open (self->host, self->port, self->gpsdata); ++ if (status == 0) { ++ gps_stream(self->gpsdata, WATCH_ENABLE | WATCH_NMEA, NULL); ++#else + self->gpsdata = gps_open (self->host, self->port); + if (self->gpsdata) { + gps_stream(self->gpsdata, WATCH_ENABLE | WATCH_NMEA | POLL_NONBLOCK, NULL); + gps_set_raw_hook (self->gpsdata, gpsd_raw_hook); ++#endif + return TRUE; + } else { + g_warning ("gps_open() failed, is gpsd running (host=%s,port=%s)?", self->host, self->port); +@@ -410,10 +425,23 @@ + { + GeoclueGpsd *self = (GeoclueGpsd*)data; + if (self->gpsdata) { ++#if GPSD_API_MAJOR_VERSION >= 5 ++ /* gps_poll and gps_set_raw_hook no longer present in this API version */ ++ if (gps_waiting(self->gpsdata, 500)) { ++ if (gps_read(self->gpsdata) == -1) { ++ geoclue_gpsd_set_status (self, GEOCLUE_STATUS_ERROR); ++ geoclue_gpsd_stop_gpsd(self); ++ return FALSE; ++ } else { ++ /* Call existing raw_hook to process the data */ ++ gpsd_raw_hook(self->gpsdata, NULL, 0); ++ } ++#else + if (gps_poll(self->gpsdata) < 0) { + geoclue_gpsd_set_status (self, GEOCLUE_STATUS_ERROR); + geoclue_gpsd_stop_gpsd(self); + return FALSE; ++#endif + } + } + return TRUE;