summaryrefslogtreecommitdiff
path: root/debian/rules
blob: f5c09d9400699b74a84abaf55ef89fe23bf8d8ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/usr/bin/make -f
# Copyright (C) 2001-2005 Mario Jou/3en <joussen@debian.org>
# Copyright (C) 2005-2006 Martin F. Krafft <madduck@debian.org>
# Distributable under the terms of the GNU GPL version 2.
#
# Revision: $Id$
#

#export DH_VERBOSE=1

CXFLAGS = -ggdb
CXFLAGS_UDEB := $(CXFLAGS) -fomit-frame-pointer
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
    CXFLAGS += -O0
    CXFLAGS_UDEB += -O0
else
		CXFLAGS += -O2
    CXFLAGS_UDEB += -Os
endif

include /usr/share/dpatch/dpatch.make

$(DPATCH_STAMPFN): debian/patches/00list
force-run:
.PHONY: force-run
debian/patches/00list: force-run
	dh_testdir
	make -sC debian/patches

.PHONY: configure
configure: debian/patches/00list

build: configure patch build-stamp
build-stamp: 
	dh_testdir
	$(MAKE) -f debian/rules mdadm.udeb DEBIAN=yes
	$(MAKE) clean
	$(MAKE) -f debian/rules mdadm DEBIAN=yes
	touch $@

mdadm.udeb: FLAGS = CXFLAGS="$(CXFLAGS_UDEB)" CONFFILE=/tmp/mdadm.conf
mdadm.udeb: configure
	dh_testdir
	$(MAKE) $(FLAGS) all
	mv mdadm mdadm.udeb
.PHONY: mdadm.udeb

mdadm: FLAGS = CXFLAGS="$(CXFLAGS)" CONFFILE=/etc/mdadm/mdadm.conf CONFFILE2=/etc/mdadm.conf
mdadm: configure
	dh_testdir
	$(MAKE) $(FLAGS) all
.PHONY: mdadm

clean: clean-patched unpatch
	rm -f debian/patches/00list

clean-patched:
	dh_testdir
	dh_testroot
	rm -f build-stamp
	-$(MAKE) clean
	rm -f mdadm.udeb mdadm
	dh_clean
	debconf-updatepo

install: DESTDIR=$(CURDIR)/debian/mdadm
install: DESTDIR_UDEB=$(DESTDIR)-udeb
install: build
	dh_testdir
	dh_clean -k
	dh_installdirs
	install -m0755 mdadm $(DESTDIR)/sbin
	install -m0755 debian/mdrun $(DESTDIR)/sbin

	install -m0755 mdadm.udeb $(DESTDIR_UDEB)/sbin/mdadm
	install -m0755 debian/mdrun $(DESTDIR_UDEB)/sbin

	install -m0755 debian/initramfs/hook \
		$(DESTDIR)/usr/share/initramfs-tools/hooks/mdadm
	install -m0755 debian/initramfs/script.local-top \
		$(DESTDIR)/usr/share/initramfs-tools/scripts/local-top/mdadm

	install -m0755 debian/mkconf $(DESTDIR)/usr/share/mdadm
	install -m0755 debian/checkarray $(DESTDIR)/usr/share/mdadm
	install -m0755 debian/bugscript $(DESTDIR)/usr/share/bug/mdadm/script

	install -m0644 debian/mdadm.lintian-overrides \
		$(DESTDIR)/usr/share/lintian/overrides/mdadm

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdebconf	
	dh_installdocs
	dh_installexamples
	dh_installinit --init-script=mdadm-raid --no-start -- start 25 S . start 50 0 6 .
	dh_installinit -- defaults 25
	dh_installman
	dh_installcron
	dh_installchangelogs ChangeLog
	dh_installlogcheck
	dh_installudev
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure