Change in osmo-pcap[master]: Install cfg files with autotools

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Wed Oct 31 12:19:57 UTC 2018


Pau Espin Pedrol has uploaded this change for review. ( https://gerrit.osmocom.org/11546


Change subject: Install cfg files with autotools
......................................................................

Install cfg files with autotools

Cfg files are moved to doc/examples like in other osmocom projects.
All the cfg files get installed into
$prefix/share/doc/osmo-trx/examples/$subdir/, and 1 script per binary is
installed into /etc/osmocom.

Change-Id: If3f3a7d3867c0d4d2b1fe01f465532d1ce4bda66
---
M Makefile.am
M configure.ac
M contrib/Makefile.am
M debian/osmo-pcap-client.install
M debian/osmo-pcap-server.install
M debian/rules
A doc/Makefile.am
A doc/examples/Makefile.am
R doc/examples/osmo-pcap-client/osmo-pcap-client-tls.cfg
R doc/examples/osmo-pcap-client/osmo-pcap-client.cfg
R doc/examples/osmo-pcap-server/osmo-pcap-server-tls.cfg
R doc/examples/osmo-pcap-server/osmo-pcap-server.cfg
12 files changed, 40 insertions(+), 13 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-pcap refs/changes/46/11546/1

diff --git a/Makefile.am b/Makefile.am
index 61eb85d..cf8dfa3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
 
-SUBDIRS = include src contrib tests
+SUBDIRS = include src contrib doc tests
 
 BUILT_SOURCES = $(top_srcdir)/.version
 EXTRA_DIST = git-version-gen .version
diff --git a/configure.ac b/configure.ac
index a0f786f..b16ae13 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,5 +138,7 @@
     src/Makefile
     contrib/Makefile
     contrib/systemd/Makefile
+    doc/Makefile
+    doc/examples/Makefile
     tests/Makefile
     Makefile)
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 7bd8c23..e1927a7 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,3 +1,2 @@
 SUBDIRS = systemd
 dist_pkgdata_DATA = osmo_pcap_clean_old
-EXTRA_DIST = osmo-pcap-server.cfg osmo-pcap-client.cfg
diff --git a/debian/osmo-pcap-client.install b/debian/osmo-pcap-client.install
index ac7c65c..ef6576e 100644
--- a/debian/osmo-pcap-client.install
+++ b/debian/osmo-pcap-client.install
@@ -1,2 +1,5 @@
+etc/osmocom/osmo-pcap-client.cfg
 lib/systemd/system/osmo-pcap-client.service
 usr/bin/osmo-pcap-client
+usr/share/doc/osmo-pcap/examples/osmo-pcap-client/osmo-pcap-client.cfg
+usr/share/doc/osmo-pcap/examples/osmo-pcap-client/osmo-pcap-client-tls.cfg
diff --git a/debian/osmo-pcap-server.install b/debian/osmo-pcap-server.install
index 6ba698e..cedee92 100644
--- a/debian/osmo-pcap-server.install
+++ b/debian/osmo-pcap-server.install
@@ -1,2 +1,5 @@
+etc/osmocom/osmo-pcap-server.cfg
 lib/systemd/system/osmo-pcap-server.service
 usr/bin/osmo-pcap-server
+usr/share/doc/osmo-pcap/examples/osmo-pcap-server/osmo-pcap-server.cfg
+usr/share/doc/osmo-pcap/examples/osmo-pcap-server/osmo-pcap-server-tls.cfg
diff --git a/debian/rules b/debian/rules
index a9a8b30..90bd79e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,17 +21,6 @@
 		PCAP_CFLAGS=$(PCAP_CFLAGS) \
 		PCAP_LIBS=$(PCAP_LIBS)
 
-override_dh_auto_install:
-	dh_auto_install $@
-	install -d -m 0755 $(CURDIR)/debian/osmo-pcap-client/etc/osmo-pcap/
-	install -m 0644 $(CURDIR)/contrib/osmo-pcap-client.cfg $(CURDIR)/debian/osmo-pcap-client/etc/osmo-pcap
-
-	install -d -m 0755 $(CURDIR)/debian/osmo-pcap-server/etc/osmo-pcap/
-	install -m 0644 $(CURDIR)/contrib/osmo-pcap-server.cfg $(CURDIR)/debian/osmo-pcap-server/etc/osmo-pcap
-
-	install -d -m 0755 $(CURDIR)/debian/osmo-pcap-server/etc/cron.daily/
-	install -m 0755 $(CURDIR)/contrib/osmo_pcap_clean_old $(CURDIR)/debian/osmo-pcap-server/etc/cron.daily/
-
 override_dh_strip:
 	dh_strip -posmo-pcap-client --dbg-package=osmo-pcap-client-dbg
 	dh_strip -posmo-pcap-server --dbg-package=osmo-pcap-server-dbg
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..aee2d7b
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = examples
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
new file mode 100644
index 0000000..9337c9e
--- /dev/null
+++ b/doc/examples/Makefile.am
@@ -0,0 +1,30 @@
+OSMOCONF_FILES = \
+	osmo-pcap-client/osmo-pcap-client.cfg \
+	osmo-pcap-server/osmo-pcap-server.cfg
+
+osmoconfdir = $(sysconfdir)/osmocom
+osmoconf_DATA = $(OSMOCONF_FILES)
+EXTRA_DIST = $(OSMOCONF_FILES)
+
+CFG_FILES = find $(srcdir) -type f -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/contrib/osmo-pcap-client-tls.cfg b/doc/examples/osmo-pcap-client/osmo-pcap-client-tls.cfg
similarity index 100%
rename from contrib/osmo-pcap-client-tls.cfg
rename to doc/examples/osmo-pcap-client/osmo-pcap-client-tls.cfg
diff --git a/contrib/osmo-pcap-client.cfg b/doc/examples/osmo-pcap-client/osmo-pcap-client.cfg
similarity index 100%
rename from contrib/osmo-pcap-client.cfg
rename to doc/examples/osmo-pcap-client/osmo-pcap-client.cfg
diff --git a/contrib/osmo-pcap-server-tls.cfg b/doc/examples/osmo-pcap-server/osmo-pcap-server-tls.cfg
similarity index 100%
rename from contrib/osmo-pcap-server-tls.cfg
rename to doc/examples/osmo-pcap-server/osmo-pcap-server-tls.cfg
diff --git a/contrib/osmo-pcap-server.cfg b/doc/examples/osmo-pcap-server/osmo-pcap-server.cfg
similarity index 100%
rename from contrib/osmo-pcap-server.cfg
rename to doc/examples/osmo-pcap-server/osmo-pcap-server.cfg

-- 
To view, visit https://gerrit.osmocom.org/11546
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcap
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: If3f3a7d3867c0d4d2b1fe01f465532d1ce4bda66
Gerrit-Change-Number: 11546
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181031/12f21966/attachment.htm>


More information about the gerrit-log mailing list