Use dh_clean instead of dh_prep to get rid of need for debhelper 7
[live-initramfs-grml.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5
6 upstream:
7         cd .. && git clone git://git.debian.org/git/users/daniel/live-initramfs.git || true
8         rm -rf ../live-initramfs/.git
9
10 build: build-stamp
11 build-stamp: patch
12         dh_testdir
13
14         # Building package
15         $(MAKE) -C manpages
16
17         touch build-stamp
18
19 clean: unpatch
20         dh_testdir
21         dh_testroot
22         rm -f build-stamp
23
24         # Cleaning package
25         $(MAKE) -C manpages clean
26
27         dh_clean
28
29 patch: patch-stamp
30
31 patch-stamp:
32         dpatch apply-all
33         dpatch cat-all >patch-stamp
34
35 unpatch:
36         dpatch deapply-all
37         rm -rf patch-stamp debian/patched
38
39 install: build
40         dh_testdir
41         dh_testroot
42         dh_clean -k
43         dh_installdirs
44
45         # Installing package
46         $(MAKE) install DESTDIR=$(CURDIR)/debian/live-initramfs
47
48         # Install grml specific configuration:
49         install -m 644 grml/live.conf ./debian/live-initramfs/etc/live.conf
50         # Get rid of unnecessary stuff:
51         rm -rf ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/
52         # ... and install important stuff again:
53
54         mkdir ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/
55         install -m 755 grml/05mountpoints \
56           ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/05mountpoints
57         install -m 755 grml/08persistence_excludes \
58           ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/08persistence_excludes
59         install -m 755 grml/23networking \
60           ./debian/live-initramfs/usr/share/initramfs-tools/scripts/live-bottom/23networking
61
62         # Removing double files
63         rm -f debian/live-initramfs/usr/share/doc/live-initramfs/COPYING
64         rm -f debian/live-initramfs/usr/share/doc/live-initramfs/ChangeLog
65         mv debian/live-initramfs/usr/share/doc/live-initramfs/ChangeLog.casper debian/live-initramfs/usr/share/doc/live-initramfs/changelog.casper
66
67 binary-arch: build install
68
69 binary-indep: build install
70         dh_testdir
71         dh_testroot
72         dh_installchangelogs docs/ChangeLog
73         dh_installdocs
74         dh_install
75         dh_installinit --no-restart-on-upgrade --no-start -- start 89 0 6 .
76         dh_compress
77         dh_fixperms
78         dh_installdeb
79         dh_gencontrol
80         dh_md5sums
81         dh_builddeb
82
83 binary: binary-indep binary-arch
84 .PHONY: build clean binary-indep binary-arch binary install