X-Git-Url: http://git.grml.org/?p=live-boot-grml.git;a=blobdiff_plain;f=Makefile;h=ce0262b9463f1ed2ef1b4eda268847574d206733;hp=85b4b849d8638fe08da3de3897c14f1bc71c2260;hb=d98b500c721b2bd5319d84f1e38a2e54db043834;hpb=5f39ffcb7d20a0b2587d0cdee661eb23a6b4a1d4 diff --git a/Makefile b/Makefile index 85b4b84..ce0262b 100644 --- a/Makefile +++ b/Makefile @@ -2,11 +2,11 @@ SHELL := sh -e -LANGUAGES = de +LANGUAGES = $(shell cd manpages/po && ls) SCRIPTS = bin/* hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/* -all: test build +all: build test: @echo -n "Checking for syntax errors" @@ -19,32 +19,37 @@ test: @echo " done." - @echo -n "Checking for bashisms" - @# We can't just fail yet on bashisms (FIXME) - @if [ -x /usr/bin/checkbashisms ]; \ + @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 "WARNING: skipping bashism test - you need to install devscripts."; \ + echo "W: checkbashisms - command not found"; \ + echo "I: checkbashisms can be optained 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 - @echo " done." - build: @echo "Nothing to build." install: # Installing executables + mkdir -p $(DESTDIR)/lib/live + cp bin/boot.sh $(DESTDIR)/lib/live + mkdir -p $(DESTDIR)/sbin cp bin/live-new-uuid bin/live-snapshot bin/live-swapfile $(DESTDIR)/sbin mkdir -p $(DESTDIR)/usr/share/live-boot - cp bin/live-preseed bin/live-reconfigure contrib/languagelist $(DESTDIR)/usr/share/live-boot + cp bin/live-preseed bin/live-reconfigure local/languagelist $(DESTDIR)/usr/share/live-boot mkdir -p $(DESTDIR)/usr/share/initramfs-tools cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools @@ -54,7 +59,7 @@ install: cp -r COPYING docs/* $(DESTDIR)/usr/share/doc/live-boot mkdir -p $(DESTDIR)/usr/share/doc/live-boot/examples - cp -r conf/* $(DESTDIR)/usr/share/doc/live-boot/examples + cp -r etc/* $(DESTDIR)/usr/share/doc/live-boot/examples # (FIXME) # Installing manpages @@ -75,15 +80,31 @@ install: uninstall: # Uninstalling executables + rm -f $(DESTDIR)/lib/live/boot.sh + rmdir --ignore-fail-on-non-empty $(DESTDIR)/lib/live > /dev/null 2>&1 || true + rmdir --ignore-fail-on-non-empty $(DESTDIR)/lib > /dev/null 2>&1 || true + rm -f $(DESTDIR)/sbin/live-snapshot $(DESTDIR)/sbin/live-swapfile + rmdir --ignore-fail-on-non-empty $(DESTDIR)/sbin > /dev/null 2>&1 || true + rm -rf $(DESTDIR)/usr/share/live-boot + rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live rm -rf $(DESTDIR)/usr/share/initramfs-tools/scripts/live* rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top/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/local-top > /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 - # (FIXME) + 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/*; \ @@ -101,8 +122,22 @@ uninstall: done; \ done + for SECTION in $(ls manpages/en/* | awk -F. '{ print $2 }'); \ + 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: +distclean: clean + @echo "Nothing to distclean." reinstall: uninstall install