Package: diffutils
Version: 1:3.2-2
Severity: normal
Tags: patch

As part of a general goal of making Debian bootstrappable we are
ensuring that the base system cross-builds properly.

When cross-built using sbuild --host=<arch>
or plain
dpkg-buildpackage -a<arch>
diffutils calls the wrong strip so the build fails right at the end.

This patch fixes that.

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages diffutils depends on:
ii  dpkg          1.16.1.2
ii  install-info  4.13a.dfsg.1-8
ii  libc6         2.13-26

diffutils recommends no packages.

Versions of packages diffutils suggests:
ii  diffutils-doc  <none>
ii  wdiff          0.6.5-1

-- no debconf information
diff -ur diffutils-3.2.orig/debian/rules diffutils-3.2/debian/rules
--- diffutils-3.2.orig/debian/rules	2012-03-03 12:31:13.000000000 +0000
+++ diffutils-3.2/debian/rules	2012-03-16 18:25:15.622376127 +0000
@@ -3,6 +3,17 @@
 package = diffutils
 docdir = debian/tmp/usr/share/doc/$(package)
 
+export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
+  confflags += --build $(DEB_HOST_GNU_TYPE)
+  CROSS=""
+else
+  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+  CROSS=$(DEB_HOST_GNU_TYPE)-
+endif
+
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
 CFLAGS := `dpkg-buildflags --get CFLAGS` -Wall
@@ -12,16 +23,7 @@
 STRIP = true
 
 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
-  STRIP = strip --remove-section=.comment --remove-section=.note
-endif
-
-export DEB_HOST_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-  confflags += --build $(DEB_HOST_GNU_TYPE)
-else
-  confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
+  STRIP = $(CROSS)strip --remove-section=.comment --remove-section=.note
 endif
 
 build:

Reply via email to