aboutsummaryrefslogtreecommitdiff
path: root/debian/rules
blob: a1fe24543729bca303b06afbba5cf18cb8836de1 (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
#!/usr/bin/make -f

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

# This is the debhelper compatibility version to use.
export DH_COMPAT=3

VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
ARCH = $(shell dpkg --print-architecture)

ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
	DODEBUG = true
endif
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
endif

build-arch: build-arch-stamp
build-arch-stamp:
	$(MAKE) clean
	cp ./debian/config-deb .config
	$(MAKE) dep
	$(MAKE) DODEBUG=$(DODEBUG)
	install busybox busybox-deb

	$(MAKE) clean
	cp ./debian/config-static .config
	$(MAKE) dep
	$(MAKE) DODEBUG=$(DODEBUG)
	install busybox busybox-static

	$(MAKE) clean
	cp ./debian/config-udeb .config
	$(MAKE) dep
	$(MAKE) DODEBUG=$(DODEBUG)

	$(MAKE) docs/BusyBox.1

	touch build-arch-stamp

build: build-arch

clean:
	dh_testdir
	dh_testroot
	rm -f build-arch-stamp build-indep-stamp debian/files~

	$(MAKE) distclean
	-rm -f busybox-deb busybox-static busybox.1

	dh_clean

install: build-arch
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	install busybox-deb $(CURDIR)/debian/busybox-cvs/bin/busybox
	install busybox-static $(CURDIR)/debian/busybox-cvs-static/bin/busybox
	$(MAKE) PREFIX=$(CURDIR)/debian/busybox-cvs-udeb install
	cp docs/BusyBox.1 busybox.1

	install -m644 debian/busybox-cvs-static.override \
		debian/busybox-cvs-static/usr/share/lintian/overrides/busybox-cvs-static

# Build architecture-dependent files here.
binary-arch: build-arch install
	dh_testdir -a
	dh_testroot -a
#	dh_installdebconf -a
	dh_installdocs -a -Nbusybox-cvs-udeb
#	dh_installexamples -a
#	dh_installmenu -a
#	dh_installlogrotate -a
#	dh_installemacsen -a
#	dh_installpam -a
#	dh_installmime -a
#	dh_installinit -a
#	dh_installcron -a
	dh_installman -a -Nbusybox-cvs-udeb
#	dh_installinfo -a
#	dh_undocumented -a
	dh_installchangelogs Changelog -a -Nbusybox-cvs-udeb
	dh_strip -a
	dh_link -a
	dh_compress -a
	dh_fixperms -a
#	dh_makeshlibs -a
	dh_installdeb -a
#	dh_perl -a
	dh_shlibdeps -a
	dh_gencontrol -a -Nbusybox-cvs-udeb
	dh_md5sums -a -Nbusybox-cvs-udeb
	dh_builddeb -a -Nbusybox-cvs-udeb

	dh_gencontrol -pbusybox-cvs-udeb -- -fdebian/files~
	dpkg-distaddfile busybox-cvs-udeb_$(VERSION)_$(ARCH).udeb debian-installer extra
	dh_builddeb -pbusybox-cvs-udeb --filename=busybox-cvs-udeb_$(VERSION)_$(ARCH).udeb

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