From 69130338744c72db61e944d1baf5b6743c11f4e1 Mon Sep 17 00:00:00 2001 From: Lukas Macura Date: Sun, 19 Mar 2017 19:56:58 +0100 Subject: [PATCH] Added tgz package support --- Makefile | 4 ++++ tgz.mk | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tgz.mk diff --git a/Makefile b/Makefile index 642b283..8e15cf1 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ include deb.mk include arch.mk include ipk.mk include rpm.mk +include tgz.mk CONTROLFILES=$(foreach p,$(PLUGINS),$(p)/control.zaf) ZAF_EXPORT_OPTS=$(foreach o,$(ZAF_OPTIONS),$(shell echo $(o)|cut -d '=' -f 1)) @@ -35,6 +36,9 @@ rpm: $(RPM_PKG) ipk: $(IPK_PKG) +tar: tgz +tgz: $(TGZ_PKG) + clean: @rm -rf tmp/* out/* diff --git a/tgz.mk b/tgz.mk new file mode 100644 index 0000000..48b9791 --- /dev/null +++ b/tgz.mk @@ -0,0 +1,32 @@ + +TGZ_DIR=tmp/tgz + +ifeq ($(TGZ_PKG),) + TGZ_PKG=$(shell . lib/zaf.lib.sh; echo out/zaf-$$ZAF_VERSION.tgz) +endif + +$(TGZ_PKG): clean tgz-init tgz-deps tgz-control tgz-scripts tgz-cp tgz-package + +tgz-init: + @mkdir -p $(TGZ_DIR) + +tgz-deps: +tgz-control: +tgz-scripts: +tgz-cp: + @mkdir -p $(TGZ_DIR) + @set -e; INSTALL_PREFIX=$(TGZ_DIR) ZAF_tgzUG=$(ZAF_tgzUG) ./install.sh auto $(ZAF_OPTIONS) ZAF_PLUGINS="$(ZAF_PLUGINS)" $(AGENT_OPTIONS) + @cat lib/*lib.sh install.sh >$(TGZ_DIR)/usr/lib/zaf/install.sh + @chmod +x $(TGZ_DIR)/usr/lib/zaf/install.sh + @rm -rf $(TGZ_DIR)/tmp + @cp $(TGZ_DIR)/etc/zaf.conf tmp/zaf.conf + @grep -E "$$(echo $(ZAF_EXPORT_OPTS) | tr ' ' '|')=" tmp/zaf.conf >$(TGZ_DIR)/etc/zaf.conf +ifneq ($(AGENT_OPTIONS),) + @echo "ZAF_AGENT_OPTIONS=\"$(AGENT_OPTIONS)\"" >>$(TGZ_DIR)/etc/zaf.conf +endif + +tgz-package: + @tar -czf $(TGZ_PKG) -C $(TGZ_DIR) . + @echo PLUGINS embedded: $(ZAF_PLUGINS) + @echo Result: $(TGZ_PKG) +