diff -Naur -x '*.sw*' build-essential-11.5.orig/debian/control build-essential-11.5/debian/control
--- build-essential-11.5.orig/debian/control	2010-03-14 17:47:08.000000000 -0400
+++ build-essential-11.5/debian/control	1969-12-31 19:00:00.000000000 -0500
@@ -1,32 +0,0 @@
-Source: build-essential
-Section: devel
-Priority: optional
-Maintainer: Matthias Klose <doko@debian.org>
-Uploaders: Scott James Remnant <scott@netsplit.com>
-Standards-Version: 3.8.4
-Build-Depends: debhelper (>= 5.0), python (>= 2.1)
-
-Package: build-essential
-Architecture: any
-Depends: ${build-essential}, ${misc:Depends}
-Description: Informational list of build-essential packages
- If you do not plan to build Debian packages, you don't need this
- package.  Starting with dpkg (>= 1.14.18) this package is required
- for building Debian packages.
- .
- This package contains an informational list of packages which are
- considered essential for building Debian packages.  This package also
- depends on the packages on that list, to make it easy to have the
- build-essential packages installed.
- .
- If you have this package installed, you only need to install whatever
- a package specifies as its build-time dependencies to build the
- package.  Conversely, if you are determining what your package needs
- to build-depend on, you can always leave out the packages this
- package depends on.
- .
- This package is NOT the definition of what packages are
- build-essential; the real definition is in the Debian Policy Manual.
- This package contains merely an informational list, which is all
- most people need.   However, if this package and the manual disagree,
- the manual is correct.
diff -Naur -x '*.sw*' build-essential-11.5.orig/debian/control.in build-essential-11.5/debian/control.in
--- build-essential-11.5.orig/debian/control.in	1969-12-31 19:00:00.000000000 -0500
+++ build-essential-11.5/debian/control.in	2012-06-24 15:43:06.860619566 -0400
@@ -0,0 +1,51 @@
+Source: build-essential
+Section: devel
+Priority: optional
+Maintainer: Matthias Klose <doko@debian.org>
+Uploaders: Scott James Remnant <scott@netsplit.com>
+Standards-Version: 3.8.4
+Build-Depends: debhelper (>= 5.0), python (>= 2.1)
+
+Package: build-essential
+Architecture: any
+Depends: ${build-essential}, ${misc:Depends}
+Description: Informational list of build-essential packages
+ If you do not plan to build Debian packages, you don't need this
+ package.  Starting with dpkg (>= 1.14.18) this package is required
+ for building Debian packages.
+ .
+ This package contains an informational list of packages which are
+ considered essential for building Debian packages.  This package also
+ depends on the packages on that list, to make it easy to have the
+ build-essential packages installed.
+ .
+ If you have this package installed, you only need to install whatever
+ a package specifies as its build-time dependencies to build the
+ package.  Conversely, if you are determining what your package needs
+ to build-depend on, you can always leave out the packages this
+ package depends on.
+ .
+ This package is NOT the definition of what packages are
+ build-essential; the real definition is in the Debian Policy Manual.
+ This package contains merely an informational list, which is all
+ most people need.   However, if this package and the manual disagree,
+ the manual is correct.
+
+Package: crossbuild-essential-@DEB_TARGET_ARCH@
+Architecture: all
+Depends: ${build-essential}, ${misc:Depends}
+Description: Informational list of cross-build-essential packages
+ If you do not plan to cross build Debian packages, you don't need
+ this package.  Starting with sbuild (>= 0.63.0) this package is
+ required for cross building Debian packages in a chroot.
+ .
+ This package contains an informational list of packages which are
+ considered essential for cross building Debian packages.  This
+ package also depends on the packages on that list, to make it easy to
+ have the cross-build-essential packages installed.
+ .
+ If you have this package installed, you only need to install whatever
+ a package specifies as its build-time dependencies to cross build the
+ package.  Conversely, if you are determining what your package needs
+ to build-depend on, you can always leave out the packages this
+ package depends on.
diff -Naur -x '*.sw*' build-essential-11.5.orig/debian/rules build-essential-11.5/debian/rules
--- build-essential-11.5.orig/debian/rules	2010-03-14 17:47:42.000000000 -0400
+++ build-essential-11.5/debian/rules	2012-06-24 16:18:31.651690106 -0400
@@ -7,20 +7,50 @@
 
 DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
+ifdef DEB_TARGET_ARCH
+	CROSS_PKG := crossbuild-essential-$(DEB_TARGET_ARCH)
+	DEB_TARGET_MULTIARCH := $(shell dpkg-architecture -a$(DEB_TARGET_ARCH) \
+		-qDEB_HOST_MULTIARCH 2>/dev/null)
+else
+	CROSS_PKG :=
+	DEB_TARGET_ARCH := $(DEB_HOST_ARCH)
+	DEB_TARGET_MULTIARCH := $(shell dpkg-architecture \
+		-qDEB_HOST_MULTIARCH 2>/dev/null)
+endif
+
+
+control:
+	sed -e 's/@DEB_TARGET_ARCH@/$(DEB_TARGET_ARCH)/g' \
+		debian/control.in > debian/control
 
