diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | Makefile | 31 | ||||
-rw-r--r-- | config.mk | 12 | ||||
-rw-r--r-- | systemd.conf.in (renamed from read-systemd.conf) | 4 |
4 files changed, 47 insertions, 2 deletions
@@ -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/systemd.conf.in index f3870b6..b07019f 100644 --- a/read-systemd.conf +++ b/systemd.conf.in @@ -1,8 +1,8 @@ -TypesDB "/home/luke/src/collectd-systemd/systemd.types.db" +TypesDB "@collectd_typesdir@/systemd.types.db" LoadPlugin python <Plugin python> - ModulePath "/home/luke/src/collectd-systemd" + ModulePath "@collectd_pythondir@" LogTraces true Interactive false Import "systemd" |