From 6fcd81d6ba131bd359ce14c9cff91924f0b58676 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Mon, 14 Feb 2022 15:40:22 +0900 Subject: [PATCH] Add Makefile with install and uninstall rules Because foundry does not come with a Makefile or another kind of installation script, users have to install and uninstall it manually. This commit adds a Makefile with rules to install and uninstall foundry. --- Makefile | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f8f6dd7 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +PHONY = install uninstall test + +ifeq ($(PREFIX), ) + PREFIX = /usr +endif + +all: + +clean: + +install: + mkdir -p $(DESTDIR)$(PREFIX)/bin + mkdir -p $(DESTDIR)$(PREFIX)/share/toolbox/include + mkdir -p $(DESTDIR)$(PREFIX)/share/foundry + mkdir -p $(DESTDIR)/var/lib/foundry/contexts + cp -r include $(DESTDIR)$(PREFIX)/share/foundry/. + cp -r src $(DESTDIR)$(PREFIX)/share/foundry/bots + chown -R root.root $(DESTDIR)$(PREFIX)/share/foundry + find $(DESTDIR)$(PREFIX)/share/foundry -type d -exec chmod 755 {} \; + find $(DESTDIR)$(PREFIX)/share/foundry -type f -exec chmod 644 {} \; + find $(DESTDIR)$(PREFIX)/share/foundry/bots -type f -exec chmod 755 {} \; + ln -s $(DESTDIR)$(PREFIX)/share/foundry/bots/buildbot.sh $(DESTDIR)$(PREFIX)/bin/buildbot + ln -s $(DESTDIR)$(PREFIX)/share/foundry/bots/distbot.sh $(DESTDIR)$(PREFIX)/bin/distbot + ln -s $(DESTDIR)$(PREFIX)/share/foundry/bots/signbot.sh $(DESTDIR)$(PREFIX)/bin/signbot + ln -s $(DESTDIR)$(PREFIX)/share/foundry/bots/watchbot.sh $(DESTDIR)$(PREFIX)/bin/watchbot + ln -s $(DESTDIR)$(PREFIX)/share/foundry/include/foundry $(DESTDIR)$(PREFIX)/share/toolbox/include/foundry + +uninstall: + rm $(DESTDIR)$(PREFIX)/bin/buildbot + rm $(DESTDIR)$(PREFIX)/bin/distbot + rm $(DESTDIR)$(PREFIX)/bin/signbot + rm $(DESTDIR)$(PREFIX)/bin/watchbot + rm $(DESTDIR)$(PREFIX)/share/toolbox/include/foundry + rm -rf $(DESTDIR)$(PREFIX)/share/foundry + +.PHONY: $(PHONY) -- 2.47.3