-build: build-stamp
-build-stamp: configure
+build-arch: build-arch-stamp
+build-arch-stamp: configure control
 	dh_testdir
 
+	cp list.native list
+
+	./configure --prefix=/usr
+	$(MAKE)
+
+	touch build-arch-stamp
+
+build-indep: build-indep-stamp
+build-indep-stamp: configure control
+	dh_testdir
+
+	sed -e 's/@DEB_TARGET_ARCH@/$(DEB_TARGET_ARCH)/g' \
+		-e 's/@DEB_TARGET_MULTIARCH@/$(DEB_TARGET_MULTIARCH)/g' \
+		list.cross.in > list
+
 	./configure --prefix=/usr
 	$(MAKE)
 
-	touch build-stamp
+	touch build-indep-stamp
 
 clean: configure
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp
+	rm -f build-indep-stamp build-arch-stamp
 
 	-$(MAKE) -k distclean
 	rm -f config.cache config.log config.status
@@ -28,11 +58,32 @@
 
 	dh_clean
 
+	rm -f debian/control list.cross
+
 # Make it as clean as svn can make it.
 svnclean: clean
 	rm -rf `svn propget svn:ignore`
 
-install: build
+install-indep: build-indep
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	$(MAKE) prefix=`pwd`/debian/$(CROSS_PKG)/usr \
+		install
+	mv debian/$(CROSS_PKG)/usr/share/build-essential \
+		debian/$(CROSS_PKG)/usr/share/$(CROSS_PKG)
+
+	printf > debian/$(CROSS_PKG).substvars "build-essential=%s\n" \
+		"`./list2depends $(DEB_TARGET_ARCH) < list`"
+
+	mkdir -p debian/$(CROSS_PKG)/usr/share/doc/$(CROSS_PKG)
+	ln -s	../../$(CROSS_PKG)/list \
+		../../$(CROSS_PKG)/essential-packages-list \
+		debian/$(CROSS_PKG)/usr/share/doc/$(CROSS_PKG)
+
+install-arch: build-arch
 	dh_testdir
 	dh_testroot
 	dh_clean -k
@@ -49,11 +100,22 @@
 		debian/build-essential/usr/share/doc/build-essential
 
 # Build architecture-independent files here.
-binary-indep: build install
-# Nothing to do
+binary-indep: build-indep install-indep
+	dh_testdir
+	dh_testroot
+
+	dh_installdocs
+	dh_installchangelogs
+	dh_link
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
 
 # Build architecture-dependent files here.
-binary-arch: build install
+binary-arch: build-arch install-arch
 	dh_testdir
 	dh_testroot
 
@@ -68,4 +130,5 @@
 	dh_builddeb
 
 binary: binary-indep binary-arch
