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-pcap/examples/$subdir/, and 1 script per binary is
installed into /etc/osmocom.

Change-Id: If3f3a7d3867c0d4d2b1fe01f465532d1ce4bda66
This commit is contained in:
Pau Espin 2018-10-31 11:05:00 +01:00
parent b29f84ff6c
commit 45283d84e3
12 changed files with 40 additions and 13 deletions

View File

@ -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

View File

@ -145,5 +145,7 @@ AC_OUTPUT(
src/Makefile
contrib/Makefile
contrib/systemd/Makefile
doc/Makefile
doc/examples/Makefile
tests/Makefile
Makefile)

View File

@ -1,3 +1,2 @@
SUBDIRS = systemd
dist_pkgdata_DATA = osmo_pcap_clean_old
EXTRA_DIST = osmo-pcap-server.cfg osmo-pcap-client.cfg

View File

@ -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

View File

@ -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

11
debian/rules vendored
View File

@ -21,17 +21,6 @@ override_dh_auto_configure:
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

1
doc/Makefile.am Normal file
View File

@ -0,0 +1 @@
SUBDIRS = examples

30
doc/examples/Makefile.am Normal file
View File

@ -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