Add dpatch as Build-Depency
[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
24 install: test build
25         # Installing configuration
26         install -D -m 0644 conf/live.conf $(DESTDIR)/etc/live.conf
27
28         # Installing executables
29         mkdir -p $(DESTDIR)/sbin
30         cp bin/live-getty bin/live-login bin/live-new-uuid bin/live-snapshot $(DESTDIR)/sbin
31
32         mkdir -p $(DESTDIR)/usr/share/live-initramfs
33         cp bin/live-preseed bin/live-reconfigure contrib/languagelist $(DESTDIR)/usr/share/live-initramfs
34
35         mkdir -p $(DESTDIR)/usr/share/initramfs-tools
36         cp -r hooks scripts $(DESTDIR)/usr/share/initramfs-tools
37
38         # Installing documentation
39         mkdir -p $(DESTDIR)/usr/share/doc/live-initramfs
40         cp -r COPYING docs/* $(DESTDIR)/usr/share/doc/live-initramfs
41
42         mkdir -p $(DESTDIR)/usr/share/doc/live-initramfs/examples
43         cp -r conf/* $(DESTDIR)/usr/share/doc/live-initramfs/examples
44
45         # Installing manpages
46         set -e; for MANPAGE in manpages/*.en.1; \
47         do \
48                 install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/man1/`basename $$MANPAGE .en.1`.1; \
49         done
50
51         set -e; for MANPAGE in manpages/*.en.7; \
52         do \
53                 install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/man7/`basename $$MANPAGE .en.7`.7; \
54         done
55
56         set -e; for TRANSLATIONS in $$TRANSLATIONS; \
57         do \
58                 for MANPAGE in manpages/*.$$TRANSLATION.1; \
59                 do \
60                         install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man1/`basename $$MANPAGE .$$TRANSLATION.1`.1; \
61                 done; \
62                 for MANPAGE in manpages/*.$$TRANSLATION.7; \
63                 do \
64                         install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man7/`basename $$MANPAGE .$$TRANSLATION.7`.7; \
65                 done; \
66         done
67
68         # Temporary symlinks
69         ln -sf live-initramfs.7.gz $(DESTDIR)/usr/share/man/man7/live-getty.7.gz
70         ln -sf live-initramfs.7.gz $(DESTDIR)/usr/share/man/man7/live-login.7.gz
71
72 uninstall:
73         # Uninstalling configuration
74         rm -f $(DESTDIR)/etc/live.conf
75
76         # Uninstalling executables
77         rm -f $(DESTDIR)/sbin/live-getty $(DESTDIR)/sbin/live-login $(DESTDIR)/sbin/live-snapshot
78         rm -rf $(DESTDIR)/usr/share/live-initramfs
79         rm -f $(DESTDIR)/usr/share/initramfs-tools/hooks/live
80         rm -rf $(DESTDIR)/usr/share/initramfs-tools/scripts/live*
81         rm -f $(DESTDIR)/usr/share/initramfs-tools/scripts/local-top/live
82
83         # Uninstalling documentation
84         rm -rf $(DESTDIR)/usr/share/doc/live-initramfs
85
86         # Uninstalling manpages
87         set -e; for MANPAGE in manpages/*.en.1; \
88         do \
89                 rm -f $(DESTDIR)/usr/share/man/man1/`basename $$MANPAGE .en.1`.1; \
90         done
91
92         set -e; for MANPAGE in manpages/*.en.7; \
93         do \
94                 rm -f $(DESTDIR)/usr/share/man/man7/`basename $$MANPAGE .en.7`.7; \
95         done
96
97         set -e; for TRANSLATIONS in $$TRANSLATIONS; \
98         do \
99                 for MANPAGE in manpages/*.$$TRANSLATION.1; \
100                 do \
101                         install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man1/`basename $$MANPAGE .$$TRANSLATION.1`.1; \
102                 done; \
103                 for MANPAGE in manpages/*.$$TRANSLATION.7; \
104                 do \
105                         install -D -m 0644 $$MANPAGE $(DESTDIR)/usr/share/man/$$TRANSLATION/man7/`basename $$MANPAGE .$$TRANSLATION.7`.7; \
106                 done; \
107         done
108
109         # Temporary symlinks
110         rm -f $(DESTDIR)/usr/share/man/man7/live-getty.7.gz
111         rm -f $(DESTDIR)/usr/share/man/man7/live-login.7.gz
112
113 update:
114         set -e; for FILE in docs/parameters.txt; \
115         do \
116                 sed -i  -e 's/2007\\-11\\-19/2007\\-11\\-26/' \
117                         -e 's/2007-11-19/2007-11-26/' \
118                         -e 's/19.11.2007/26.11.2007/' \
119                         -e 's/1.113.1/1.113.2/' \
120                 $$FILE; \
121         done
122
123         # Update language list
124         wget -O "contrib/languagelist" \
125                 "http://svn.debian.org/viewsvn/*checkout*/d-i/trunk/packages/localechooser/languagelist"
126
127 clean:
128
129 distclean:
130
131 reinstall: uninstall install