Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 clsync (0.3-1) unstable; urgency=medium
 .
   [ Dmitry Yu Okunev ]
   * Added support of control socket
 .
   [ Barak A. Pearlmutter ]
   * New upstream version
   * Bump standards version
   * Remove -*- makefile -*- in debian/rules: defaults to GNUmakefile-mode
   * Must generate library: ./configure --enable-socket
   * Fold clsync-dev into libclsync-dev
   * Address lintian issues
     - Add appropriate per-binary-package sections
     - Remove extra LICENSE file
     - Rename lib package w/ .so suffix "0"
     - Expand and diversify package descriptions.
   * Add dependency of lib-dev package upon lib package
   * Print list of debian/tmp files not installed into any binary package
   * Install some stray uninstalled files
     - the actual clsync executable (!)
     - its man page
     - some *.h header files
   * Fold small (14k) clsync-doc package into clsync
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- clsync-0.3.orig/Makefile.am
+++ clsync-0.3/Makefile.am
@@ -1,5 +1,12 @@
+ACLOCAL_AMFLAGS = -I m4
+SUBDIRS = examples
+
 bin_PROGRAMS = clsync
-clsync_SOURCES = sync.c cluster.c main.c error.c fileutils.c malloc.c glibex.c
+
+clsync_SOURCES = cluster.c error.c fileutils.c glibex.c main.c		\
+	malloc.c sync.c cluster.h fileutils.h glibex.h main.h sync.h	\
+	common.h control.h
+
 clsync_CFLAGS = $(AM_CFLAGS)
 
 if SOCKET
@@ -11,15 +18,11 @@ endif
 
 main.o: revision.h
 
-man_MANS = man/man1/clsync.1
+dist_man_MANS = man/man1/clsync.1
 
-doc_DATA = CONTRIB DEVELOPING LICENSE PROTOCOL README.md TODO
+dist_doc_DATA = CONTRIB DEVELOPING LICENSE PROTOCOL README.md TODO
 
-exampledir=$(docdir)/examples
-
-example_DATA = \
- $(wildcard $(srcdir)/examples/*.c) \
- $(wildcard $(srcdir)/examples/*.sh)
+EXTRA_DIST = .doxygen .travis.sh .travis.yml NOTES SHORTHANDS debian gentoo
 
 REVISION=$(shell [ -d .git ] &&\
 	(echo -n \
@@ -47,16 +50,9 @@ clsync_include_HEADERS = \
 doc:
 	doxygen .doxygen
 
-install-data-local:
 if SOCKET
-	mkdir -p $(DESTDIR)/$(libdir)/pkgconfig
-	cp pkgconfig/*.pc $(DESTDIR)/$(libdir)/pkgconfig/
+pkgconfig_DATA = pkgconfig/clsync.pc
 endif
-	mkdir -p $(DESTDIR)/$(exampledir)
-	cp -R examples/production $(DESTDIR)/$(exampledir)/
-
-uninstall-local:
-	rm -rf $(DESTDIR)/$(exampledir)/production
 
 CLEANFILES = revision.h
 CLEANFILES += examples/rules
--- clsync-0.3.orig/configure.ac
+++ clsync-0.3/configure.ac
@@ -4,12 +4,15 @@
 AC_PREREQ([2.59])
 AC_INIT([clsync],[0.3],[Dmitry Yu Okunev <dyokunev@ut.mephi.ru>],,[https://github.com/xaionaro/clsync])
 AC_CONFIG_SRCDIR([sync.c])
+AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([1.11 foreign -Wall -Wno-portability])
 AC_CONFIG_HEADERS([config.h])
 AM_PROG_CC_C_O
 
 LT_INIT
 
+PKG_INSTALLDIR
+
 dnl --enable-cluster
 AC_ARG_ENABLE(cluster,
 AS_HELP_STRING(--enable-cluster,
@@ -107,5 +110,5 @@ AM_CPPFLAGS="${GLIB_CFLAGS}"
 AC_SUBST(AM_CPPFLAGS)
 
 
-AC_CONFIG_FILES([Makefile pkgconfig/clsync.pc])
+AC_CONFIG_FILES([Makefile examples/Makefile pkgconfig/clsync.pc])
 AC_OUTPUT
--- /dev/null
+++ clsync-0.3/examples/Makefile.am
@@ -0,0 +1,28 @@
+exampledir=$(docdir)/examples
+
+# example_DATA = \
+#  $(wildcard $(srcdir)/*.c) \
+#  $(wildcard $(srcdir)/*.sh)
+
+dist_example_DATA = clsync-synchandler-rsyncso.c clsync-synchandler-so.c
+
+dist_example_SCRIPTS = clsync-start-cluster.sh			\
+	clsync-start-rsyncdirect.sh clsync-start-rsyncshell.sh	\
+	clsync-start-rsyncso.sh clsync-start-so.sh		\
+	clsync-synchandler-rsyncshell.sh
+
+# find production -type f -name '*.sh'
+nobase_dist_example_SCRIPTS =					\
+	 production/etc/clsync/hooks/lxc/exit-backup.sh		\
+	 production/etc/clsync/hooks/lxc/exit-brother.sh	\
+	 production/etc/clsync/synchandler/lxc/backup.sh	\
+	 production/etc/clsync/synchandler/lxc/brother.sh
+
+# find production -type f -not -name '*.sh'
+nobase_dist_example_DATA = production/etc/clsync/rules/hpc	\
+	 production/etc/clsync/rules/hpc-backup			\
+	 production/etc/clsync/rules/lxc			\
+	 production/etc/clsync/synchandler/hpc/handler-backup.c	\
+	 production/etc/clsync/synchandler/hpc/handler-pdcp.c	\
+	 production/etc/clsync/synchandler/lxc/rsync.exclude	\
+	 production/etc/clsync/clsync.conf
