Replacing live-boot initscript with a stub and moving the actual code to /lib/live...
[live-boot-grml.git] / Makefile
index efdb0e3..ce0262b 100644 (file)
--- 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,36 +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:
-       # (FIXME)
-       # Installing configuration
-       install -D -m 0644 conf/compcache $(DESTDIR)/usr/share/initramfs-tools/conf.d/compcache
-
        # 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
@@ -58,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
@@ -79,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/*; \
@@ -105,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