[couchdb-glib] Added desktopcouch-glib library



commit 7541c6d8dbc66a88b343b0aee3b91a8ef015add3
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Fri Jan 8 14:12:30 2010 +0100

    Added desktopcouch-glib library

 Makefile.am                           |   10 ++-
 configure.ac                          |    7 ++
 couchdb-glib/Makefile.am              |    2 -
 desktopcouch-glib.pc.in               |   10 +-
 desktopcouch-glib/Makefile.am         |  135 ++++++++++----------------------
 desktopcouch-glib/desktopcouch-glib.h |   16 +---
 desktopcouch-glib/desktopcouch.c      |   25 ++++--
 desktopcouch-glib/desktopcouch.h      |   24 +++---
 8 files changed, 93 insertions(+), 136 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 8d8748c..7fb5ed0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,14 +1,17 @@
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = couchdb-glib tests doc
+SUBDIRS = couchdb-glib desktopcouch-glib tests doc
 
 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
 
-pcfiles = couchdb-glib-1.0.pc
+pcfiles = couchdb-glib-1.0.pc desktopcouch-glib-1.0.pc
 
 couchdb-glib-1.0.pc: couchdb-glib.pc
 	@cp -f $< $@
 
+desktopcouch-glib-1.0.pc: desktopcouch-glib.pc
+	@cp -f $< $@
+
 pkgconfig_DATA = $(pcfiles)
 pkgconfigdir = $(libdir)/pkgconfig
 
@@ -21,6 +24,7 @@ couchdbdoc_DATA =		\
 
 EXTRA_DIST =			\
 	couchdb-glib.pc.in	\
+	desktopcouch-glib.pc.in	\
 	$(couchdbdoc_DATA)
 
 dist-hook:
@@ -28,4 +32,4 @@ dist-hook:
 	cp -f ChangeLog.in $(distdir)/ChangeLog && \
 	rm -f ChangeLog.in
 
