Address aufs2/kernel 2.6.33 issue through 05mountpoints.
[live-initramfs-grml.git] / Makefile
1 # Makefile
2
3 TRANSLATIONS="it"
4
5 all: build
6
7 test:
8         # Checking for syntax errors
9         set -e; for SCRIPT in bin/* hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/*; \
10         do \
11                 sh -n $$SCRIPT; \
12         done
13
14         # Checking for bashisms (temporary not failing, but only listing)
15         if [ -x /usr/bin/checkbashisms ]; \
16         then \
17                 checkbashisms bin/* hooks/* scripts/live scripts/live-functions scripts/live-helpers scripts/*/* || true; \
18         else \
19                 echo "bashism test skipped - you need to install devscripts."; \
20         fi
21
22 build:
23         $(MAKE) -C manpages
24
25 install: test build
26         # Installing configuration
27         install -D -m 0644 conf/live.conf $(DESTDIR)/etc/live.conf
28         install -D -m 0644 conf/compcache $(DESTDIR)/usr/share/initramfs-tools/conf.d/compcache
29
30         # Installing executables
31         mkdir -p $(DESTDIR)/sbin
32         cp bin/live-getty bin/live-login bin/live-new-uuid bin/live-snapshot bin/live-swapfile $(DESTDIR)/sbin
33
34         mkdir -p $(DESTDIR)/usr/share/live-initramfs
35         cp bin/live-preseed bin/live-reconfigure contrib/languagelist $(DESTDIR)/usr/share/live-initramfs
36
37         mkdir -p $(DESTDIR)/usr/share/initramfs-tools
38         cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools
39
40         # Installing documentation
41         mkdir -p $(DESTDIR)/usr/share/doc/live-initramfs
42         cp -r COPYING docs/* $(DESTDIR)/usr/share/doc/live-initramfs
43
44         mkdir -p $(DESTDIR)/usr/share/doc/live-initramfs/examples
45         cp -r conf/* $(DESTDIR)/usr/share/doc/live-initramfs/examples
46
47         # Installing manpages
48         set -e; for MANPAGE in manpages/*.en.1; \
49         do \
50                 install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/man1/`basename $$MANPAGE .en.1`.1; \
51         done
52
53         set -e; for MANPAGE in manpages/*.en.7; \
54         do \
55                 install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/man7/`basename $$MANPAGE .en.7`.7; \
56         done
57
58         set -e; for TRANSLATIONS in $$TRANSLATIONS; \
59         do \
60                 for MANPAGE in manpages/*.$$TRANSLATION.1; \
61                 do \
62                         install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man1/`basename $$MANPAGE .$$TRANSLATION.1`.1; \
63                 done; \
64                 for MANPAGE in manpages/*.$$TRANSLATION.7; \
65                 do \
66                         install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man7/`basename $$MANPAGE .$$TRANSLATION.7`.7; \
67                 done; \
68         done
69
70         # Temporary symlinks
71         ln -sf live-initramfs.7.gz $(DESTDIR)/usr/share/man/man7/live-getty.7.gz
72         ln -sf live-initramfs.7.gz $(DESTDIR)/usr/share/man/man7/live-login.7.gz
73
74 uninstall:
75         # Uninstalling configuration
76         rm -f $(DESTDIR)/etc/live.conf
77
78         # Uninstalling executables
79         rm -f $(DESTDIR)/sbin/live-getty $(DESTDIR)/sbin/live-login $(DESTDIR)/sbin/live-snapshot $(DESTDIR)/sbin/live-swapfile
80         rm -rf $(DESTDIR)/usr/share/live-initramfs
81         rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live
82         rm -rf $(DESTDIR)/usr/share/initramfs-tools/scripts/live*
83         rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top/live
84
85         # Uninstalling documentation
86         rm -rf $(DESTDIR)/usr/share/doc/live-initramfs
87
88         # Uninstalling manpages
89         set -e; for MANPAGE in manpages/*.en.1; \
90         do \
91                 rm -f $(DESTDIR)/usr/share/man/man1/`basename $$MANPAGE .en.1`.1; \
92         done
93
94         set -e; for MANPAGE in manpages/*.en.7; \
95         do \
96                 rm -f $(DESTDIR)/usr/share/man/man7/`basename $$MANPAGE .en.7`.7; \
97         done
98
99         set -e; for TRANSLATIONS in $$TRANSLATIONS; \
100         do \
101                 for MANPAGE in manpages/*.$$TRANSLATION.1; \
102                 do \
103                         install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man1/`basename $$MANPAGE .$$TRANSLATION.1`.1; \
104                 done; \
105                 for MANPAGE in manpages/*.$$TRANSLATION.7; \
106                 do \
107                         install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man7/`basename $$MANPAGE .$$TRANSLATION.7`.7; \
108                 done; \
109         done
110
111         # Temporary symlinks
112         rm -f $(DESTDIR)/usr/share/man/man7/live-getty.7.gz
113         rm -f $(DESTDIR)/usr/share/man/man7/live-login.7.gz
114
115 update:
116         # Update language list
117         wget -O "contrib/languagelist" \
118                 "http://svn.debian.org/viewsvn/*checkout*/d-i/trunk/packages/localechooser/languagelist"
119
120 clean:
121         $(MAKE) -C manpages clean
122
123 distclean:
124
125 reinstall: uninstall install