From 66f009098920dc194be4cc90a8a82933748ba73b Mon Sep 17 00:00:00 2001 From: Michael Holzheu Date: Mon, 6 Nov 2017 17:27:17 +0100 Subject: [PATCH] systemd: Install also the unit configuration files If SYSTEMDSYSTEMUNITDIR is defined, the systemd units are automatically installed. Therefore consequently also install the required config files in that case. Example: $ make install SYSTEMDSYSTEMUNITDIR=/usr/lib/systemd/system/ Reviewed-by: Benjamin Block Signed-off-by: Michael Holzheu --- Makefile | 2 +- common.mak | 3 ++- etc/Makefile | 16 ++++++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 etc/Makefile diff --git a/Makefile b/Makefile index 9018d3b9..3c9e609d 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ TOOL_DIRS = zipl zdump fdasd dasdfmt dasdview tunedasd \ tape390 osasnmpd qetharp ip_watcher qethconf scripts zconf \ vmconvert vmcp man mon_tools dasdinfo vmur cpuplugd ipl_tools \ ziomon iucvterm hyptop cmsfs-fuse qethqoat zfcpdump zdsfs cpumf \ - systemd hmcdrvfs cpacfstats zdev dump2tar zkey netboot + systemd hmcdrvfs cpacfstats zdev dump2tar zkey netboot etc SUB_DIRS = $(LIB_DIRS) $(TOOL_DIRS) all: $(TOOL_DIRS) diff --git a/common.mak b/common.mak index a583eff9..b9a9f546 100644 --- a/common.mak +++ b/common.mak @@ -173,7 +173,8 @@ ZFCPDUMP_DIR = $(TOOLS_LIBDIR)/zfcpdump SYSTEMDSYSTEMUNITDIR = INSTDIRS = $(USRSBINDIR) $(USRBINDIR) $(BINDIR) $(LIBDIR) $(MANDIR) \ - $(SYSCONFDIR) $(TOOLS_LIBDIR) $(TOOLS_DATADIR) \ + $(SYSCONFDIR) $(SYSCONFDIR)/sysconfig \ + $(TOOLS_LIBDIR) $(TOOLS_DATADIR) \ $(ZFCPDUMP_DIR) $(SYSTEMDSYSTEMUNITDIR) OWNER = $(shell id -un) GROUP = $(shell id -gn) diff --git a/etc/Makefile b/etc/Makefile new file mode 100644 index 00000000..cf5c59b3 --- /dev/null +++ b/etc/Makefile @@ -0,0 +1,16 @@ +include ../common.mak + +CONFIG_FILES = + +ifneq (${SYSTEMDSYSTEMUNITDIR},) +CONFIG_FILES += cpuplugd.conf sysconfig/cpi sysconfig/dumpconf \ + sysconfig/mon_fsstatd sysconfig/mon_procd +endif + +install: + for file in $(CONFIG_FILES); do \ + $(INSTALL) -g $(GROUP) -o $(OWNER) \ + -m 644 $$file $(DESTDIR)$(SYSCONFDIR)/$$file ; \ + done + +.PHONY: all install clean