File: rules

package info (click to toggle)
casper 1.77%2Bdebian-7
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 364 kB
  • ctags: 145
  • sloc: sh: 1,835; ansic: 467; makefile: 76; python: 43
file content (105 lines) | stat: -rwxr-xr-x 2,192 bytes parent folder | download
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
#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Looking in which build system we are
BUILD_SYSTEM := $(shell lsb_release --short --id)

build: build-stamp
build-stamp:
	dh_testdir

	# Setting BUILD_SYSTEM in the binary package
	sed -i -e 's/\(BUILD_SYSTEM="\).*"/\1'$(BUILD_SYSTEM)'"/g' casper.conf
ifeq ($(BUILD_SYSTEM),Debian)
	cp debian/control.debian debian/control
else
	cp debian/control.ubuntu debian/control
endif

	# Building package
	$(MAKE) -C casper-md5check
	set -e; \
	for x in bin/* scripts/casper scripts/casper-bottom/* \
	         ubiquity-hooks/*; do \
		sh -n $$x; \
	done

	touch build-stamp

clean:

	dh_testdir
	rm -f build-stamp

	# Cleaning package
	-$(MAKE) -C casper-md5check clean

	# Putting back default files
	cp -f debian/control.debian debian/control
	sed -i -e 's/\(BUILD_SYSTEM="\).*"/\1'Debian'"/g' casper.conf
	
	dh_clean


install: build

	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	dh_install

	# Install md5check
	install -m 0755 casper-md5check/casper-md5check debian/casper/usr/lib/casper

	# Fixing permissions
	chmod 0755 debian/casper/usr/share/initramfs-tools/scripts/casper
	
	# Temporary Fixing permissions (until upstream merge)
	chmod 0755 debian/casper/usr/share/initramfs-tools/scripts/casper-bottom/02etc_casper_conf

	# Install casper.conf
	install -m 0644 casper.conf debian/casper/etc/casper.conf

binary-indep: build install
ifneq ($(BUILD_SYSTEM),Debian)
	# Conditionally build Ubiquity 
	dh_testdir
	dh_testroot
	dh_installexamples -i
	dh_installdocs -i
	dh_installchangelogs -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i
endif

binary-arch: build install

	dh_testdir
	dh_testroot
ifeq ($(BUILD_SYSTEM),Debian)
	dh_installchangelogs -a debian/changelog.upstream
else
	dh_installchangelogs -a
endif
	dh_installdocs -a
	dh_installman -a
	dh_installexamples -a
	dh_installinit -a -r --no-start -- start 89 0 6 .
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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