-.PHONY: build clean svnclean binary-indep binary-arch binary install
+.PHONY: control build-indep build-arch clean svnclean
+.PHONY: binary-indep binary-arch binary install-indep install-arch
diff -Naur -x '*.sw*' build-essential-11.5.orig/list build-essential-11.5/list
--- build-essential-11.5.orig/list	2010-03-14 17:46:28.000000000 -0400
+++ build-essential-11.5/list	1969-12-31 19:00:00.000000000 -0500
@@ -1,93 +0,0 @@
-                   List of Build-Essential packages
-                    as of 2010-03-14, Debian sid
-
-This file lists the non-essential packages that are build-essential.
-The list is not closed under the "depends on" relation, so one will
-usually need to install more packages than given here.
-
-This list attempts to document the set of build-essential packages as
-well as possible.  However, it is not authoritative (actually, there
-is no authoritative list at all); the definition of the
-"build-essential" class of packages given in Debian Policy Manual
-(version >= 3.6.1.1), section 4 "Source packages" (more precisely
-subsection 4.2 "Package relationships") is the definitive answer.
-Here's the definition (as of Policy 3.6.1.1):
-
-    It is not necessary to explicitly specify build-time relationships
-    on a minimal set of packages that are always needed to compile,
-    link and put in a Debian package a standard "Hello World!" program
-    written in C or C++.  The required packages are called
-    _build-essential_, and an informational list can be found in
-    `/usr/share/doc/build-essential/list' (which is contained in the
-    `build-essential' package).
-
-The list is given below in a format which is readable by both humans and
-programs.  The format is described at the end of this file.
-
-BEGIN LIST OF PACKAGES
-libc6-dev [!alpha !ia64 !hurd-i386] | libc0.3-dev [hurd-i386] | libc6.1-dev [alpha ia64] | libc-dev
-  Provides the ISO C standard library
-  Indirectly depended on by g++, but we'll ignore
-  it since libc6-dev is used for non-C++ programs too.
-
-libc6-dev-sparc64 [sparc]
-  Used only on the sparc architecture.
-
-gcc (>= 4:4.4.3)
-g++ (>= 4:4.4.3)
-
-  NOTE:
-  The libstdc++ -dev library is not needed, as g++ depends on it
-
-make
-  Also depended on by dpkg-dev, but make does warrant its own
-  dependency since debian/rules will need it even if dpkg-dev
-  stopped depending on it
-
-dpkg-dev (>= 1.13.5)
-  Provides dpkg-genchanges and other scripts.  Versioned, because
-  of support for the build-time dependency fields in /debian/control
-  and dpkg-architecture support for OS and CPU information.
-
-  NOTE:
-  Although this list does not contain them, all `Essential: yes'
-  packages are build-essential as well.  A list of such packages
-  can be found by executing the following command
-     `grep-status -FEssential -sPackage -ni yes'
-  when the `grep-dctrl' package is installed and in its default
-  configuration.  Such list is installed with this package as
-  the file
-     `/usr/share/doc/build-essential/essential-packages-list'
- 
-hurd-dev [hurd-i386]
-  Provides libpthread.so (and other such essential components).
-
-END LIST OF PACKAGES
-
-Here's the format definition:
-
-   - First line is the following, without any leading or trailing
-     whitespace:
-        BEGIN LIST OF PACKAGES
-
-   - Last line is the following, without any leading or trailing
-     whitespace:
-        END LIST OF PACKAGES
-
-   - A line with leading whitespace is a comment.
-
-   - Other lines are joined with end-of-line replaced by comma, and
-     the result is parsed like the body of the Build-Depends field.
-     The list of build-essential packages for a particular
-     architecture is constructed from the result list by ignoring all
-     the package name - package version pairs which would be ignored
-     if we were building for that architecture and then removing the
-     architecture specifications.
-
-The Python program list2depends parses stdin as if it were this
-file and outputs one line that is suitable for use in a dependency
-field body of a Debian binary package.
-
-Local Variables:
-mode: text
-End:
diff -Naur -x '*.sw*' build-essential-11.5.orig/list2depends build-essential-11.5/list2depends
--- build-essential-11.5.orig/list2depends	2003-09-25 21:13:30.000000000 -0400
+++ build-essential-11.5/list2depends	2012-06-24 15:43:06.860619566 -0400
@@ -22,7 +22,7 @@
 end_header = 'END LIST OF PACKAGES\n'
 
 comment_re = re.compile("^\s+")
-depends_re = re.compile('([-a-z0-9+.]+)\s*(\\(.+?\\))?\s*(\\[(.+?)\\])?')
+depends_re = re.compile('([-a-z0-9+.:]+)\s*(\\(.+?\\))?\s*(\\[(.+?)\\])?')
 
 line = sys.stdin.readline()
 
