From fbb57805a9f4464bded172510269000f1794201f Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Sat, 4 Oct 2014 18:54:30 +0400 Subject: simplify d/rules, build udeb in a subdir --- debian/rules | 60 ++++++++++++++++++++++++++++++------------------------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'debian/rules') diff --git a/debian/rules b/debian/rules index dfd3d0f2..3a7921c3 100755 --- a/debian/rules +++ b/debian/rules @@ -9,42 +9,41 @@ LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS) CXFLAGS = $(shell dpkg-buildflags --get CFLAGS) \ $(shell dpkg-buildflags --get CPPFLAGS) -BUILDFLAGS = CXFLAGS="$(CXFLAGS)" LDFLAGS="$(LDFLAGS)" +BUILDFLAGS = CXFLAGS="$(CXFLAGS)" LDFLAGS="$(LDFLAGS)" DEBIAN=yes +DESTDIR = $(CURDIR)/debian/mdadm +DESTDIR_UDEB = $(DESTDIR)-udeb -.PHONY: configure -configure: +build-arch: build-stamp -build: configure build-stamp build-stamp: dh_testdir - $(MAKE) -f debian/rules mdadm.udeb DEBIAN=yes - $(MAKE) clean - $(MAKE) -f debian/rules mdadm DEBIAN=yes + $(MAKE) all $(BUILDFLAGS) CONFFILE=/etc/mdadm/mdadm.conf CONFFILE2=/etc/mdadm.conf touch $@ -mdadm.udeb: configure - dh_testdir - $(MAKE) mdadm mdmon $(BUILDFLAGS) CONFFILE=/tmp/mdadm.conf - mv mdadm mdadm.udeb - mv mdmon mdmon.udeb -.PHONY: mdadm.udeb mdmon.udeb +# udeb rules should go, the only diff is the conffile location, +# and d-i specifies path explicitly when needed + +udeb/dir-stamp: + rm -rf udeb + mkdir udeb + ln *.[ch] Makefile udeb/ + touch $@ -mdadm: configure +build-arch: udeb/build-stamp + +udeb/build-stamp: udeb/dir-stamp dh_testdir - $(MAKE) all $(BUILDFLAGS) CONFFILE=/etc/mdadm/mdadm.conf CONFFILE2=/etc/mdadm.conf -.PHONY: mdadm + $(MAKE) -C udeb mdadm mdmon $(BUILDFLAGS) CONFFILE=/tmp/mdadm.conf + touch $@ clean: dh_testdir rm -f build-stamp - [ ! -f Makefile ] || $(MAKE) clean - rm -f mdadm.udeb mdmon.udeb mdadm + $(MAKE) clean + rm -rf udeb dh_clean - debconf-updatepo -install: DESTDIR=$(CURDIR)/debian/mdadm -install: DESTDIR_UDEB=$(DESTDIR)-udeb -install: build +install-arch: build-arch dh_testdir dh_clean -k dh_installdirs @@ -63,13 +62,11 @@ install: build install -Dm0755 debian/bugscript $(DESTDIR)/usr/share/bug/mdadm/script install -Dm0644 debian/presubj $(DESTDIR)/usr/share/bug/mdadm/presubj - install -Dm0755 mdadm.udeb $(DESTDIR_UDEB)/sbin/mdadm - install -Dm0755 mdmon.udeb $(DESTDIR_UDEB)/sbin/mdmon + install -Dm0755 udeb/mdadm $(DESTDIR_UDEB)/sbin/mdadm + install -Dm0755 udeb/mdmon $(DESTDIR_UDEB)/sbin/mdmon install -Dm0644 udev-md-raid-arrays.rules $(DESTDIR_UDEB)/lib/udev/rules.d/63-md-raid-arrays.rules -binary-indep: build install - -binary-arch: build install +binary-arch: install-arch dh_testdir dh_testroot dh_installdebconf @@ -92,7 +89,10 @@ binary-arch: build install dh_md5sums dh_builddeb -binary: binary-indep binary-arch +build: build-arch +install: install-arch +binary: binary-arch build-indep: -build-arch: build -.PHONY: build build-indep build-arch clean binary-indep binary-arch binary install configure +install-indep: +binary-indep: +.PHONY: clean build build-indep build-arch binary binary-indep binary-arch install install-indep install-arch -- cgit v1.2.3