diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/autogen.sh dovecot-metadata/autogen.sh
--- dovecot-metadata-0.14.0.orig/autogen.sh	2013-05-14 10:13:53.000000000 +0200
+++ dovecot-metadata/autogen.sh	2013-07-26 10:35:35.000000000 +0200
@@ -4,4 +4,4 @@
 test -d m4 || mkdir m4
 
 echo '+ running autoreconf ...'
-autoreconf --force --install
+autoreconf --force --install -v
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/configure.ac dovecot-metadata/configure.ac
--- dovecot-metadata-0.14.0.orig/configure.ac	2013-05-14 10:13:53.000000000 +0200
+++ dovecot-metadata/configure.ac	2013-07-26 10:35:35.000000000 +0200
@@ -10,6 +10,9 @@
 AC_CONFIG_SRCDIR([src])
 
 
+AM_MAINTAINER_MODE
+
+
 AC_PROG_CC_C99
 AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"],
 	[AC_MSG_ERROR([C99 support required])]
@@ -17,6 +20,12 @@
 
 DC_DOVECOT([2.0])
 
+# Define metadata documentation install dir
+#
+
+metadata_docdir='${dovecot_docdir}/metadata'
+AC_SUBST(metadata_docdir)
+
 
 AC_ARG_ENABLE([debug],
 	[AS_HELP_STRING([--enable-debug],
@@ -24,6 +33,15 @@
 	[],
 	[enable_debug=no]
 )
+AC_ARG_WITH(docs,
+[  --with-docs             Install documentation (default)],
+    if test x$withval = xno; then
+        want_docs=no
+    else
+        want_docs=yes
+    fi,
+    want_docs=yes)
+AM_CONDITIONAL(BUILD_DOCS, test "$want_docs" = "yes")
 AC_MSG_CHECKING([whether to enable debugging])
 AC_MSG_RESULT([$enable_debug])
 AS_IF([test "x$enable_debug" = "xyes"],
@@ -37,5 +55,8 @@
 AC_CONFIG_FILES([
 	Makefile
 	src/Makefile
+	doc/Makefile
+	doc/example-config/Makefile
+	doc/example-config/conf.d/Makefile
 ])
 AC_OUTPUT
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/10-metadata-mail.conf dovecot-metadata/doc/example-config/conf.d/10-metadata-mail.conf
--- dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/10-metadata-mail.conf	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/example-config/conf.d/10-metadata-mail.conf	2013-07-27 14:16:56.000000000 +0200
@@ -0,0 +1,9 @@
+#stub copied form 
+# Email [Dovecot] dovecot-metadata-8 released
+# by Dennis Schridde devurandom at gmx.net 
+# on Sun Jun 12 16:55:57 EEST 2011
+#
+#use this to configure the meta data plugin
+
+#addjust the corresponding line in the 10-mail.conf file
+mail_plugins = ... metadata
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/20-metadata-imap.conf dovecot-metadata/doc/example-config/conf.d/20-metadata-imap.conf
--- dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/20-metadata-imap.conf	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/example-config/conf.d/20-metadata-imap.conf	2013-07-27 14:16:56.000000000 +0200
@@ -0,0 +1,12 @@
+#stub copied form 
+# Email [Dovecot] dovecot-metadata-8 released
+# by Dennis Schridde devurandom at gmx.net 
+# on Sun Jun 12 16:55:57 EEST 2011
+#
+#use this to configure the meta data plugin
+
+# add this to the protocol imap section in the 20-imap.conf file
+# protocol imap {
+#   mail_plugins = $mail_plugins ... imap_metadata imap_annotatemore
+#}
+
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/90-metadata.conf dovecot-metadata/doc/example-config/conf.d/90-metadata.conf
--- dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/90-metadata.conf	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/example-config/conf.d/90-metadata.conf	2013-07-26 10:35:35.000000000 +0200
@@ -0,0 +1,11 @@
+#stub copied form 
+# Email [Dovecot] dovecot-metadata-8 released
+# by Dennis Schridde devurandom at gmx.net 
+# on Sun Jun 12 16:55:57 EEST 2011
+#
+#use this to configure the meta data plugin
+
+plugin {
+  metadata_dict = proxy::metadata
+}
+
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/Makefile.am dovecot-metadata/doc/example-config/conf.d/Makefile.am
--- dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/example-config/conf.d/Makefile.am	2013-07-27 14:16:56.000000000 +0200
@@ -0,0 +1,11 @@
+pkgsysconfdir = $(sysconfdir)/dovecot
+
+exampledir = $(dovecot_docdir)/example-config/conf.d
+example_DATA = \
+	10-metadata-mail.conf \
+	20-metadata-imap.conf \
+	90-metadata.conf \
+	metadata-dovecot.conf
+
+EXTRA_DIST = \
+	$(example_DATA)
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/metadata-dovecot.conf dovecot-metadata/doc/example-config/conf.d/metadata-dovecot.conf
--- dovecot-metadata-0.14.0.orig/doc/example-config/conf.d/metadata-dovecot.conf	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/example-config/conf.d/metadata-dovecot.conf	2013-07-27 14:16:56.000000000 +0200
@@ -0,0 +1,12 @@
+#stub copied form 
+# Email [Dovecot] dovecot-metadata-8 released
+# by Dennis Schridde devurandom at gmx.net 
+# on Sun Jun 12 16:55:57 EEST 2011
+#
+#use this to configure the meta data plugin
+
+#add the following to the appropriate section of the dovecot.conf file
+# dict {
+#  metadata = file:/var/lib/dovecot/shared-metadata
+#}
+
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/example-config/Makefile.am dovecot-metadata/doc/example-config/Makefile.am
--- dovecot-metadata-0.14.0.orig/doc/example-config/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/example-config/Makefile.am	2013-07-26 10:35:35.000000000 +0200
@@ -0,0 +1,2 @@
+SUBDIRS = conf.d
+
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/Makefile.am dovecot-metadata/doc/Makefile.am
--- dovecot-metadata-0.14.0.orig/doc/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/Makefile.am	2013-07-26 10:35:35.000000000 +0200
@@ -0,0 +1,15 @@
+SUBDIRS = example-config
+
+docfiles = \
+	script-location-dict.txt
+
+if BUILD_DOCS
+metadata_doc_DATA = $(docfiles)
+endif
+
+EXTRA_DIST = \
+	devel \
+	extensions \
+	plugins \
+	$(docfiles)
+
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/man/Makefile.am dovecot-metadata/doc/man/Makefile.am
--- dovecot-metadata-0.14.0.orig/doc/man/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/man/Makefile.am	2013-08-05 17:57:43.605245649 +0200
@@ -0,0 +1,18 @@
+pkgsysconfdir = $(sysconfdir)/dovecot
+rundir = ${prefix}/var/run/dovecot
+
+# dist_man1_MANS = 
+# 
+# nodist_man1_MANS = 
+# 
+# nodist_man7_MANS = 
+# 
+# man_includefiles = \
+# 	$(srcdir)/reporting-bugs.inc
+# 
+# EXTRA_DIST = \
+# 	sed.sh \
+# 	$(man_includefiles)
+# 
+# CLEANFILES = $(nodist_man1_MANS) $(nodist_man7_MANS)
+# 
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/man/sed.sh dovecot-metadata/doc/man/sed.sh
--- dovecot-metadata-0.14.0.orig/doc/man/sed.sh	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/man/sed.sh	2013-07-26 10:35:35.000000000 +0200
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+SRCDIR="${1:-`pwd`}"
+RUNDIR="${2:-/usr/local/var/run/dovecot}"
+PKGSYSCONFDIR="${3:-/usr/local/etc/dovecot}"
+
+sed -e "/^@INCLUDE:reporting-bugs@$/{
+		r ${SRCDIR}/reporting-bugs.inc
+		d
+	}" | sed -e "s|@pkgsysconfdir@|${PKGSYSCONFDIR}|" -e "s|@rundir@|${RUNDIR}|"
+
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/rfc/Makefile.am dovecot-metadata/doc/rfc/Makefile.am
--- dovecot-metadata-0.14.0.orig/doc/rfc/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/rfc/Makefile.am	2013-08-05 17:56:33.982120994 +0200
@@ -0,0 +1,5 @@
+# docfiles = 
+# 
+# EXTRA_DIST = \
+# 	$(docfiles)
+# 
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/doc/script-location-dict.txt dovecot-metadata/doc/script-location-dict.txt
--- dovecot-metadata-0.14.0.orig/doc/script-location-dict.txt	1970-01-01 01:00:00.000000000 +0100
+++ dovecot-metadata/doc/script-location-dict.txt	2013-07-26 10:35:35.000000000 +0200
@@ -0,0 +1 @@
+ This is just a dummy in case we need it
diff -x .bzr -x .pc -x debian -u -N -r dovecot-metadata-0.14.0.orig/Makefile.am dovecot-metadata/Makefile.am
--- dovecot-metadata-0.14.0.orig/Makefile.am	2013-05-14 10:13:53.000000000 +0200
+++ dovecot-metadata/Makefile.am	2013-07-26 10:35:35.000000000 +0200
@@ -1,3 +1,16 @@
+if BUILD_DOCS
+DOCS = doc
+endif
+
+SUBDIRS = src $(DOCS)
+
 ACLOCAL_AMFLAGS = -I m4
 
-SUBDIRS = src
+pkginc_libdir=$(dovecot_pkgincludedir)/metadata
+nodist_pkginc_lib_HEADERS = metadata-config.h
+
+if MAINTAINER_MODE
+ChangeLog: .hg/dirstate
+        hg log --style=changelog > ChangeLog
+endif
+
