03-get-sources: ensure that apt information is available + up2date
[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-arch build-indep
16
17 build-arch: build-stamp
18
19 build-indep: build-stamp
20
21 build-stamp:
22         dh_testdir
23         egrep -q "GRML_LIVE_VERSION=.*UNRELEASED" grml-live || \
24                         (echo "Wrong version in grml-live" && exit 2)
25         cd docs && $(MAKE) && cd ../
26         touch $@
27
28 clean:
29         dh_testdir
30         dh_testroot
31         rm -f build-stamp
32
33         # Add here commands to clean up after the build process.
34         cd docs && $(MAKE) clean && cd ../
35
36         dh_clean
37         # clean up the stuff dh_clean leaves behind
38         -rm -rf debian/build
39
40 install: build
41         dh_testdir
42         dh_testroot
43         dh_clean -k
44         dh_installdirs
45
46 grml-live: install
47         @echo "--- Building: $@"
48         dh_installdirs       -p$@ -P$(b)/$@
49         dh_link              -p$@ -P$(b)/$@
50         dh_installdocs       -p$@ -P$(b)/$@
51         dh_installchangelogs -p$@ -P$(b)/$@
52         dh_install           -p$@ -P$(b)/$@
53         sed -i -e "s/GRML_LIVE_VERSION='\*\*\*UNRELEASED\*\*\*'/GRML_LIVE_VERSION='$(VERSION)'/" $(b)/$@/usr/sbin/grml-live
54         dh_strip             -p$@ -P$(b)/$@
55         dh_compress          -p$@ -P$(b)/$@
56         mkdir -p $(b)/$(@)/usr/share/lintian/overrides/
57         cp -av debian/overrides.$(@) $(b)/$(@)/usr/share/lintian/overrides/$(@)
58         dh_fixperms          -p$@ -P$(b)/$@
59         # make sure they are executable:
60         chmod 755 $(b)/$(@)/etc/grml/fai/config/hooks/*
61         dh_makeshlibs        -p$@ -P$(b)/$@ -V
62         dh_installdeb        -p$@ -P$(b)/$@
63         dh_shlibdeps         -p$@ -P$(b)/$@
64         dh_installdebconf    -p$@ -P$(b)/$@
65         dh_gencontrol        -p$@ -P$(b)/$@
66         dh_md5sums           -p$@ -P$(b)/$@
67         dh_builddeb          -p$@ -P$(b)/$@
68
69 grml-live-db: install
70         @echo "--- Building: $@"
71         dh_installdirs       -p$@ -P$(b)/$@
72         dh_link              -p$@ -P$(b)/$@
73         dh_installdocs       -p$@ -P$(b)/$@
74         dh_installchangelogs -p$@ -P$(b)/$@
75         dh_install           -p$@ -P$(b)/$@
76         dh_strip             -p$@ -P$(b)/$@
77         dh_compress          -p$@ -P$(b)/$@
78         mkdir -p $(b)/$(@)/usr/share/lintian/overrides/
79         cp -av debian/overrides.$(@) $(b)/$(@)/usr/share/lintian/overrides/$(@)
80         dh_fixperms          -p$@ -P$(b)/$@
81         dh_makeshlibs        -p$@ -P$(b)/$@ -V
82         dh_installdeb        -p$@ -P$(b)/$@
83         dh_shlibdeps         -p$@ -P$(b)/$@
84         dh_installdebconf    -p$@ -P$(b)/$@
85         dh_gencontrol        -p$@ -P$(b)/$@
86         dh_md5sums           -p$@ -P$(b)/$@
87         dh_builddeb          -p$@ -P$(b)/$@
88
89 # Build architecture-dependent files here.
90 binary-all: build install
91
92 # Build architecture-independent files here.
93 binary-indep: build install grml-live grml-live-db
94
95 binary: binary-indep binary-arch
96 .PHONY: build clean binary-indep binary-arch binary install