summaryrefslogtreecommitdiffstats
path: root/system-boot/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-02 10:00:00 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-02-02 10:00:00 +0000
commit32322960234c8ec91e0d42835a3ec5ee63305070 (patch)
tree71d79574de0193778ad6cc6c96dfd4f74fa6bbbb /system-boot/Makefile
parentInitial commit. (diff)
downloadopen-infrastructure-system-tools-32322960234c8ec91e0d42835a3ec5ee63305070.tar.xz
open-infrastructure-system-tools-32322960234c8ec91e0d42835a3ec5ee63305070.zip
Adding upstream version 20190202.upstream/20190202
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'system-boot/Makefile')
-rw-r--r--system-boot/Makefile132
1 files changed, 132 insertions, 0 deletions
diff --git a/system-boot/Makefile b/system-boot/Makefile
new file mode 100644
index 0000000..e3f3946
--- /dev/null
+++ b/system-boot/Makefile
@@ -0,0 +1,132 @@
+# Makefile
+
+SHELL := sh -e
+
+LANGUAGES = $(shell cd manpages/po && ls)
+
+SCRIPTS = backend/*/* frontend/* components/*
+
+all: build
+
+test:
+ @echo -n "Checking for syntax errors"
+
+ @for SCRIPT in $(SCRIPTS); \
+ do \
+ sh -n $${SCRIPT}; \
+ echo -n "."; \
+ done
+
+ @echo " done."
+
+ @# We can't just fail yet on bashisms (FIXME)
+ @if [ -x "$$(which checkbashisms 2>/dev/null)" ]; \
+ then \
+ echo -n "Checking for bashisms"; \
+ for SCRIPT in $(SCRIPTS); \
+ do \
+ checkbashisms -f -x $${SCRIPT} || true; \
+ echo -n "."; \
+ done; \
+ echo " done."; \
+ else \
+ echo "W: checkbashisms - command not found"; \
+ echo "I: checkbashisms can be obtained from: "; \
+ echo "I: http://git.debian.org/?p=devscripts/devscripts.git"; \
+ echo "I: On Debian based systems, checkbashisms can be installed with:"; \
+ echo "I: apt-get install devscripts"; \
+ fi
+
+build:
+ @echo "Nothing to build."
+
+install:
+ # Installing components
+ mkdir -p $(DESTDIR)/lib/live/boot
+ cp components/* $(DESTDIR)/lib/live/boot
+
+ # Installing executables
+ mkdir -p $(DESTDIR)/usr/share/initramfs-tools/hooks
+ cp backend/initramfs-tools/live.hook $(DESTDIR)/usr/share/initramfs-tools/hooks/live
+ mkdir -p $(DESTDIR)/usr/share/initramfs-tools/scripts
+ cp backend/initramfs-tools/live.script $(DESTDIR)/usr/share/initramfs-tools/scripts/live
+
+ mkdir -p $(DESTDIR)/bin
+ cp frontend/* $(DESTDIR)/bin
+
+ # Installing docs
+ mkdir -p $(DESTDIR)/usr/share/doc/live-boot
+ cp -r COPYING $(DESTDIR)/usr/share/doc/live-boot
+
+ # Installing manpages
+ for MANPAGE in manpages/en/*; \
+ do \
+ SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
+ install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
+ done
+
+ for LANGUAGE in $(LANGUAGES); \
+ do \
+ for MANPAGE in manpages/$${LANGUAGE}/*; \
+ do \
+ SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
+ install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
+ done; \
+ done
+
+uninstall:
+ # Uninstalling executables
+ rm -f $(DESTDIR)/bin/live-boot
+ rm -f $(DESTDIR)/bin/live-swapfile
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/bin > /dev/null 2>&1 || true
+
+ rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live
+ rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/live
+
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/hooks > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/scripts > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
+
+ # Uninstalling docs
+ rm -rf $(DESTDIR)/usr/share/doc/live-boot
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/doc > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
+
+ # Uninstalling manpages
+ for MANPAGE in manpages/en/*; \
+ do \
+ SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
+ rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
+ done
+
+ for LANGUAGE in $(LANGUAGES); \
+ do \
+ for MANPAGE in manpages/$${LANGUAGE}/*; \
+ do \
+ SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
+ rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
+ done; \
+ done
+
+ for SECTION in $(for MANPAGE in $(ls manpages/en/*); do basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1; done | sort -u); \
+ do \
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/man$${SECTION} > /dev/null 2>&1 || true; \
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/*/man$${SECTION} > /dev/null 2>&1 || true; \
+ done
+
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
+
+ rmdir --ignore-fail-on-non-empty $(DESTDIR) > /dev/null 2>&1 || true
+
+clean:
+ @echo "Nothing to clean."
+
+distclean: clean
+ @echo "Nothing to distclean."
+
+reinstall: uninstall install