summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-17 00:04:36 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-10-17 00:46:57 +0200
commitfa1a0fa5e47260349d2da761b499223d11324b58 (patch)
treef5dc6092e40da84075746a5aa1ab8e7d6ac8bc8d /Makefile
parent777204d72f9d184e4416f943d8a1a38051dfb5ae (diff)
Add xds-agent user systemd service file and install
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 9 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index ae5a69c..eb70258 100644
--- a/Makefile
+++ b/Makefile
@@ -27,9 +27,9 @@ endif
# for backward compatibility
DESTDIR := $(INSTALL_DIR)
-# Configurable variables for installation (default /usr/local/...)
+# Configurable variables for installation (default /opt/AGL/xds/agent)
ifeq ($(origin DESTDIR), undefined)
- DESTDIR := /usr/local/bin
+ DESTDIR := /opt/AGL/xds/agent
endif
HOST_GOOS=$(shell go env GOOS)
@@ -82,9 +82,10 @@ build: tools/syncthing/copytobin
@cd $(ROOT_SRCDIR); $(BUILD_ENV_FLAGS) go build $(VERBOSE_$(V)) -i -o $(LOCAL_BINDIR)/xds-agent$(EXT) -ldflags "$(GORELEASE) -X main.AppVersion=$(VERSION) -X main.AppSubVersion=$(SUB_VERSION)" -gcflags "$(GO_GCFLAGS)" .
package: clean tools/syncthing vendor build
- @mkdir -p $(PACKAGE_DIR)/xds-agent
- @cp agent-config.json.in $(PACKAGE_DIR)/xds-agent/agent-config.json
+ @mkdir -p $(PACKAGE_DIR)/xds-agent $(PACKAGE_DIR)/scripts
@cp -a $(LOCAL_BINDIR)/* $(PACKAGE_DIR)/xds-agent
+ cp -r $(ROOT_SRCDIR)/conf.d $(PACKAGE_DIR)/xds-agent
+ cp -r $(ROOT_SRCDIR)/scripts $(PACKAGE_DIR)/scripts
cd $(PACKAGE_DIR) && zip -r $(ROOT_SRCDIR)/$(PACKAGE_ZIPFILE) ./xds-agent
.PHONY: package-all
@@ -121,8 +122,10 @@ distclean: clean
rm -rf $(LOCAL_BINDIR) tools glide.lock vendor $(ROOT_SRCDIR)/*.zip
.PHONY: install
-install: all
- mkdir -p $(DESTDIR) && cp $(LOCAL_BINDIR)/* $(DESTDIR)
+install:
+ @test -e $(LOCAL_BINDIR)/xds-agent$(EXT) || { echo "Please execute first: make all\n"; exit 1; }
+ @test -e $(LOCAL_BINDIR)/syncthing$(EXT) -a -e $(LOCAL_BINDIR)/syncthing-inotify$(EXT) || { echo "Please execute first: make all\n"; exit 1; }
+ export DESTDIR=$(DESTDIR) && $(ROOT_SRCDIR)/scripts/install.sh
vendor: tools/glide glide.yaml
$(LOCAL_TOOLSDIR)/glide install --strip-vendor