aboutsummaryrefslogtreecommitdiff
path: root/debian/rules
diff options
context:
space:
mode:
Diffstat (limited to 'debian/rules')
-rwxr-xr-xdebian/rules119
1 files changed, 95 insertions, 24 deletions
diff --git a/debian/rules b/debian/rules
index a1fe24543..47605fa71 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,8 +6,9 @@
6# This is the debhelper compatibility version to use. 6# This is the debhelper compatibility version to use.
7export DH_COMPAT=3 7export DH_COMPAT=3
8 8
9DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
10
9VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2) 11VERSION = $(shell dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
10ARCH = $(shell dpkg --print-architecture)
11 12
12ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) 13ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
13 DODEBUG = true 14 DODEBUG = true
@@ -15,38 +16,103 @@ endif
15ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) 16ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
16endif 17endif
17 18
18build-arch: build-arch-stamp 19PACKAGE_PREFIX = busybox-cvs
19build-arch-stamp: 20
21PACKAGES_DEB = $(PACKAGE_PREFIX) $(PACKAGE_PREFIX)-static
22PACKAGES_UDEB = $(PACKAGE_PREFIX)-udeb
23ifneq ($(wildcard ./debian/config-net-udeb-$(DEB_HOST_ARCH)),)
24PACKAGES_UDEB += $(PACKAGE_PREFIX)-net-udeb
25endif
26PACKAGES = $(PACKAGES_DEB) $(PACKAGES_UDEB)
27DEBHELPER_PACKAGES_DEB = $(patsubst %,-p%,$(PACKAGES_DEB))
28
29build-arch: build-arch-deb build-arch-static build-arch-udeb build-arch-net-udeb build-arch-doc
30
31build-arch-deb: build-arch-deb-stamp
32build-arch-deb-stamp:
20 $(MAKE) clean 33 $(MAKE) clean
34
35ifeq ($(wildcard ./debian/config-deb-$(DEB_HOST_ARCH)),)
21 cp ./debian/config-deb .config 36 cp ./debian/config-deb .config
37else
38 cp ./debian/config-deb-$(DEB_HOST_ARCH) .config
39endif
40
22 $(MAKE) dep 41 $(MAKE) dep
23 $(MAKE) DODEBUG=$(DODEBUG) 42 $(MAKE) DODEBUG=$(DODEBUG)
24 install busybox busybox-deb
25 43
44 install -d install-$(PACKAGE_PREFIX)/bin
45 install busybox install-$(PACKAGE_PREFIX)/bin/busybox
46
47 touch $@
48
49build-arch-static: build-arch-static-stamp
50build-arch-static-stamp:
26 $(MAKE) clean 51 $(MAKE) clean
52
53ifeq ($(wildcard ./debian/config-static-$(DEB_HOST_ARCH)),)
27 cp ./debian/config-static .config 54 cp ./debian/config-static .config
55else
56 cp ./debian/config-static-$(DEB_HOST_ARCH) .config
57endif
58
28 $(MAKE) dep 59 $(MAKE) dep
29 $(MAKE) DODEBUG=$(DODEBUG) 60 $(MAKE) DODEBUG=$(DODEBUG)
30 install busybox busybox-static
31 61
62 install -d install-$(PACKAGE_PREFIX)-static/bin
63 install busybox install-$(PACKAGE_PREFIX)-static/bin/busybox
64
65 touch $@
66
67build-arch-udeb: build-arch-udeb-stamp
68build-arch-udeb-stamp:
32 $(MAKE) clean 69 $(MAKE) clean
70
71ifeq ($(wildcard ./debian/config-udeb-$(DEB_HOST_ARCH)),)
33 cp ./debian/config-udeb .config 72 cp ./debian/config-udeb .config
73else
74 cp ./debian/config-udeb-$(DEB_HOST_ARCH) .config
75endif
76
77 $(MAKE) dep
78 $(MAKE) DODEBUG=$(DODEBUG)
79
80 $(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-udeb install
81
82 touch $@
83
84build-arch-net-udeb: build-arch-net-udeb-stamp
85build-arch-net-udeb-stamp:
86ifneq ($(wildcard ./debian/config-net-udeb-$(DEB_HOST_ARCH)),)
87 $(MAKE) clean
88
89 cp ./debian/config-net-udeb-$(DEB_HOST_ARCH) .config
90
34 $(MAKE) dep 91 $(MAKE) dep
35 $(MAKE) DODEBUG=$(DODEBUG) 92 $(MAKE) DODEBUG=$(DODEBUG)
36 93
94 $(MAKE) PREFIX=$(CURDIR)/install-$(PACKAGE_PREFIX)-net-udeb install
95endif
96
97 touch $@
98
99build-arch-doc: build-arch-doc-stamp
100build-arch-doc-stamp:
37 $(MAKE) docs/BusyBox.1 101 $(MAKE) docs/BusyBox.1
38 102
39 touch build-arch-stamp 103 cp docs/BusyBox.1 busybox.1
104
105 touch $@
40 106
41build: build-arch 107build: build-arch
42 108
43clean: 109clean:
44 dh_testdir 110 dh_testdir
45 dh_testroot 111 dh_testroot
46 rm -f build-arch-stamp build-indep-stamp debian/files~ 112 rm -f build-*-stamp debian/files~
47 113
48 $(MAKE) distclean 114 $(MAKE) distclean
49 -rm -f busybox-deb busybox-static busybox.1 115 -rm -rf busybox-deb busybox-static install* busybox.1
50 116
51 dh_clean 117 dh_clean
52 118
@@ -56,20 +122,23 @@ install: build-arch
56 dh_clean -k 122 dh_clean -k
57 dh_installdirs 123 dh_installdirs
58 124
59 install busybox-deb $(CURDIR)/debian/busybox-cvs/bin/busybox 125 for i in $(PACKAGES); do \
60 install busybox-static $(CURDIR)/debian/busybox-cvs-static/bin/busybox 126 ( \
61 $(MAKE) PREFIX=$(CURDIR)/debian/busybox-cvs-udeb install 127 cd install-$$i; \
62 cp docs/BusyBox.1 busybox.1 128 find -type d -exec install -d $(CURDIR)/debian/$$i/{} \;; \
129 find \( -type f -o -type l \) -exec cp -a {} $(CURDIR)/debian/$$i/{} \;; \
130 ); \
131 done
63 132
64 install -m644 debian/busybox-cvs-static.override \ 133 install -m644 debian/$(PACKAGE_PREFIX)-static.override \
65 debian/busybox-cvs-static/usr/share/lintian/overrides/busybox-cvs-static 134 debian/$(PACKAGE_PREFIX)-static/usr/share/lintian/overrides/$(PACKAGE_PREFIX)-static
66 135
67# Build architecture-dependent files here. 136# Build architecture-dependent files here.
68binary-arch: build-arch install 137binary-arch: build-arch install
69 dh_testdir -a 138 dh_testdir -a
70 dh_testroot -a 139 dh_testroot -a
71# dh_installdebconf -a 140# dh_installdebconf -a
72 dh_installdocs -a -Nbusybox-cvs-udeb 141 dh_installdocs $(DEBHELPER_PACKAGES_DEB)
73# dh_installexamples -a 142# dh_installexamples -a
74# dh_installmenu -a 143# dh_installmenu -a
75# dh_installlogrotate -a 144# dh_installlogrotate -a
@@ -78,10 +147,10 @@ binary-arch: build-arch install
78# dh_installmime -a 147# dh_installmime -a
79# dh_installinit -a 148# dh_installinit -a
80# dh_installcron -a 149# dh_installcron -a
81 dh_installman -a -Nbusybox-cvs-udeb 150 dh_installman $(DEBHELPER_PACKAGES_DEB)
82# dh_installinfo -a 151# dh_installinfo -a
83# dh_undocumented -a 152# dh_undocumented -a
84 dh_installchangelogs Changelog -a -Nbusybox-cvs-udeb 153 dh_installchangelogs Changelog $(DEBHELPER_PACKAGES_DEB)
85 dh_strip -a 154 dh_strip -a
86 dh_link -a 155 dh_link -a
87 dh_compress -a 156 dh_compress -a
@@ -90,13 +159,15 @@ binary-arch: build-arch install
90 dh_installdeb -a 159 dh_installdeb -a
91# dh_perl -a 160# dh_perl -a
92 dh_shlibdeps -a 161 dh_shlibdeps -a
93 dh_gencontrol -a -Nbusybox-cvs-udeb 162 dh_gencontrol $(DEBHELPER_PACKAGES_DEB)
94 dh_md5sums -a -Nbusybox-cvs-udeb 163 dh_md5sums $(DEBHELPER_PACKAGES_DEB)
95 dh_builddeb -a -Nbusybox-cvs-udeb 164 dh_builddeb $(DEBHELPER_PACKAGES_DEB)
96 165
97 dh_gencontrol -pbusybox-cvs-udeb -- -fdebian/files~ 166 $(foreach PACKAGE, $(PACKAGES_UDEB), \
98 dpkg-distaddfile busybox-cvs-udeb_$(VERSION)_$(ARCH).udeb debian-installer extra 167 dh_gencontrol -p$(PACKAGE) -- -fdebian/files~; \
99 dh_builddeb -pbusybox-cvs-udeb --filename=busybox-cvs-udeb_$(VERSION)_$(ARCH).udeb 168 dpkg-distaddfile $(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).udeb debian-installer extra; \
169 dh_builddeb -p$(PACKAGE) --filename=$(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).udeb; \
170 )
100 171
101binary: binary-arch 172binary: binary-arch
102.PHONY: build clean binary-indep binary-arch binary install 173.PHONY: build clean binary-indep binary-arch binary install