diff -Naur -x '*.sw*' build-essential-11.5.orig/list.cross.in build-essential-11.5/list.cross.in
--- build-essential-11.5.orig/list.cross.in	1969-12-31 19:00:00.000000000 -0500
+++ build-essential-11.5/list.cross.in	2012-06-24 15:43:06.860619566 -0400
@@ -0,0 +1,59 @@
+                List of Cross-Build-Essential packages
+                    as of 2012-06-24, Debian sid
+
+This file lists the non-essential packages that are cross-build-
+essential.  The list is not closed under the "depends on" relation, so
+one will usually need to install more packages than given here.
+
+This list attempts to document the set of cross-build-essential
+packages as well as possible.  However, it is not authoritative
+(actually, there is no authoritative list at all).
+
+The list is given below in a format which is readable by both humans and
+programs.  The format is described at the end of this file.
+
+BEGIN LIST OF PACKAGES
+libc6-dev:@DEB_TARGET_ARCH@ [!alpha !ia64 !hurd-i386] | libc0.3-dev:@DEB_TARGET_ARCH@ [hurd-i386] | libc6.1-dev:@DEB_TARGET_ARCH@ [alpha ia64] | libc-dev:@DEB_TARGET_ARCH@
+  Provides the ISO C standard library
+  Indirectly depended on by g++, but we'll ignore
+  it since libc6-dev is used for non-C++ programs too.
+
+gcc-@DEB_TARGET_MULTIARCH@ (>= 4:4.4.3)
+g++-@DEB_TARGET_MULTIARCH@ (>= 4:4.4.3)
+
+  NOTE:
+  The libstdc++ -dev library is not needed, as g++ depends on it
+
+pkg-config-@DEB_TARGET_MULTIARCH@
+
+dpkg-cross
+
+END LIST OF PACKAGES
+
+Here's the format definition:
+
+   - First line is the following, without any leading or trailing
+     whitespace:
+        BEGIN LIST OF PACKAGES
+
+   - Last line is the following, without any leading or trailing
+     whitespace:
+        END LIST OF PACKAGES
+
+   - A line with leading whitespace is a comment.
+
+   - Other lines are joined with end-of-line replaced by comma, and
+     the result is parsed like the body of the Build-Depends field.
+     The list of build-essential packages for a particular
+     architecture is constructed from the result list by ignoring all
+     the package name - package version pairs which would be ignored
+     if we were building for that architecture and then removing the
+     architecture specifications.
+
+The Python program list2depends parses stdin as if it were this
+file and outputs one line that is suitable for use in a dependency
+field body of a Debian binary package.
+
+Local Variables:
+mode: text
+End:
diff -Naur -x '*.sw*' build-essential-11.5.orig/list.native build-essential-11.5/list.native
--- build-essential-11.5.orig/list.native	1969-12-31 19:00:00.000000000 -0500
+++ build-essential-11.5/list.native	2010-03-14 17:46:28.000000000 -0400
@@ -0,0 +1,93 @@
+                   List of Build-Essential packages
+                    as of 2010-03-14, Debian sid
+
+This file lists the non-essential packages that are build-essential.
+The list is not closed under the "depends on" relation, so one will
+usually need to install more packages than given here.
+
+This list attempts to document the set of build-essential packages as
+well as possible.  However, it is not authoritative (actually, there
+is no authoritative list at all); the definition of the
+"build-essential" class of packages given in Debian Policy Manual
+(version >= 3.6.1.1), section 4 "Source packages" (more precisely
+subsection 4.2 "Package relationships") is the definitive answer.
+Here's the definition (as of Policy 3.6.1.1):
+
+    It is not necessary to explicitly specify build-time relationships
+    on a minimal set of packages that are always needed to compile,
+    link and put in a Debian package a standard "Hello World!" program
+    written in C or C++.  The required packages are called
+    _build-essential_, and an informational list can be found in
+    `/usr/share/doc/build-essential/list' (which is contained in the
+    `build-essential' package).
+
+The list is given below in a format which is readable by both humans and
+programs.  The format is described at the end of this file.
+
+BEGIN LIST OF PACKAGES
+libc6-dev [!alpha !ia64 !hurd-i386] | libc0.3-dev [hurd-i386] | libc6.1-dev [alpha ia64] | libc-dev
+  Provides the ISO C standard library
+  Indirectly depended on by g++, but we'll ignore
+  it since libc6-dev is used for non-C++ programs too.
+
+libc6-dev-sparc64 [sparc]
+  Used only on the sparc architecture.
+
+gcc (>= 4:4.4.3)
+g++ (>= 4:4.4.3)
+
+  NOTE:
+  The libstdc++ -dev library is not needed, as g++ depends on it
+
+make
+  Also depended on by dpkg-dev, but make does warrant its own
+  dependency since debian/rules will need it even if dpkg-dev
+  stopped depending on it
+
+dpkg-dev (>= 1.13.5)
+  Provides dpkg-genchanges and other scripts.  Versioned, because
+  of support for the build-time dependency fields in /debian/control
+  and dpkg-architecture support for OS and CPU information.
+
+  NOTE:
+  Although this list does not contain them, all `Essential: yes'
+  packages are build-essential as well.  A list of such packages
+  can be found by executing the following command
+     `grep-status -FEssential -sPackage -ni yes'
+  when the `grep-dctrl' package is installed and in its default
+  configuration.  Such list is installed with this package as
+  the file
+     `/usr/share/doc/build-essential/essential-packages-list'
+ 
+hurd-dev [hurd-i386]
+  Provides libpthread.so (and other such essential components).
+
+END LIST OF PACKAGES
+
+Here's the format definition:
+
+   - First line is the following, without any leading or trailing
+     whitespace:
+        BEGIN LIST OF PACKAGES
+
+   - Last line is the following, without any leading or trailing
+     whitespace:
+        END LIST OF PACKAGES
+
+   - A line with leading whitespace is a comment.
+
+   - Other lines are joined with end-of-line replaced by comma, and
+     the result is parsed like the body of the Build-Depends field.
+     The list of build-essential packages for a particular
+     architecture is constructed from the result list by ignoring all
+     the package name - package version pairs which would be ignored
+     if we were building for that architecture and then removing the
+     architecture specifications.
+
+The Python program list2depends parses stdin as if it were this
+file and outputs one line that is suitable for use in a dependency
+field body of a Debian binary package.
+
+Local Variables:
+mode: text
+End:
