]> git.corax.cc Git - foundry/commitdiff
Add Makefile with install and uninstall rules
authorMatthias Kruk <m@m10k.eu>
Mon, 14 Feb 2022 06:40:22 +0000 (15:40 +0900)
committerMatthias Kruk <m@m10k.eu>
Mon, 14 Feb 2022 06:40:22 +0000 (15:40 +0900)
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 [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
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)