diff options
author | Julien Cristau <jcristau@debian.org> | 2009-08-02 15:05:30 +0200 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2009-08-02 15:05:30 +0200 |
commit | c83a6ceef8111bbd98273f9026d6943905f7d999 (patch) | |
tree | 5d8d71d861b08535ea0b38c848d983a5a3279b57 | |
parent | 93a81e1d57042311b2242a777cd97b8ef31305da (diff) | |
download | xutils-dev-c83a6ceef8111bbd98273f9026d6943905f7d999.tar.gz |
debian/rules updates
Parse space-separated DEB_BUILD_OPTIONS (policy 3.8), move building each
subdir to its own rule, and allow building in parallel. Also call
dh_install with --fail-missing to avoid building a broken package.
-rw-r--r-- | debian/changelog | 4 | ||||
-rwxr-xr-x | debian/rules | 37 |
2 files changed, 23 insertions, 18 deletions
diff --git a/debian/changelog b/debian/changelog index e14ec64..cff4359 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,10 @@ xutils-dev (1:7.4+5) UNRELEASED; urgency=low * Don't call dh_makeshlibs, silences lintian warning. * Fix patches 01 and 02 to apply with -p1, to silence lintian. * util-macros 1.2.2. + * Adjust debian/rules to parse space-separated DEB_BUILD_OPTIONS (policy + 3.8), move building each subdir to its own rule, and allow building in + parallel. Also call dh_install with --fail-missing to avoid building a + broken package. -- Julien Cristau <jcristau@debian.org> Fri, 19 Dec 2008 13:41:50 +0100 diff --git a/debian/rules b/debian/rules index c0f2042..c903d41 100755 --- a/debian/rules +++ b/debian/rules @@ -14,16 +14,17 @@ include debian/xsfbs/xsfbs.mk # This package contains multiple modules as shipped by upstream. Each module is # contained in a subdirectory in the root dir of the package. You must list each # subdirectory explicitly so that the build system knows what to build -SUBDIRS="gccmakedep imake lndir makedepend util-macros xorg-cf-files" +SUBDIRS= gccmakedep imake lndir makedepend util-macros xorg-cf-files CFLAGS = -Wall -g -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif -ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s +ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) + MAKEFLAGS += -j$(NUMJOBS) endif DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) @@ -36,19 +37,19 @@ else endif -build: genscripts patch build-stamp -build-stamp: - dh_testdir - for FILE in "$(SUBDIRS)"; do \ - test -d "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE) || mkdir "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE); \ - (cd "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE) && \ - ../"$$FILE"/configure --prefix=/usr --mandir=\$${prefix}/share/man \ - --infodir=\$${prefix}/share/info $(confflags) \ - CFLAGS="$(CFLAGS)" && \ - $(MAKE)) || exit 1; \ - done +build: build-stamp +build-stamp: $(STAMP_DIR)/genscripts $(foreach dir, $(SUBDIRS), $(STAMP_DIR)/build-$(dir)) + >$@ - touch build-stamp +$(STAMP_DIR)/build-%: $(STAMP_DIR)/patch + mkdir -p $*-obj-$(DEB_BUILD_GNU_TYPE) + cd $*-obj-$(DEB_BUILD_GNU_TYPE) && \ + ../$*/configure --prefix=/usr --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info $(confflags) \ + CFLAGS="$(CFLAGS)" + cd $*-obj-$(DEB_BUILD_GNU_TYPE) && \ + $(MAKE) + >$@ clean: xsfclean dh_testdir @@ -69,7 +70,7 @@ install: build dh_clean -k dh_installdirs - for FILE in "$(SUBDIRS)"; do \ + for FILE in $(SUBDIRS); do \ cd "$$FILE"-obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install ; \ cd ..; \ done @@ -80,7 +81,7 @@ binary-arch: build install dh_testroot dh_installdocs - dh_install --sourcedir=debian/tmp --list-missing + dh_install --sourcedir=debian/tmp --fail-missing dh_installchangelogs dh_link dh_strip |