From 8987e074caa3dd4f7edde51e8d2e771dbaca433e Mon Sep 17 00:00:00 2001 From: Ev Kontsevoy Date: Mon, 20 Jun 2016 12:58:09 -0700 Subject: [PATCH] Updating release process to fit documentation --- Makefile | 1 + build.assets/release.mk | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 build.assets/release.mk diff --git a/Makefile b/Makefile index c61694c5f8993..21cd0030157d5 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,7 @@ $(eval BUILDFLAGS := $(ADDFLAGS) -ldflags -w) # .PHONY: all all: setver teleport tctl tsh assets + cp -f build.assets/release.mk $(BUILDDIR)/Makefile .PHONY: tctl tctl: diff --git a/build.assets/release.mk b/build.assets/release.mk new file mode 100644 index 0000000000000..b0d19cdfffd78 --- /dev/null +++ b/build.assets/release.mk @@ -0,0 +1,28 @@ +# This file is distributed with every binary Teleport tarball +BINDIR=/usr/local/bin +VARDIR=/var/lib/teleport +WEBDIR=/usr/local/share/teleport + +# +# sudo make install: installs Teleport into a UNIX-like OS +# +.PHONY: install +install: sudo + mkdir -p $(VARDIR) $(WEBDIR) $(BINDIR) + cp -f teleport tctl tsh $(BINDIR)/ + cp -fr app index.html $(WEBDIR)/ + +# +# sudo make uninstall: removes Teleport +# +.PHONY: uninstall +uninstall: sudo + rm -rf $(VARDIR) $(WEBDIR) $(BINDIR)/tctl $(BINDIR)/teleport $(BINDIR)/tsh + + +# helper: makes sure it runs as root +.PHONY:sudo +sudo: + @if [ $$(id -u) != "0" ]; then \ + echo "ERROR: You must be root" && exit 1 ;\ + fi