autotools: add documentation example
Change-Id: Ia1fd914662fd49e470d65e08c6fa972c7f680ff5
diff --git a/Makefile.am b/Makefile.am
index 7800cd2..311faf4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,6 +6,7 @@
SUBDIRS = \
daemon \
+ doc \
$(NULL)
BUILT_SOURCES = $(top_srcdir)/.version
diff --git a/configure.ac b/configure.ac
index 67f02bb..94bde9d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,4 +119,6 @@
AC_OUTPUT(
Makefile
daemon/Makefile
+ doc/Makefile
+ doc/examples/Makefile
)
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..5a23107
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = \
+ examples \
+ $(NULL)
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
new file mode 100644
index 0000000..5a8f1fa
--- /dev/null
+++ b/doc/examples/Makefile.am
@@ -0,0 +1,30 @@
+OSMOCONF_FILES = \
+ osmo-uecups-daemon.cfg
+
+osmoconfdir = $(sysconfdir)/osmocom
+osmoconf_DATA = $(OSMOCONF_FILES)
+
+EXTRA_DIST = $(OSMOCONF_FILES)
+
+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
+
+uninstall-hook:
+ @$(PRE_UNINSTALL)
+ for f in $$($(CFG_FILES)); do \
+ j="$(DESTDIR)$(docdir)/examples/$$f" && \
+ $(RM) $$j; \
+ done
diff --git a/doc/examples/osmo-uecups-daemon.cfg b/doc/examples/osmo-uecups-daemon.cfg
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/doc/examples/osmo-uecups-daemon.cfg