examples: automatically copy all examples in dist and install it to docdir
diff --git a/openbsc/Makefile.am b/openbsc/Makefile.am
index b2522ca..b966e69 100644
--- a/openbsc/Makefile.am
+++ b/openbsc/Makefile.am
@@ -1,7 +1,7 @@
 AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
 
 INCLUDES = $(all_includes) -I$(top_srcdir)/include
-SUBDIRS = include src tests
+SUBDIRS = doc include src tests
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = openbsc.pc
diff --git a/openbsc/configure.in b/openbsc/configure.in
index a2d987f..e9bc079 100644
--- a/openbsc/configure.in
+++ b/openbsc/configure.in
@@ -110,4 +110,6 @@
     tests/channel/Makefile
     tests/bsc-nat/Makefile
     tests/mgcp/Makefile
+    doc/Makefile
+    doc/examples/Makefile
     Makefile)
diff --git a/openbsc/doc/Makefile.am b/openbsc/doc/Makefile.am
new file mode 100644
index 0000000..aee2d7b
--- /dev/null
+++ b/openbsc/doc/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = examples
diff --git a/openbsc/doc/examples/Makefile.am b/openbsc/doc/examples/Makefile.am
new file mode 100644
index 0000000..b7eda49
--- /dev/null
+++ b/openbsc/doc/examples/Makefile.am
@@ -0,0 +1,16 @@
+
+CFG_FILES = find $(srcdir) -name '*.cfg*' | sed -e 's,^$(srcdir),,'
+
+dist-hook:
+	for f in $$($(CFG_FILES)); do \
+		j="$(distdir)/$$f" && \
+		mkdir -p "$$(dirname $$j)" && \
+		$(INSTALL_DATA) $(srcdir)/$$f $$j; \
+	done
+
+install-data-hook:
+	for f in $$($(CFG_FILES)); do \
+		j="$(DESTDIR)$(docdir)/examples/$$f" && \
+		mkdir -p "$$(dirname $$j)" && \
+		$(INSTALL_DATA) $(srcdir)/$$f $$j; \
+	done
diff --git a/openbsc/doc/examples/mgcp.cfg b/openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
similarity index 100%
rename from openbsc/doc/examples/mgcp.cfg
rename to openbsc/doc/examples/osmo-bsc_mgcp/mgcp.cfg
diff --git a/openbsc/doc/examples/openbsc.cfg.1-2-hopping b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg
similarity index 100%
rename from openbsc/doc/examples/openbsc.cfg.1-2-hopping
rename to openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx-hopping.cfg
diff --git a/openbsc/doc/examples/openbsc.cfg.1-2 b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg
similarity index 100%
rename from openbsc/doc/examples/openbsc.cfg.1-2
rename to openbsc/doc/examples/osmo-nitb/bs11/openbsc-1bts-2trx.cfg
diff --git a/openbsc/doc/examples/openbsc.cfg.2-2 b/openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg
similarity index 100%
rename from openbsc/doc/examples/openbsc.cfg.2-2
rename to openbsc/doc/examples/osmo-nitb/bs11/openbsc-2bts-2trx.cfg
diff --git a/openbsc/doc/examples/openbsc.cfg.1-1 b/openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg
similarity index 100%
rename from openbsc/doc/examples/openbsc.cfg.1-1
rename to openbsc/doc/examples/osmo-nitb/bs11/openbsc.cfg
diff --git a/openbsc/doc/examples/openbsc.cfg.nanobts.multitrx b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg
similarity index 100%
rename from openbsc/doc/examples/openbsc.cfg.nanobts.multitrx
rename to openbsc/doc/examples/osmo-nitb/nanobts/openbsc-multitrx.cfg
diff --git a/openbsc/doc/examples/openbsc.cfg.nanobts b/openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg
similarity index 100%
rename from openbsc/doc/examples/openbsc.cfg.nanobts
rename to openbsc/doc/examples/osmo-nitb/nanobts/openbsc.cfg
diff --git a/openbsc/doc/examples/openbsc.cfg.rbs2308-4trx b/openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg
similarity index 100%
rename from openbsc/doc/examples/openbsc.cfg.rbs2308-4trx
rename to openbsc/doc/examples/osmo-nitb/rbs2308/openbsc.cfg