From 7e3ef275f870737b853fda3e007e74de2112a7d5 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 8 May 2019 17:58:09 +0200 Subject: Added install script Co-authored-by: LarsVomMars --- Makefile | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bfb8b58 --- /dev/null +++ b/Makefile @@ -0,0 +1,27 @@ +.PHONY: all + +all: clean build + +clean: + $(RM) -rv build/ out/ *.class + +build: + gradle build + @echo Success! The .jar file should be in build/libs/. You may want to use \'sudo make install\' now. + +install: +ifdef OS + @echo Kloud can't be installed on Windows currently, please execute the jar file manually +else + ifeq ($(shell uname), Linux) + mkdir -p /usr/share/kloud/ + userdel kloud || true + useradd -r -d /usr/share/kloud kloud || true + chown -R kloud /usr/share/kloud + cp build/libs/kloud-*-all.jar /usr/share/kloud/ + echo -e "#!/bin/sh\nsudo -u kloud java -jar /usr/share/kloud/kloud-*-all.jar \$$@" > /usr/bin/kloud + chmod +x /usr/bin/kloud + else + @echo This OS doesn't support out automatic installation, please execute the jar file manually + endif +endif -- cgit v1.2.3