summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 45 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 7442ab2..ed219cc 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
# Open Infrastructure: compute-tools
-# Copyright (C) 2014-2021 Daniel Baumann <daniel.baumann@open-infrastructure.net>
+# Copyright (C) 2014-2022 Daniel Baumann <daniel.baumann@open-infrastructure.net>
#
# SPDX-License-Identifier: GPL-3.0+
#
@@ -25,12 +25,18 @@ PROGRAM = container
SCRIPTS = bin/* libexec/*/*
+VERSION := $(shell cat VERSION.txt)
+
all: build
test:
@echo -n "Checking for syntax errors with sh... "
@for SCRIPT in $(SCRIPTS); \
do \
+ if grep -qs /usr/bin/python3 $${SCRIPT}; \
+ then \
+ continue; \
+ fi; \
sh -n $${SCRIPT}; \
echo -n "."; \
done
@@ -41,6 +47,10 @@ test:
then \
for SCRIPT in $(SCRIPTS); \
do \
+ if grep -qs /usr/bin/python3 $${SCRIPT}; \
+ then \
+ continue; \
+ fi; \
checkbashisms -f -x $${SCRIPT}; \
echo -n "."; \
done; \
@@ -55,6 +65,10 @@ test:
then \
for SCRIPT in $(SCRIPTS); \
do \
+ if grep -qs /usr/bin/python3 $${SCRIPT}; \
+ then \
+ continue; \
+ fi; \
shellcheck $${SCRIPT} || true; \
echo -n "."; \
done; \
@@ -81,6 +95,9 @@ install: build
mkdir -p $(DESTDIR)/usr/libexec
cp -r libexec/* $(DESTDIR)/usr/libexec
+ mkdir -p $(DESTDIR)/usr/lib/python3/dist-packages
+ cp -r python3/* $(DESTDIR)/usr/lib/python3/dist-packages
+
mkdir -p $(DESTDIR)/usr/share/$(SOFTWARE)
cp -r VERSION.txt $(DESTDIR)/usr/share/$(SOFTWARE)
cp -r share/config share/hooks share/keys share/build-scripts share/get-scripts $(DESTDIR)/usr/share/$(SOFTWARE)
@@ -133,6 +150,7 @@ install: build
ln -sf list $(DESTDIR)/usr/libexec/$(PROGRAM)/ls
ln -sf move $(DESTDIR)/usr/libexec/$(PROGRAM)/mv
ln -sf remove $(DESTDIR)/usr/libexec/$(PROGRAM)/rm
+ ln -sf rebuild $(DESTDIR)/usr/libexec/$(PROGRAM)/rb
ln -sf restart $(DESTDIR)/usr/libexec/$(PROGRAM)/rs
ln -sf start $(DESTDIR)/usr/libexec/$(PROGRAM)/s
ln -sf status $(DESTDIR)/usr/libexec/$(PROGRAM)/st
@@ -201,6 +219,9 @@ uninstall:
rm -rf $(DESTDIR)/usr/share/$(SOFTWARE)
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/share || true
+ rm -rf $(DESTDIR)/usr/lib/python3/dist-packages/compute_tools
+ rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/lib/python3/dist-packages
+
rm -rf $(DESTDIR)/usr/libexec/$(PROGRAM)
rmdir --ignore-fail-on-non-empty --parents $(DESTDIR)/usr/libexec || true
@@ -225,6 +246,28 @@ clean:
rm -f README.txt
-distclean:
+distclean: clean
+ rm -rf $(SOFTWARE)-$(VERSION)
reinstall: uninstall install
+
+release: distclean
+ git commit -a -s -S -m 'Releasing version $(VERSION).' || true
+ git tag -s -m 'Tagging version $(VERSION).' v$(VERSION) || true
+
+ mkdir -p $(SOFTWARE)-$(VERSION)
+ find . -mindepth 1 -maxdepth 1 -and -not -name ".git*" -and -not -name debian -and -not -name $(SOFTWARE)-$(VERSION) -exec cp \-a {} $(SOFTWARE)-$(VERSION) \;
+
+ for FORMAT in xz lzip; \
+ do \
+ EXTENSION=$$(echo $${FORMAT} | cut -b-2); \
+ tar --$${FORMAT} -cf ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION} $(SOFTWARE)-$(VERSION); \
+ sha512sum ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION} > ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION}.sha512; \
+ gpg --default-key 0xB62C61A10B93195F --armor -b ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION}; \
+ mv ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION}.asc ../$(SOFTWARE)-$(VERSION).tar.$${EXTENSION}.sig; \
+ done
+
+ rm -rf $(SOFTWARE)-$(VERSION)
+
+upload:
+ scp ../$(SOFTWARE)-$(VERSION).* get.open-infrastructure.net:/srv/get.open-infrastructure.net/software/$(SOFTWARE)/upstream