From e4b0a9391be1d21ca15d9610b977f989ccee833a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 20 Aug 2017 15:52:51 -0400 Subject: prepare for autothing --- .gitignore | 2 ++ Makefile | 31 +++++++++++++++++++++++++++++++ config.mk | 12 ++++++++++++ read-systemd.conf | 12 ------------ systemd.conf.in | 12 ++++++++++++ 5 files changed, 57 insertions(+), 12 deletions(-) create mode 100644 Makefile create mode 100644 config.mk delete mode 100644 read-systemd.conf create mode 100644 systemd.conf.in diff --git a/.gitignore b/.gitignore index 0d20b64..1f28878 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *.pyc +/systemd.conf +/collectd-* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0aa88a4 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +PACKAGE = collectd-systemd +VERSION = 20170820 + +include $(dir $(lastword $(MAKEFILE_LIST)))/config.mk +include $(topsrcdir)/build-aux/Makefile.head.mk + +files.out.all += systemd.conf +#files.out.all += systemd.types.db +#files.out.all += systemd.py + +files.sys.all += $(collectdconfdir)/systemd.conf +files.sys.all += $(collectdtypesdir)/systemd.types.db +files.sys.all += $(collectdpythondir)/systemd.py + +$(outdir)/%: $(srcdir)/%.in + sed $(foreach v,$(patsubst $(var.)%,%,$(filter $(var.)%,$^)), -e 's|@$(v)@|$($(v))|g' ) < $< > $@ + +$(outdir)/systemd.conf: $(var.)collectd_typesdir +$(outdir)/systemd.conf: $(var.)collectd_pythondir + +$(DESTDIR)$(collectdconfdir)/systemd.conf: $(outdir)/systemd.conf + $(INSTALL_DATA) -DT $< $@ +$(DESTDIR)$(collectdtypesdir)/systemd.types.db: $(srcdir)/systemd.types.db + $(INSTALL_DATA) -DT $< $@ +$(DESTDIR)$(collectdpythondir)/systemd.py: $(srcdir)/systemd.py + $(INSTALL_PROGRAM) -DT $< $@ + +.SECONDARY: +.DELETE_ON_ERROR: + +include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..46cbc00 --- /dev/null +++ b/config.mk @@ -0,0 +1,12 @@ +# In addition to the variables in the default version of this file, +# you may set any of the standard GNU configuration variables. +ifeq ($(origin topsrcdir),undefined) +topoutdir := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST)))) +topsrcdir := $(topoutdir) + +collectd_pkgdatadir = $(datadir)/collectd +collectd_confdir = $(collectd_pkgdatadir) +collectd_typesdir = $(collectd_pkgdatadir) +collectd_pythondir = $(collectd_pkgdatadir) + +endif diff --git a/read-systemd.conf b/read-systemd.conf deleted file mode 100644 index f3870b6..0000000 --- a/read-systemd.conf +++ /dev/null @@ -1,12 +0,0 @@ -TypesDB "/home/luke/src/collectd-systemd/systemd.types.db" - -LoadPlugin python - - ModulePath "/home/luke/src/collectd-systemd" - LogTraces true - Interactive false - Import "systemd" - - - - diff --git a/systemd.conf.in b/systemd.conf.in new file mode 100644 index 0000000..b07019f --- /dev/null +++ b/systemd.conf.in @@ -0,0 +1,12 @@ +TypesDB "@collectd_typesdir@/systemd.types.db" + +LoadPlugin python + + ModulePath "@collectd_pythondir@" + LogTraces true + Interactive false + Import "systemd" + + + + -- cgit v1.2.3-2-g168b