Check version of grml-live against changelog before building
[grml-live.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 b=$(CURDIR)/debian/build
13 VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }')
14
15 build: build-stamp
16
17 build-stamp:
18         dh_testdir
19         grep -q "GRML_LIVE_VERSION=.${VERSION}" grml-live || \
20                         (echo "Wrong version in grml-live" && exit 2)
21         cd docs && $(MAKE) && cd ../
22         touch $@
23
24 clean:
25         dh_testdir
26         dh_testroot
27         rm -f build-stamp
28
29         # Add here commands to clean up after the build process.
30         cd docs && $(MAKE) clean && cd ../
31
32         dh_clean
33         # clean up the stuff dh_clean leaves behind
34         -rm -rf debian/build
35
36 install: build
37         dh_testdir
38         dh_testroot
39         dh_clean -k
40         dh_installdirs
41
42 grml-live: install
43         @echo "--- Building: $@"
44         dh_installdirs       -p$@ -P$(b)/$@
45         dh_link              -p$@ -P$(b)/$@
46         dh_installdocs       -p$@ -P$(b)/$@
47         dh_installchangelogs -p$@ -P$(b)/$@
48         dh_install           -p$@ -P$(b)/$@
49         dh_strip             -p$@ -P$(b)/$@
50         dh_compress          -p$@ -P$(b)/$@
51         mkdir -p $(b)/$(@)/usr/share/lintian/overrides/
52         cp -av debian/overrides.$(@) $(b)/$(@)/usr/share/lintian/overrides/$(@)
53         dh_fixperms          -p$@ -P$(b)/$@
54         # make sure they are executable:
55         chmod 755 $(b)/$(@)/etc/grml/fai/config/hooks/*
56         dh_makeshlibs        -p$@ -P$(b)/$@ -V
57         dh_installdeb        -p$@ -P$(b)/$@
58         dh_shlibdeps         -p$@ -P$(b)/$@
59         dh_installdebconf    -p$@ -P$(b)/$@
60         dh_gencontrol        -p$@ -P$(b)/$@
61         dh_md5sums           -p$@ -P$(b)/$@
62         dh_builddeb          -p$@ -P$(b)/$@
63
64 grml-live-addons: install
65         @echo "--- Building: $@"
66         dh_installdirs       -p$@ -P$(b)/$@
67         dh_link              -p$@ -P$(b)/$@
68         dh_installdocs       -p$@ -P$(b)/$@
69         dh_installchangelogs -p$@ -P$(b)/$@
70         dh_install           -p$@ -P$(b)/$@
71         dh_strip             -p$@ -P$(b)/$@
72         dh_compress          -p$@ -P$(b)/$@
73         mkdir -p $(b)/$(@)/usr/share/lintian/overrides/
74         cp -av debian/overrides.$(@) $(b)/$(@)/usr/share/lintian/overrides/$(@)
75         dh_fixperms          -p$@ -P$(b)/$@
76         dh_makeshlibs        -p$@ -P$(b)/$@ -V
77         dh_installdeb        -p$@ -P$(b)/$@
78         dh_shlibdeps         -p$@ -P$(b)/$@
79         dh_installdebconf    -p$@ -P$(b)/$@
80         dh_gencontrol        -p$@ -P$(b)/$@
81         dh_md5sums           -p$@ -P$(b)/$@
82         dh_builddeb          -p$@ -P$(b)/$@
83
84 grml-live-db: install
85         @echo "--- Building: $@"
86         dh_installdirs       -p$@ -P$(b)/$@
87         dh_link              -p$@ -P$(b)/$@
88         dh_installdocs       -p$@ -P$(b)/$@
89         dh_installchangelogs -p$@ -P$(b)/$@
90         dh_install           -p$@ -P$(b)/$@
91         dh_strip             -p$@ -P$(b)/$@
92         dh_compress          -p$@ -P$(b)/$@
93         mkdir -p $(b)/$(@)/usr/share/lintian/overrides/
94         cp -av debian/overrides.$(@) $(b)/$(@)/usr/share/lintian/overrides/$(@)
95         dh_fixperms          -p$@ -P$(b)/$@
96         dh_makeshlibs        -p$@ -P$(b)/$@ -V
97         dh_installdeb        -p$@ -P$(b)/$@
98         dh_shlibdeps         -p$@ -P$(b)/$@
99         dh_installdebconf    -p$@ -P$(b)/$@
100         dh_gencontrol        -p$@ -P$(b)/$@
101         dh_md5sums           -p$@ -P$(b)/$@
102         dh_builddeb          -p$@ -P$(b)/$@
103
104 grml-live-buildd: install
105         @echo "--- Building: $@"
106         dh_installdirs       -p$@ -P$(b)/$@
107         dh_link              -p$@ -P$(b)/$@
108         dh_installdocs       -p$@ -P$(b)/$@
109         dh_installchangelogs -p$@ -P$(b)/$@
110         dh_install           -p$@ -P$(b)/$@
111         dh_strip             -p$@ -P$(b)/$@
112         dh_compress          -p$@ -P$(b)/$@
113         mkdir -p $(b)/$(@)/usr/share/lintian/overrides/
114         cp -av debian/overrides.$(@) $(b)/$(@)/usr/share/lintian/overrides/$(@)
115         dh_fixperms          -p$@ -P$(b)/$@
116         dh_makeshlibs        -p$@ -P$(b)/$@ -V
117         dh_installdeb        -p$@ -P$(b)/$@
118         dh_shlibdeps         -p$@ -P$(b)/$@
119         dh_installdebconf    -p$@ -P$(b)/$@
120         dh_gencontrol        -p$@ -P$(b)/$@
121         dh_md5sums           -p$@ -P$(b)/$@
122         dh_builddeb          -p$@ -P$(b)/$@
123
124 # Build architecture-dependent files here.
125 binary-all: build install
126
127 # Build architecture-independent files here.
128 binary-indep: build install grml-live grml-live-addons grml-live-db grml-live-buildd
129
130 binary: binary-indep binary-arch
131 .PHONY: build clean binary-indep binary-arch binary install