Adding live-initramfs 1.87.2-1.
[live-boot-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 CFLAGS = -Wall -g
7
8 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
9         CFLAGS += -O0
10 else
11         CFLAGS += -O2
12 endif
13
14 # Looking in which build system we are
15 BUILD_SYSTEM := $(shell lsb_release --short --id)
16
17 upstream:
18         # Needs: subversion
19         cd .. && svn co svn://svn.debian.org/debian-live/dists/trunk/live-initramfs || true
20         find . -type d -name .svn | xargs rm -rf
21
22 build: build-stamp
23 build-stamp:
24         dh_testdir
25
26         # Checking scripts
27         for SCRIPT in scripts/live scripts/live-bottom/*; \
28         do \
29                 sh -n $$SCRIPT || exit 1; \
30         done
31
32         # Setting BUILD_SYSTEM in the binary package
33         sed -e 's/\(BUILD_SYSTEM="\).*"/\1'$(BUILD_SYSTEM)'"/g' conf/live.conf > live.conf
34
35         # Building package
36         CFLAGS="$(CFLAGS)" $(MAKE) -C bin/live-md5check
37
38         touch build-stamp
39
40 clean:
41         dh_testdir
42         dh_testroot
43         rm -f build-stamp
44
45         # Cleaning package
46         $(MAKE) -C bin/live-md5check clean
47         rm -f live.conf
48
49         dh_clean
50
51 install: build
52         dh_testdir
53         dh_testroot
54         dh_clean -k
55         dh_installdirs
56
57         # Installing package
58         install -m 0755 bin/live-md5check/live-md5check debian/live-initramfs/usr/lib/live-initramfs
59         install -m 0644 live.conf debian/live-initramfs/etc/live.conf
60
61 binary-indep: build install
62
63 binary-arch: build install
64         dh_testdir
65         dh_testroot
66         dh_installchangelogs doc/ChangeLog
67         dh_installdocs doc/ChangeLog.casper
68         dh_installexamples
69         dh_install
70         dh_installinit --no-restart-on-upgrade --no-start -- start 89 0 6 .
71         dh_installman
72         dh_link
73         dh_strip
74         dh_compress
75         dh_fixperms
76         dh_installdeb
77         dh_gencontrol
78         dh_md5sums
79         dh_builddeb
80
81 binary: binary-indep binary-arch
82 .PHONY: build clean binary-indep binary-arch binary install