Improving robustness of fromiso cleanup process with is_mountpoint (Closes: #668100).
[debian-live-boot.git] / Makefile
blob1ea0a3606ae4bc4c5333388331c6b1bafb0706cc
1 # Makefile
3 SHELL := sh -e
5 LANGUAGES = $(shell cd manpages/po && ls)
7 SCRIPTS = bin/* hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/*
9 all: build
11 test:
12 @echo -n "Checking for syntax errors"
14 @for SCRIPT in $(SCRIPTS); \
15 do \
16 sh -n $${SCRIPT}; \
17 echo -n "."; \
18 done
20 @echo " done."
22 @# We can't just fail yet on bashisms (FIXME)
23 @if [ -x "$$(which checkbashisms 2>/dev/null)" ]; \
24 then \
25 echo -n "Checking for bashisms"; \
26 for SCRIPT in $(SCRIPTS); \
27 do \
28 checkbashisms -f -x $${SCRIPT} || true; \
29 echo -n "."; \
30 done; \
31 echo " done."; \
32 else \
33 echo "W: checkbashisms - command not found"; \
34 echo "I: checkbashisms can be optained from: "; \
35 echo "I: http://git.debian.org/?p=devscripts/devscripts.git"; \
36 echo "I: On Debian based systems, checkbashisms can be installed with:"; \
37 echo "I: apt-get install devscripts"; \
40 build:
41 @echo "Nothing to build."
43 install:
44 # Installing executables
45 mkdir -p $(DESTDIR)/sbin
46 cp bin/live-new-uuid bin/live-snapshot bin/live-swapfile $(DESTDIR)/sbin
48 mkdir -p $(DESTDIR)/usr/share/live-boot
49 cp bin/live-preseed bin/live-reconfigure local/languagelist $(DESTDIR)/usr/share/live-boot
51 mkdir -p $(DESTDIR)/usr/share/initramfs-tools
52 cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools
54 # Installing docs
55 mkdir -p $(DESTDIR)/usr/share/doc/live-boot
56 cp -r COPYING $(DESTDIR)/usr/share/doc/live-boot
58 mkdir -p $(DESTDIR)/usr/share/doc/live-boot/examples
59 cp -r etc/* $(DESTDIR)/usr/share/doc/live-boot/examples
60 # (FIXME)
62 # Installing manpages
63 for MANPAGE in manpages/en/*; \
64 do \
65 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
66 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE}); \
67 done
69 for LANGUAGE in $(LANGUAGES); \
70 do \
71 for MANPAGE in manpages/$${LANGUAGE}/*; \
72 do \
73 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
74 install -D -m 0644 $${MANPAGE} $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
75 done; \
76 done
78 uninstall:
79 # Uninstalling executables
80 rm -f $(DESTDIR)/sbin/live-snapshot $(DESTDIR)/sbin/live-swapfile
81 rmdir --ignore-fail-on-non-empty $(DESTDIR)/sbin > /dev/null 2>&1 || true
83 rm -rf $(DESTDIR)/usr/share/live-boot
85 rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live
86 rm -rf $(DESTDIR)/usr/share/initramfs-tools/scripts/live*
87 rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top/live
89 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/hooks > /dev/null 2>&1 || true
90 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top > /dev/null 2>&1 || true
91 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools/scripts > /dev/null 2>&1 || true
92 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/initramfs-tools > /dev/null 2>&1 || true
93 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
94 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
96 # Uninstalling docs
97 rm -rf $(DESTDIR)/usr/share/doc/live-boot
98 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/doc > /dev/null 2>&1 || true
99 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
100 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
102 # Uninstalling manpages
103 for MANPAGE in manpages/en/*; \
104 do \
105 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
106 rm -f $(DESTDIR)/usr/share/man/man$${SECTION}/$$(basename $${MANPAGE} .en.$${SECTION}).$${SECTION}; \
107 done
109 for LANGUAGE in $(LANGUAGES); \
110 do \
111 for MANPAGE in manpages/$${LANGUAGE}/*; \
112 do \
113 SECTION="$$(basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1)"; \
114 rm -f $(DESTDIR)/usr/share/man/$${LANGUAGE}/man$${SECTION}/$$(basename $${MANPAGE} .$${LANGUAGE}.$${SECTION}).$${SECTION}; \
115 done; \
116 done
118 for SECTION in $(for MANPAGE in $(ls manpages/en/*); do basename $${MANPAGE} | sed -e 's|\.|\n|g' | tail -n1; done | sort -u); \
119 do \
120 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/man$${SECTION} > /dev/null 2>&1 || true; \
121 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man/*/man$${SECTION} > /dev/null 2>&1 || true; \
122 done
124 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share/man > /dev/null 2>&1 || true
125 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr/share > /dev/null 2>&1 || true
126 rmdir --ignore-fail-on-non-empty $(DESTDIR)/usr > /dev/null 2>&1 || true
128 rmdir --ignore-fail-on-non-empty $(DESTDIR) > /dev/null 2>&1 || true
130 clean:
131 @echo "Nothing to clean."
133 distclean: clean
134 @echo "Nothing to distclean."
136 reinstall: uninstall install