Commit f8613abd authored by Zeeshan Ali's avatar Zeeshan Ali

First commit

parents
/*.bak
/*.lo
/*.o
/*.orig
/*.rej
/*.tab.c
/*~
/.*.sw[nop]
/.deps
/.dirstamp
/.libs
/.version
/ABOUT-NLS
/GPATH
/GRTAGS
/GSYMS
/GTAGS
/ID
/Makefile
/Makefile.in
/TAGS
/_libs
/aclocal.m4
/autom4te.cache
/build-aux/ar-lib
/build-aux/compile
/build-aux/config.guess
/build-aux/config.rpath
/build-aux/config.sub
/build-aux/depcomp
/build-aux/install-sh
/build-aux/ltmain.sh
/build-aux/missing
/build-aux/mkinstalldirs
/config.cache
/config.h
/config.h.in
/config.log
/config.lt
/config.status
/config.status.lineno
/configure
/configure.lineno
/intltool-extract
/intltool-extract.in
/intltool-merge
/intltool-merge.in
/intltool-update
/intltool-update.in
/libtool
/m4/intltool.m4
/m4/libtool.m4
/m4/ltoptions.m4
/m4/ltsugar.m4
/m4/ltversion.m4
/m4/lt~obsolete.m4
/po/*.gmo
/po/*.mo
/po/.intltool-merge-cache
/po/Makefile
/po/Makefile.in
/po/Makefile.in.in
/po/Makevars.template
/po/POTFILES
/po/Rules-quot
/po/boldquot.sed
/po/en@boldquot.header
/po/en@quot.header
/po/gnome-boxes.pot
/po/insert-header.sin
/po/quot.sed
/po/remove-potcdate.sin
/po/stamp-it
/src/.deps
/src/*.o
/src/Makefile
/src/Makefile.in
/src/geocue
/so_locations
/stamp-h1
/tags
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
NULL =
SUBDIRS = src data demo po
INTLTOOL_FILES = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
$(NULL)
DISTCLEANFILES = \
intltool-extract \
intltool-merge \
intltool-update \
po/.intltool-merge-cache \
$(NULL)
EXTRA_DIST = \
build-aux/git-version-gen \
.version \
$(INTLTOOL_FILES) \
$(NULL)
MAINTAINERCLEANFILES = \
ABOUT-NLS \
aclocal.m4 \
config.h.in \
build-aux/ar-lib \
build-aux/compile \
build-aux/config.guess \
build-aux/config.rpath \
build-aux/config.sub \
build-aux/depcomp \
build-aux/install-sh \
build-aux/ltmain.sh \
build-aux/missing \
build-aux/mkinstalldirs \
m4/intltool.m4 \
m4/libtool.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4 \
m4/lt~obsolete.m4 \
po/Makefile.in.in \
po/Makevars.template \
po/Rules-quot \
po/boldquot.sed \
po/en@boldquot.header \
po/en@quot.header \
po/insert-header.sin \
po/quot.sed \
po/remove-potcdate.sin \
$(NULL)
# see git-version-gen
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
BUILT_SOURCES = $(top_srcdir)/.version
$(top_srcdir)/.version:
echo $(VERSION) > $@-t && mv $@-t $@
all:
-include $(top_srcdir)/git.mk
GeoClue: The Geoinformation Service
===================================
GeoClue is a D-Bus geoinformation service. The goal of the Geoclue project is to
make creating location-aware applications as simple as possible.
Geoclue is Free Software, licensed under GNU LGPLv2+.
#!/bin/sh
set -e # exit on errors
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
mkdir -p m4
git submodule update --init --recursive
autoreconf -v --force --install
intltoolize -f
if [ -z "$NOCONFIGURE" ]; then
"$srcdir"/configure --enable-maintainer-mode --enable-debug ${1+"$@"}
fi
#!/bin/sh
# Print a version string.
scriptversion=2010-06-14.19; # UTC
# Copyright (C) 2007-2010 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
# It may be run two ways:
# - from a git repository in which the "git describe" command below
# produces useful output (thus requiring at least one signed tag)
# - from a non-git-repo directory containing a .tarball-version file, which
# presumes this script is invoked like "./git-version-gen .tarball-version".
# In order to use intra-version strings in your project, you will need two
# separate generated version string files:
#
# .tarball-version - present only in a distribution tarball, and not in
# a checked-out repository. Created with contents that were learned at
# the last time autoconf was run, and used by git-version-gen. Must not
# be present in either $(srcdir) or $(builddir) for git-version-gen to
# give accurate answers during normal development with a checked out tree,
# but must be present in a tarball when there is no version control system.
# Therefore, it cannot be used in any dependencies. GNUmakefile has
# hooks to force a reconfigure at distribution time to get the value
# correct, without penalizing normal development with extra reconfigures.
#
# .version - present in a checked-out repository and in a distribution
# tarball. Usable in dependencies, particularly for files that don't
# want to depend on config.h but do want to track version changes.
# Delete this file prior to any autoconf run where you want to rebuild
# files to pick up a version string change; and leave it stale to
# minimize rebuild time after unrelated changes to configure sources.
#
# It is probably wise to add these two files to .gitignore, so that you
# don't accidentally commit either generated file.
#
# Use the following line in your configure.ac, so that $(VERSION) will
# automatically be up-to-date each time configure is run (and note that
# since configure.ac no longer includes a version string, Makefile rules
# should not depend on configure.ac for version updates).
#
# AC_INIT([GNU project],
# m4_esyscmd([build-aux/git-version-gen .tarball-version]),
# [bug-project@example])
#
# Then use the following lines in your Makefile.am, so that .version
# will be present for dependencies, and so that .tarball-version will
# exist in distribution tarballs.
#
# BUILT_SOURCES = $(top_srcdir)/.version
# $(top_srcdir)/.version:
# echo $(VERSION) > $@-t && mv $@-t $@
# dist-hook:
# echo $(VERSION) > $(distdir)/.tarball-version
case $# in
1|2) ;;
*) echo 1>&2 "Usage: $0 \$srcdir/.tarball-version" \
'[TAG-NORMALIZATION-SED-SCRIPT]'
exit 1;;
esac
tarball_version_file=$1
tag_sed_script="${2:-s/x/x/}"
nl='
'
# Avoid meddling by environment variable of the same name.
v=
# First see if there is a tarball-only version file.
# then try "git describe", then default.
if test -f $tarball_version_file
then
v=`cat $tarball_version_file` || exit 1
case $v in
*$nl*) v= ;; # reject multi-line output
[0-9]*) ;;
*) v= ;;
esac
test -z "$v" \
&& echo "$0: WARNING: $tarball_version_file seems to be damaged" 1>&2
fi
if test -n "$v"
then
: # use $v
elif test -d .git \
&& v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
|| git describe --abbrev=4 HEAD 2>/dev/null` \
&& v=`printf '%s\n' "$v" | sed "$tag_sed_script"` \
&& case $v in
v[0-9]*) ;;
*) (exit 1) ;;
esac
then
# Is this a new git that lists number of commits since the last
# tag or the previous older version that did not?
# Newer: v6.10-77-g0f8faeb
# Older: v6.10-g0f8faeb
case $v in
*-*-*) : git describe is okay three part flavor ;;
*-*)
: git describe is older two part flavor
# Recreate the number of commits and rewrite such that the
# result is the same as if we were using the newer version
# of git describe.
vtag=`echo "$v" | sed 's/-.*//'`
numcommits=`git rev-list "$vtag"..HEAD | wc -l`
v=`echo "$v" | sed "s/\(.*\)-\(.*\)/\1-$numcommits-\2/"`;
;;
esac
# Change the first '-' to a '.', so version-comparing tools work properly.
# Remove the "g" in git describe's output string, to save a byte.
v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
else
v=UNKNOWN
fi
v=`echo "$v" |sed 's/^v//'`
# Don't declare a version "dirty" merely because a time stamp has changed.
git update-index --refresh > /dev/null 2>&1
dirty=`sh -c 'git diff-index --name-only HEAD' 2>/dev/null` || dirty=
case "$dirty" in
'') ;;
*) # Append the suffix only if there isn't one already.
case $v in
*-dirty) ;;
*) v="$v-dirty" ;;
esac ;;
esac
# Omit the trailing newline, so that m4_esyscmd can use the result directly.
echo "$v" | tr -d "$nl"
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
AC_PREREQ([2.63])
AC_INIT([geoclue],
[m4_esyscmd(build-aux/git-version-gen .tarball-version)],
[http://bugs.freedesktop.org/enter_bug.cgi?product=GeoClue],
[geoclue],
[http://www.freedesktop.org/wiki/Software/GeoClue])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([1.11 dist-xz no-dist-gzip tar-ustar foreign -Wall -Werror])
AM_MAINTAINER_MODE([enable])
AM_SILENT_RULES([yes])
# Check for programs
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
AM_PROG_AR
AC_CHECK_TOOL([DESKTOP_FILE_VALIDATE], [desktop-file-validate], [/bin/true])
# Initialize libtool
LT_PREREQ([2.2])
LT_INIT([disable-static])
# Pkg-config
PKG_PROG_PKG_CONFIG([0.22])
# i18 support
IT_PROG_INTLTOOL(0.40.0)
GETTEXT_PACKAGE=AC_PACKAGE_NAME
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
# GObject-introspection support
GOBJECT_INTROSPECTION_REQUIRE([0.9.6])
# Mallard help
YELP_HELP_INIT
# GSettings support
GLIB_GSETTINGS
GLIB_MIN_VERSION=2.32.0
PKG_CHECK_MODULES(GEOCLUE, [
glib-2.0 >= $GLIB_MIN_VERSION
gio-2.0 >= $GLIB_MIN_VERSION
gio-unix-2.0 >= $GLIB_MIN_VERSION
])
dnl Strict compiler
AC_ARG_ENABLE([strict-cc],
AS_HELP_STRING([--enable-strict-cc],[Enable strict C compiler]))
AS_IF([test "x$enable_strict_cc" = "xyes"], [CFLAGS="$CFLAGS -Wall -Werror"],
[CFLAGS="$CFLAGS -w"])
dnl Debugging
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug],[enable debugging]),,
enable_debug=no)
if test "x$enable_debug" = "xyes"; then
CFLAGS="$CFLAGS -O0 -ggdb3"
VALA_DEBUG_FLAGS="-g"
fi
AC_CONFIG_FILES([
Makefile
src/Makefile
po/Makefile.in
data/Makefile
demo/Makefile
])
AC_OUTPUT
dnl ==========================================================================
AC_MSG_NOTICE([
GeoClue $VERSION
=================
prefix: ${prefix}
c compiler: ${CC} ${CFLAGS}
])
servicedir = $(datadir)/dbus-1/services
service_in_files = org.freedesktop.GeoClue2.service.in
service_DATA = $(service_in_files:.service.in=.service)
$(service_DATA): $(service_in_files) Makefile
@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
EXTRA_DIST = $(service_in_files)
[D-BUS Service]
Name=org.freedesktop.GeoClue2
Exec=@libexecdir@/geoclue
noinst_PROGRAMS = where-am-i
where_am_i_SOURCES = where-am-i.c
where_am_i_CFLAGS = -I$(top_srcdir)/src \
$(GEOCLUE_CFLAGS) \
-DLOCALEDIR="\"$(datadir)/locale\""
where_am_i_LDADD = -L$(top_srcdir)/src \
-lgeoclue-1.0 \
$(GEOCLUE_LIBS)
/* vim: set et ts=8 sw=8: */
/* where-am-i.c
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
*/
#include <config.h>
#include <stdlib.h>
#include <glib.h>
#include <locale.h>
#include <glib/gi18n.h>
#include <geoclue.h>
gint
main (gint argc, gchar *argv[])
{
GClueManagerProxy *manager;
GClueClientProxy *client;
const char *client_path;
GError *error = NULL;
textdomain (GETTEXT_PACKAGE);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
g_set_application_name (_("Where Am I"));
error = NULL;
manager = gclue_manager_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
"org.freedesktop.GeoClue2",
"/org/freedesktop/GeoClue2/Manager",
NULL,
&error);
if (error != NULL) {
g_critical ("Failed to connect to GeoClue2 service: %s", error->message);
exit (-1);
}
if (!gclue_manager_call_get_client_sync (manager,
&client_path,
NULL,
&error)) {
g_critical ("Failed to connect to GeoClue2 service: %s", error->message);
exit (-2);
}
g_print ("Client object: %s\n", client_path);
client = gclue_client_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
"org.freedesktop.GeoClue2",
client_path,
NULL,
&error);
if (error != NULL) {
g_critical ("Failed to connect to GeoClue2 service: %s", error->message);
exit (-3);
}
if (!gclue_client_call_start_sync (client, NULL, &error)) {
g_critical ("Failed to start GeoClue2 client: %s", error->message);
exit (-4);
}
g_object_unref (client);
g_object_unref (manager);
return EXIT_SUCCESS;
}
<Project xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:gnome="http://api.gnome.org/doap-extensions#"
xmlns="http://usefulinc.com/ns/doap#">
<name xml:lang="en">GeoClue</name>
<shortdesc xml:lang="en">The Geoinformation Service</shortdesc>
<description>No long description yet</description>
<homepage
rdf:resource="http://www.freedesktop.org/wiki/Software/GeoClue" />
<mailing-list
rdf:resource="http://lists.freedesktop.org/mailman/listinfo/geoclue" />
<download-page
rdf:resource="http://freedesktop.org/~zeenix/"/>
<bug-database
rdf:resource="http://bugs.freedesktop.org/enter_bug.cgi?product=GeoClue"/>
<maintainer>
<foaf:Person>
<foaf:name>Zeeshan Ali (Khattak)</foaf:name>
<foaf:mbox rdf:resource="mailto:zeeshanak@gnome.org" />
<gnome:userid>zeeshanak</gnome:userid>
</foaf:Person>
</maintainer>
</Project>
libexec_PROGRAMS = geoclue
dbus_built_sources = geoclue-interface.c geoclue-interface.h
geoclue-interface.c: geoclue-interface.h
geoclue-interface.h: Makefile.am geoclue-interface.xml
gdbus-codegen \
--interface-prefix org.freedesktop.GeoClue2. \
--c-namespace GClue \
--generate-c-code geoclue-interface \
$(srcdir)/geoclue-interface.xml
BUILT_SOURCES = \
$(dbus_built_sources) \
$(NULL)
geoclue_SOURCES = \
$(BUILT_SOURCES) \
gclue-main.c \
gclue-service-manager.h \
gclue-service-manager.c \
gclue-service-client.h \
gclue-service-client.c \
$(NULL)
geoclue_CFLAGS = $(GEOCLUE_CFLAGS) \
-DLOCALEDIR="\"$(datadir)/locale\""
geoclue_LDADD = $(GEOCLUE_LIBS)
lib_LTLIBRARIES = libgeoclue-1.0.la
libgeoclue_1_0_ladir = $(includedir)/geoclue-1.0
libgeoclue_1_0_la_HEADERS = geoclue-interface.h
libgeoclue_1_0_la_SOURCES = geoclue-interface.c
libgeoclue_1_0_la_CFLAGS = $(GEOCLUE_CFLAGS)
libgeoclue_1_0_la_LIBADD = $(GEOCLUE_LIBS)
CLEANFILES = $(BUILT_SOURCES)
-include $(top_srcdir)/git.mk
/* vim: set et ts=8 sw=8: */
/* main.c
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
*/
#include <config.h>
#include <glib.h>
#include <locale.h>
#include <glib/gi18n.h>
#include "gclue-service-manager.h"
#define BUS_NAME "org.freedesktop.GeoClue2"
GClueServiceManager *manager;
static void
on_bus_acquired (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
GError *error = NULL;
if (!gclue_service_manager_export (manager, connection, &error)) {
g_critical ("Failed to register server: %s", error->message);
g_error_free (&error);
exit (-2);
}
}
on_name_lost (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
g_critical ("Failed to acquire name '%s' on session bus or lost it.", name);
exit (-3);
}
int
main (int argc, char **argv)
{
GMainLoop *main_loop;
guint owner_id;
textdomain (GETTEXT_PACKAGE);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
g_set_application_name (_("GeoClue"));
manager = gclue_service_manager_new ();
owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
BUS_NAME,
G_BUS_NAME_OWNER_FLAGS_NONE,
on_bus_acquired,
NULL,
on_name_lost,
NULL,
NULL);
main_loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (main_loop);
g_object_unref (manager);
g_bus_unown_name (owner_id);
g_main_loop_unref (main_loop);
return 0;
}
/* vim: set et ts=8 sw=8: */
/* gclue-service-client.c
*
* Copyright (C) 2013 Red Hat, Inc.
*
* This file is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This file is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
*/
#include <glib/gi18n.h>
#include "gclue-service-client.h"
static void
gclue_client_init (GClueClientIface *iface);
G_DEFINE_TYPE_WITH_CODE (GClueServiceClient,
gclue_service_client,
GCLUE_TYPE_CLIENT_SKELETON,
G_IMPLEMENT_INTERFACE (GCLUE_TYPE_CLIENT,
gclue_client_init))
struct _GClueServiceClientPrivate
{
const char *path;
};
enum
{
PROP_0,
PROP_PATH,
LAST_PROP
};
static GParamSpec *gParamSpecs[LAST_PROP];
static gboolean
gclue_service_client_handle_start (GClueClient *client,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
gclue_client_complete_start (client, invocation);
return TRUE;
}
static gboolean
gclue_service_client_handle_stop (GClueClient *client,
GDBusMethodInvocation *invocation,
gpointer user_data)
{
gclue_client_complete_stop (client, invocation);
return TRUE;
}
static void
gclue_service_client_finalize (GObject *object)
{
GClueServiceClientPrivate *priv = GCLUE_SERVICE_CLIENT (object)->priv;