-CLEANFILES = couchdb-glib-1.0.pc
+CLEANFILES = $(pcfiles)
diff --git a/configure.ac b/configure.ac
index 4e16efc..d5f2b4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,11 @@ PKG_CHECK_MODULES(COUCHDB_GLIB, glib-2.0 gobject-2.0 json-glib-1.0 >= 0.7.4 libs
 AC_SUBST(COUCHDB_GLIB_CFLAGS)
 AC_SUBST(COUCHDB_GLIB_LIBS)
 
+dnl Needed modules for DesktopCouchDB
+PKG_CHECK_MODULES(DESKTOPCOUHDB_GLIB, gnome-keyring-1 dbus-glib-1)
+AC_SUBST(DESKTOPCOUHDB_GLIB_CFLAGS)
+AC_SUBST(DESKTOPCOUHDB_GLIB_LIBS)
+
 LIBCOUCHDBGLIB_CURRENT=1
 LIBCOUCHDBGLIB_REVISION=1
 LIBCOUCHDBGLIB_AGE=0
@@ -60,7 +65,9 @@ GOBJECT_INTROSPECTION_CHECK([0.6.4])
 AC_OUTPUT([
 Makefile
 couchdb-glib.pc
+desktopcouch-glib.pc
 couchdb-glib/Makefile
+desktopcouch-glib/Makefile
 tests/Makefile
 doc/Makefile
 doc/reference/Makefile
diff --git a/couchdb-glib/Makefile.am b/couchdb-glib/Makefile.am
index 068caaf..e6fba72 100644
--- a/couchdb-glib/Makefile.am
+++ b/couchdb-glib/Makefile.am
@@ -4,10 +4,8 @@ oauth_sources = oauth.c xmalloc.c
 
 if HAVE_OAUTH
 OAUTH_FILES = $(oauth_headers) $(oauth_sources)
-OAUTH_LIBS = 
 else
 OAUTH_FILES = 
-OAUTH_LIBS =
 endif
 
 INCLUDES =		\
diff --git a/desktopcouch-glib.pc.in b/desktopcouch-glib.pc.in
index e895a6a..325365e 100644
--- a/desktopcouch-glib.pc.in
+++ b/desktopcouch-glib.pc.in
@@ -3,9 +3,9 @@ exec_prefix=${prefix}
 libdir=${exec_prefix}/lib
 includedir=${exec_prefix}/include
 
-Name: CouchDB-GLib
-Description: GLib-based API for CouchDB databases
+Name: DesktopCouchDB-GLib
+Description: DesktopCouch access library
 Version: @VERSION@
-Libs: -L${libdir} -lcouchdb-glib-1.0
-Cflags: -I${includedir}/couchdb-glib-1.0
-Requires: gobject-2.0 json-glib-1.0 >= 0.7.4
+Libs: -L${libdir} -ldesktopcouchdb-glib-1.0
+Cflags: -I${includedir}/desktopcouchdb-glib-1.0
+Requires: couchdb-glib-1.0
diff --git a/desktopcouch-glib/Makefile.am b/desktopcouch-glib/Makefile.am
index 068caaf..eee4e30 100644
--- a/desktopcouch-glib/Makefile.am
+++ b/desktopcouch-glib/Makefile.am
@@ -1,114 +1,63 @@
+INCLUDES =				\
+	-I$(top_builddir)/couchdb-glib	\
+	$(COUCHDB_GLIB_CFLAGS)		\
+	$(DESKTOPCOUCH_GLIB_CFLAGS)
 
-oauth_headers = oauth.h xmalloc.h
-oauth_sources = oauth.c xmalloc.c
+lib_LTLIBRARIES = libdesktopcouch-glib-1.0.la
 
-if HAVE_OAUTH
-OAUTH_FILES = $(oauth_headers) $(oauth_sources)
-OAUTH_LIBS = 
-else
-OAUTH_FILES = 
-OAUTH_LIBS =
-endif
-
-INCLUDES =		\
-	$(COUCHDB_GLIB_CFLAGS)
-
-lib_LTLIBRARIES = libcouchdb-glib-1.0.la
-
-# Marshallers
-marshal_headers = couchdb-marshal.h
-marshal_sources = couchdb-marshal.c
-MARSHAL_FILES = $(marshal_headers) $(marshal_sources)
-
-couchdb-marshal.h: couchdb-marshal.list $(GLIB_GENMARSHAL)
-	$(GLIB_GENMARSHAL) $< --header --prefix=_couchdb_marshal > $@
+libdesktopcouch_glib_1_0_la_headers =	\
+	desktopcouch-glib.h		\
+	desktopcouch.h
 
-couchdb-marshal.c: couchdb-marshal.list $(GLIB_GENMARSHAL)
-	$(GLIB_GENMARSHAL) $< --body --prefix=_couchdb_marshal > $@
+libdesktopcouch_glib_1_0_la_SOURCES =		\
+	$(libdesktopcouch_glib_1_0_la_headers) 	\
+	desktopcouch.c
 
-libcouchdb_glib_1_0_la_headers =	\
-	couchdb.h			\
-	couchdb-database-info.h		\
-	couchdb-document.h		\
-	couchdb-document-contact.h	\
-	couchdb-document-info.h		\
-	couchdb-glib.h			\
-	couchdb-struct-field.h		\
-	couchdb-types.h			\
-	dbwatch.h			\
-	utils.h
+libdesktopcouch_glib_1_0_la_LIBADD =				\
+	$(top_builddir)/couchdb-glib/libcouchdb-glib-1.0.la	\
+	$(COUCHDB_GLIB_LIBS)					\
+	$(DESKTOPCOUCH_GLIB_LIBS)
 
-libcouchdb_glib_1_0_la_sources =	\
-	couchdb.c			\
-	couchdb-database-info.c		\
-	couchdb-document.c		\
-	couchdb-document-contact.c	\
-	couchdb-document-info.c		\
-	couchdb-struct-field.c		\
-	dbwatch.c			\
-	utils.c				\
-	$(marshal_sources)		\
-	$(oauth_sources)
-
-libcouchdb_glib_1_0_la_SOURCES =	\
-	$(libcouchdb_glib_1_0_la_headers) \
-	$(libcouchdb_glib_1_0_la_sources) \
-	$(marshal_headers)		\
-	$(oauth_headers)
-
-libcouchdb_glib_1_0_la_LIBADD =		\
-	$(COUCHDB_GLIB_LIBS)		\
-	$(OAUTH_LIBS)			\
-	-luuid
-
-libcouchdb_glib_1_0_la_LDFLAGS =	\
+libdesktopcouch_glib_1_0_la_LDFLAGS =	\
 	-version-info $(LIBCOUCHDBGLIB_CURRENT):$(LIBCOUCHDBGLIB_REVISION):$(LIBCOUCHDBGLIB_AGE)
 
-hdir = $(includedir)/couchdb-glib-1.0
-h_DATA = 				\
-	couchdb.h			\
-	couchdb-glib.h			\
-	couchdb-database-info.h		\
-	couchdb-document-contact.h	\
-	couchdb-document.h		\
-	couchdb-document-info.h		\
-	couchdb-struct-field.h		\
-	couchdb-types.h
-
-EXTRA_DIST = $(h_DATA) couchdb-marshal.list $(MARSHAL_FILES) $(OAUTH_FILES)
-BUILT_SOURCES = $(MARSHAL_FILES)
-CLEANFILES = $(BUILT_SOURCES)
+hdir = $(includedir)/desktopcouch-glib-1.0
+h_DATA = 			\
+	desktopcouch-glib.h	\
+	desktopcouch.h
 
 if HAVE_INTROSPECTION
 
-BUILT_SOURCES += Couchdb-1.0.gir Couchdb-1.0.typelib
+BUILT_SOURCES = Desktopcouch-1.0.gir Desktopcouch-1.0.typelib
 
 girdir = $(datadir)/gir-1.0
-gir_DATA = Couchdb-1.0.gir
+gir_DATA = Desktopcouch-1.0.gir
 
 typelibsdir = $(libdir)/girepository-1.0/
-typelibs_DATA = Couchdb-1.0.typelib
+typelibs_DATA = Desktopcouch-1.0.typelib
 
-Couchdb-1.0.gir: libcouchdb-glib-1.0.la
+Desktopcouch-1.0.gir: libdesktopcouch-glib-1.0.la
 	$(INTROSPECTION_SCANNER) -v \
-        --namespace Couchdb --nsversion=1.0 \
-        --add-include-path=$(srcdir) \
-        --add-include-path=. \
-        --include=GObject-2.0 \
-        --include=Json-1.0 \
-        --library=couchdb-glib-1.0 \
-        --pkg gobject-2.0 \
-        --pkg json-glib-1.0 \
-        --output $@ \
-        -I$(top_srcdir) \
-        $(h_DATA) \
-        $(libcouchdb_glib_1_0_la_headers) \
-        $(libcouchdb_glib_1_0_la_sources)
-
-Couchdb-1.0.typelib: Couchdb-1.0.gir
+	--namespace Desktopcouch --nsversion=1.0 \
+	--add-include-path=$(srcdir) \
+	--add-include-path=. \
+	--include=GObject-2.0 \
+	--include=Json-1.0 \
+	--include=Couchdb-1.0 \
+	--library=desktopcouch-glib-1.0 \
+	--pkg gobject-2.0 \
+	--pkg json-glib-1.0 \
+	--output $@ \
+	-I$(top_srcdir)/couchdb-glib \
+	-l$(top_builddir)/couchdb-glib/libcouchdb-glib-1.0.la \
+	$(h_DATA) \
+	$(libdesktopcouch_glib_1_0_la_headers) \
+	$(libdesktopcouch_glib_1_0_la_SOURCES)
+
+Desktopcouch-1.0.typelib: Desktopcouch-1.0.gir
 	LD_LIBRARY_PATH=.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
 	$(INTROSPECTION_COMPILER) \
-        --includedir=$(srcdir) \
+	--includedir=$(srcdir) \
 	--includedir=. \
 	$(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
 
diff --git a/desktopcouch-glib/desktopcouch-glib.h b/desktopcouch-glib/desktopcouch-glib.h
index cebc9b4..23a8d73 100644
--- a/desktopcouch-glib/desktopcouch-glib.h
+++ b/desktopcouch-glib/desktopcouch-glib.h
@@ -1,10 +1,8 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2009 Canonical Services Ltd (www.canonical.com)
- *               2009 Mikkel Kamstrup Erlandsen
  *
  * Authors: Rodrigo Moya <rodrigo moya canonical com>
- *          Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU Lesser General Public
@@ -21,15 +19,9 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef __COUCHDB_GLIB_H__
-#define __COUCHDB_GLIB_H__
+#ifndef __DESKTOPCOUCH_GLIB_H__
+#define __DESKTOPCOUCH_GLIB_H__
 
-#include <couchdb-types.h>
-#include <couchdb.h>
-#include <couchdb-database-info.h>
-#include <couchdb-document.h>
-#include <couchdb-document-contact.h>
-#include <couchdb-document-info.h>
-#include <couchdb-struct-field.h>
+#include <desktopcouch.h>
 
-#endif /* __COUCHDB_GLIB_H__ */
+#endif /* __DESKTOPCOUCH_GLIB_H__ */
diff --git a/desktopcouch-glib/desktopcouch.c b/desktopcouch-glib/desktopcouch.c
index 97a73e1..710107c 100644
--- a/desktopcouch-glib/desktopcouch.c
+++ b/desktopcouch-glib/desktopcouch.c
@@ -19,30 +19,37 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#include "desktopcouchdb.h"
+#include "desktopcouch.h"
 
-G_DEFINE_TYPE(Desktopcouchdb, desktopcouchdb, COUCHDB_TYPE)
+G_DEFINE_TYPE(Desktopcouch, desktopcouch, COUCHDB_TYPE)
 
 static void
-desktopcouchdb_finalize (GObject *object)
+desktopcouch_finalize (GObject *object)
 {
-	G_OBJECT_CLASS (desktopcouchdb_parent_class)->finalize (object);
+	G_OBJECT_CLASS (desktopcouch_parent_class)->finalize (object);
 }
 
 static void
-desktopcouchdb_class_init (DesktopcouchdbClass *klass)
+desktopcouch_class_init (DesktopcouchClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-	object_class->finalize = desktopcouchdb_finalize;
+	object_class->finalize = desktopcouch_finalize;
 }
 
 static void
-desktopcouchdb_init (Desktopcouchdb *dc)
+desktopcouch_init (Desktopcouch *dc)
 {
 }
 
 /**
- * desktopcouchdb_new:
+ * desktopcouch_new:
  *
- * Create a #Couchdb instance prepared to connect to desktopcouch
+ * Create a #Couchdb instance prepared to connect to desktopcouch.
+ *
+ * Return value: A #Couchdb instance.
+ */
+Desktopcouch *
+desktopcouch_new (void)
+{
+}
diff --git a/desktopcouch-glib/desktopcouch.h b/desktopcouch-glib/desktopcouch.h
index e93af72..365e31f 100644
--- a/desktopcouch-glib/desktopcouch.h
+++ b/desktopcouch-glib/desktopcouch.h
@@ -19,30 +19,30 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef __DESKTOPCOUCHDB_H__
-#define __DESKTOPCOUCHDB_H__
+#ifndef __DESKTOPCOUCH_H__
+#define __DESKTOPCOUCH_H__
 
 #include <couchdb-glib.h>
 
 G_BEGIN_DECLS
 
-#define DESKTOPCOUCHDB_TYPE                (desktopcouchdb_get_type ())
-#define DESKTOPCOUCHDB(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), DESKTOPCOUCHDB_TYPE, Desktopcouchdb))
-#define DESKTOPCOUCHDB_IS(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DESKTOPCOUCHDB_TYPE))
-#define DESKTOPCOUCHDB_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), DESKTOPCOUCHDB_TYPE, DesktopcouchdbClass))
-#define DESKTOPCOUCHDB_IS_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), DESKTOPCOUCHDB_TYPE))
-#define DESKTOPCOUCHDB_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), DESKTOPCOUCHDB_TYPE, DesktopouchdbClass))
+#define DESKTOPCOUCH_TYPE                (desktopcouchdb_get_type ())
+#define DESKTOPCOUCH(obj)                (G_TYPE_CHECK_INSTANCE_CAST ((obj), DESKTOPCOUCH_TYPE, Desktopcouch))
+#define DESKTOPCOUCH_IS(obj)             (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DESKTOPCOUCH_TYPE))
+#define DESKTOPCOUCH_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST ((klass), DESKTOPCOUCH_TYPE, DesktopcouchClass))
+#define DESKTOPCOUCH_IS_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), DESKTOPCOUCH_TYPE))
+#define DESKTOPCOUCH_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), DESKTOPCOUCH_TYPE, DesktopouchClass))
 
 typedef struct {
 	Couchdb parent;
-} Desktopcouchdb;
+} Desktopcouch;
 
 typedef struct {
 	CouchdbClass parent_class;
-} DesktopcouchdbClass;
+} DesktopcouchClass;
 
-GType           desktopcouchdb_get_type (void);
-Desktopcouchdb *desktopcouchdb_new (void);
+GType         desktopcouch_get_type (void);
+Desktopcouch *desktopcouch_new (void);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]