diff -pruN 1.46.1-7/boost/config/stdlib/libstdcpp3.hpp 1.46.1-7ubuntu3/boost/config/stdlib/libstdcpp3.hpp
--- 1.46.1-7/boost/config/stdlib/libstdcpp3.hpp	2011-03-07 13:07:30.000000000 +0000
+++ 1.46.1-7ubuntu3/boost/config/stdlib/libstdcpp3.hpp	2012-01-02 18:45:44.000000000 +0000
@@ -33,7 +33,8 @@
 
 #ifdef __GLIBCXX__ // gcc 3.4 and greater:
 #  if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
-        || defined(_GLIBCXX__PTHREADS)
+        || defined(_GLIBCXX__PTHREADS) \
+        || defined(_GLIBCXX_HAS_GTHREADS)
       //
       // If the std lib has thread support turned on, then turn it on in Boost
       // as well.  We do this because some gcc-3.4 std lib headers define _REENTANT
diff -pruN 1.46.1-7/boost/smart_ptr/detail/spinlock_gcc_arm.hpp 1.46.1-7ubuntu3/boost/smart_ptr/detail/spinlock_gcc_arm.hpp
--- 1.46.1-7/boost/smart_ptr/detail/spinlock_gcc_arm.hpp	2009-03-02 16:22:16.000000000 +0000
+++ 1.46.1-7ubuntu3/boost/smart_ptr/detail/spinlock_gcc_arm.hpp	2012-01-02 18:45:44.000000000 +0000
@@ -29,11 +29,15 @@ public:
     {
         int r;
 
+#ifdef	G_ATOMIC_ARM_USE_GCC_INTRINSICS
+		r =  __sync_lock_test_set(&v_, 1);
+#else
         __asm__ __volatile__(
             "swp %0, %1, [%2]":
             "=&r"( r ): // outputs
             "r"( 1 ), "r"( &v_ ): // inputs
             "memory", "cc" );
+#endif
 
         return r == 0;
     }
diff -pruN 1.46.1-7/debian/changelog 1.46.1-7ubuntu3/debian/changelog
--- 1.46.1-7/debian/changelog	2011-08-18 04:22:02.000000000 +0000
+++ 1.46.1-7ubuntu3/debian/changelog	2012-01-02 15:09:13.000000000 +0000
@@ -1,3 +1,28 @@
+boost1.46 (1.46.1-7ubuntu3) precise; urgency=low
+
+  * Fix threading detection with GCC-4.7, taken from the trunk.
+
+ -- Matthias Klose <doko@ubuntu.com>  Mon, 02 Jan 2012 16:08:32 +0100
+
+boost1.46 (1.46.1-7ubuntu2) precise; urgency=low
+
+  * Rebuild for libicu48.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Mon, 21 Nov 2011 22:30:59 +0000
+
+boost1.46 (1.46.1-7ubuntu1) precise; urgency=low
+
+  * Merge with Debian testing.  Remaining Ubuntu changes:
+    - Detect gcc atomic intrinsics, needed for arm spinlock (LP: #513721)
+    - Drop libboost-mpi, libboost-mpi-python, and libboost-graph-parallel (and
+      related -dev packages): we don't want to pull all of the mpi packages
+      into main.  These are provided in a separate boost-mpi-source1.46
+      package
+    - Drop libboost1.46-all-dev and provide from boost-mpi-source1.46
+    - Adjust debian/rules and debian/control
+
+ -- Barry Warsaw <barry@ubuntu.com>  Wed, 26 Oct 2011 21:56:45 -0400
+
 boost1.46 (1.46.1-7) unstable; urgency=low
 
   * control: Fix ungrammatical description for iostreams packages.
@@ -17,6 +42,25 @@ boost1.46 (1.46.1-6) unstable; urgency=l
 
  -- Steve M. Robbins <smr@debian.org>  Sun, 12 Jun 2011 00:37:42 -0500
 
+boost1.46 (1.46.1-5ubuntu2) oneiric; urgency=low
+
+  * No change rebuild to drop Python 3.1 support.
+
+ -- Barry Warsaw <barry@ubuntu.com>  Fri, 03 Jun 2011 16:28:02 -0400
+
+boost1.46 (1.46.1-5ubuntu1) oneiric; urgency=low
+
+  * Merge from debian unstable.  Remaining changes:
+    - Detect gcc atomic intrinsics, needed for arm spinlock (LP: 513721)
+    - Drop libboost-mpi, libboost-mpi-python, and libboost-graph-parallel (and
+      related -dev packages): we don't want to pull all of the mpi packages
+      into main.  These are provided in a separate boost-mpi-source1.46
+      package
+    - Drop libboost1.46-all-dev and provide from boost-mpi-source1.46
+    - Adjust debian/rules and debian/control
+
+ -- Scott Kitterman <scott@kitterman.com>  Fri, 20 May 2011 09:46:06 -0400
+
 boost1.46 (1.46.1-5) unstable; urgency=low
 
   * patches/openssl-no-ssl2.patch.  New (thanks, Lubo~ Dole~el).  Throw
@@ -25,6 +69,26 @@ boost1.46 (1.46.1-5) unstable; urgency=l
 
  -- Steve M. Robbins <smr@debian.org>  Mon, 09 May 2011 21:34:12 -0500
 
+boost1.46 (1.46.1-4ubuntu2) oneiric; urgency=low
+
+  * Restore libboost-python$(PKGVERSION)-dev install rule inadvertently
+    dropped during merge
+
+ -- Scott Kitterman <scott@kitterman.com>  Fri, 29 Apr 2011 09:09:28 -0400
+
+boost1.46 (1.46.1-4ubuntu1) oneiric; urgency=low
+
+  * Merge from Debian Unstable (based on boost1.42). Remaining Ubuntu changes:
+    - Detect gcc atomic intrinsics, needed for arm spinlock (LP: 513721)
+    - Drop libboost-mpi, libboost-mpi-python, and libboost-graph-parallel (and
+      related -dev packages): we don't want to pull all of the mpi packages
+      into main.  These are provided in a separate boost-mpi-source1.46
+      package
+    - Drop libboost1.46-all-dev and provide from boost-mpi-source1.46
+    - Adjust debian/rules and debian/control
+
+ -- Scott Kitterman <scott@kitterman.com>  Thu, 28 Apr 2011 10:07:48 -0400
+
 boost1.46 (1.46.1-4) unstable; urgency=low
 
   * NEWS.Debian: fix format.
@@ -1706,3 +1770,4 @@ boost (1.21.1-1) unstable; urgency=low
   * First upstream version.
 
  -- Raphael Bossek <bossekr@debian.org>  Mon, 12 Mar 2001 23:37:49 +0100
+
diff -pruN 1.46.1-7/debian/control 1.46.1-7ubuntu3/debian/control
--- 1.46.1-7/debian/control	2011-08-12 03:44:47.000000000 +0000
+++ 1.46.1-7ubuntu3/debian/control	2011-10-27 01:53:26.000000000 +0000
@@ -2,10 +2,11 @@ Source: boost1.46
 Homepage: http://www.boost.org/
 Section: libs
 Priority: optional
-Maintainer: Debian Boost Team <pkg-boost-devel@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian Boost Team <pkg-boost-devel@lists.alioth.debian.org>
 Uploaders: Steve M. Robbins <smr@debian.org>, Domenico Andreoli <cavok@debian.org>
 Build-Depends: debhelper (>= 8), 
- zlib1g-dev, libbz2-dev, libicu-dev, mpi-default-dev,
+ zlib1g-dev, libbz2-dev, libicu-dev, 
  bison, flex, docbook-to-man, help2man, xsltproc, doxygen, 
  python, python-all-dev, 
  python3, python3-all-dev (>= 3.1)
@@ -33,11 +34,9 @@ Depends: ${misc:Depends}, ${shlibs:Depen
 Suggests: libboost1.46-doc,
  libboost-date-time1.46-dev,
  libboost-filesystem1.46-dev,
- libboost-graph-parallel1.46-dev,
  libboost-graph1.46-dev,
  libboost-iostreams1.46-dev,
  libboost-math1.46-dev,
- libboost-mpi1.46-dev,
  libboost-program-options1.46-dev,
  libboost-python1.46-dev,
  libboost-random1.46-dev,
@@ -72,41 +71,6 @@ Description: Boost C++ Libraries develop
  filesystem, graph, iostreams, math, mpi, program_options, python,
  regex, serialization, signals, system, test, thread, and wave.
 
-Package: libboost1.46-all-dev
-Architecture: any
-Section: libdevel
-Depends: ${misc:Depends},
- libboost1.46-dev,
- libboost-date-time1.46-dev, 
- libboost-filesystem1.46-dev, 
- libboost-graph1.46-dev, 
- libboost-graph-parallel1.46-dev, 
- libboost-iostreams1.46-dev, 
- libboost-math1.46-dev, 
- libboost-mpi1.46-dev, 
- libboost-mpi-python1.46-dev, 
- libboost-program-options1.46-dev, 
- libboost-python1.46-dev, 
- libboost-random1.46-dev, 
- libboost-regex1.46-dev, 
- libboost-serialization1.46-dev, 
- libboost-signals1.46-dev, 
- libboost-system1.46-dev, 
- libboost-test1.46-dev, 
- libboost-thread1.46-dev, 
- libboost-wave1.46-dev
-Description: Boost C++ Libraries development files (ALL)
- The Boost web site provides free, peer-reviewed, portable C++ source
- libraries. The emphasis is on libraries which work well with the C++
- Standard Library. One goal is to establish "existing practice" and
- provide reference implementations so that the Boost libraries are
- suitable for eventual standardization. Some of the libraries have
- already been proposed for inclusion in the C++ Standards Committee's
- upcoming C++ Standard Library Technical Report.
- .
- This package provides the complete Boost development environment,
- including all separately-packaged libraries.
-
 Package: libboost1.46-doc
 Homepage: http://www.boost.org/libs/
 Architecture: all
@@ -215,42 +179,6 @@ Description: generic graph components an
  standardized generic interface for traversing graphs is of utmost
  importance to encourage reuse of graph algorithms and data structures.
 
-Package: libboost-graph-parallel1.46.1
-Homepage: http://www.boost.org/libs/graph_parallel/
-Architecture: any
-Section: libs
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Suggests: graphviz
-Description: generic graph components and algorithms in C++
- This package forms part of the Boost C++ Libraries collection.
- .
- The Parallel Boost Graph Library is an extension to the Boost Graph Library
- (BGL) for parallel and distributed computing. It offers distributed graphs 
- and graph algorithms to exploit coarse-grained parallelism along with 
- parallel algorithms that exploit fine-grained parallelism, while retaining 
- the same interfaces as the (sequential) BGL. Code written using the sequential
- BGL should be easy to parallelize with the parallel BGL.
-
-Package: libboost-graph-parallel1.46-dev
-Homepage: http://www.boost.org/libs/graph_parallel/
-Architecture: any
-Section: libdevel
-Depends: ${misc:Depends},
- libboost1.46-dev (= ${binary:Version}),
- libboost-serialization1.46-dev (= ${binary:Version}),
- libboost-test1.46-dev (= ${binary:Version})
-Conflicts: libboost-graph-parallel1.42-dev
-Recommends: libboost-graph-parallel1.46.1 (= ${binary:Version})
-Description: generic graph components and algorithms in C++
- This package forms part of the Boost C++ Libraries collection.
- .
- The Parallel Boost Graph Library is an extension to the Boost Graph Library
- (BGL) for parallel and distributed computing. It offers distributed graphs 
- and graph algorithms to exploit coarse-grained parallelism along with 
- parallel algorithms that exploit fine-grained parallelism, while retaining 
- the same interfaces as the (sequential) BGL. Code written using the sequential
- BGL should be easy to parallelize with the parallel BGL.
-
 Package: libboost-iostreams1.46.1
 Homepage: http://www.boost.org/libs/iostreams/
 Architecture: any
@@ -321,83 +249,6 @@ Description: Boost.Math Library developm
   * Implementation Toolkit: Provides many of the tools required to implement 
     mathematical special functions.
 
-Package: libboost-mpi1.46.1
-Homepage: http://www.boost.org/doc/html/mpi.html
-Architecture: any
-Section: libs
-Depends: ${misc:Depends}, ${shlibs:Depends}
-Description: C++ interface to the Message Passing Interface (MPI)
- This package forms part of the Boost C++ Libraries collection.
- .
- The Boost.MPI library provides a C++ interface to MPI that
- supports modern C++ development styles, including complete support for
- user-defined data types and C++ Standard Library types, arbitrary function
- objects for collective algorithms, and the use of modern C++ library
- techniques to maintain maximal efficiency.
-
-Package: libboost-mpi1.46-dev
-Homepage: http://www.boost.org/doc/html/mpi.html
-Architecture: any
-Section: libdevel
-Depends: ${misc:Depends},
- libboost1.46-dev (= ${binary:Version}),
- libboost-serialization1.46-dev (= ${binary:Version}),
- libboost-mpi1.46.1 (= ${binary:Version}),
- mpi-default-dev
-Suggests: libboost-graph1.46-dev
-Conflicts: libboost-mpi1.42-dev
-Description: C++ interface to the Message Passing Interface (MPI)
- This package forms part of the Boost C++ Libraries collection.
- .
- The Boost.MPI library provides a C++ interface to MPI that
- supports modern C++ development styles, including complete support for
- user-defined data types and C++ Standard Library types, arbitrary function
- objects for collective algorithms, and the use of modern C++ library
- techniques to maintain maximal efficiency.
-
-Package: libboost-mpi-python1.46.1
-Homepage: http://www.boost.org/doc/html/mpi/python.html
-Architecture: any
-Section: python
-Depends: ${misc:Depends}, ${shlibs:Depends}, ${python:Depends}
-Suggests: python, python3
-Breaks: ${python:Breaks}
-Conflicts: libboost-mpi-python1.40.0,
- libboost-mpi-python1.41.0,
- libboost-mpi-python1.42.0,
- libboost-mpi-python1.46.0
-Description: C++ interface to the Message Passing Interface (MPI), Python Bindings
- This package forms part of the Boost C++ Libraries collection.
- .
- The Boost.MPI library provides a C++ interface to MPI that
- supports modern C++ development styles, including complete support for
- user-defined data types and C++ Standard Library types, arbitrary function
- objects for collective algorithms, and the use of modern C++ library
- techniques to maintain maximal efficiency.
- .
- This package provides Python Bindings to the C++ interface.
- .
- One of the python interpreter packages is required to use the bindings.
-
-Package: libboost-mpi-python1.46-dev
-Homepage: http://www.boost.org/doc/html/mpi/python.html
-Architecture: any
-Section: libdevel
-Depends: ${misc:Depends},
- libboost-mpi1.46-dev (= ${binary:Version}),
- libboost-mpi-python1.46.1 (= ${binary:Version})
-Conflicts: libboost-mpi-python1.42-dev
-Description: C++ interface to the Message Passing Interface (MPI), Python Bindings
- This package forms part of the Boost C++ Libraries collection.
- .
- The Boost.MPI library provides a C++ interface to MPI that
- supports modern C++ development styles, including complete support for
- user-defined data types and C++ Standard Library types, arbitrary function
- objects for collective algorithms, and the use of modern C++ library
- techniques to maintain maximal efficiency.
- .
- This package provides Python Bindings to the C++ interface.
-
 Package: libboost-program-options1.46.1
 Homepage: http://www.boost.org/libs/program_options/
 Architecture: any
diff -pruN 1.46.1-7/debian/patches/gcc-4.7-threading-detection.patch 1.46.1-7ubuntu3/debian/patches/gcc-4.7-threading-detection.patch
--- 1.46.1-7/debian/patches/gcc-4.7-threading-detection.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1.46.1-7ubuntu3/debian/patches/gcc-4.7-threading-detection.patch	2012-01-02 15:07:58.000000000 +0000
@@ -0,0 +1,10 @@
+--- a/boost/config/stdlib/libstdcpp3.hpp
++++ b/boost/config/stdlib/libstdcpp3.hpp
+@@ -34,5 +34,6 @@
+ #ifdef __GLIBCXX__ // gcc 3.4 and greater:
+ #  if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
+-        || defined(_GLIBCXX__PTHREADS)
++        || defined(_GLIBCXX__PTHREADS) \
++        || defined(_GLIBCXX_HAS_GTHREADS)
+       //
+       // If the std lib has thread support turned on, then turn it on in Boost
diff -pruN 1.46.1-7/debian/patches/gcc-atomic-intrinsics.patch 1.46.1-7ubuntu3/debian/patches/gcc-atomic-intrinsics.patch
--- 1.46.1-7/debian/patches/gcc-atomic-intrinsics.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1.46.1-7ubuntu3/debian/patches/gcc-atomic-intrinsics.patch	2011-10-27 01:49:51.000000000 +0000
@@ -0,0 +1,20 @@
+Index: boost1.40-1.40.0/boost/smart_ptr/detail/spinlock_gcc_arm.hpp
+===================================================================
+--- boost1.40-1.40.0.orig/boost/smart_ptr/detail/spinlock_gcc_arm.hpp	2009-03-02 11:22:16.000000000 -0500
++++ boost1.40-1.40.0/boost/smart_ptr/detail/spinlock_gcc_arm.hpp	2010-03-27 15:40:14.227864125 -0400
+@@ -29,11 +29,15 @@
+     {
+         int r;
+ 
++#ifdef	G_ATOMIC_ARM_USE_GCC_INTRINSICS
++		r =  __sync_lock_test_set(&v_, 1);
++#else
+         __asm__ __volatile__(
+             "swp %0, %1, [%2]":
+             "=&r"( r ): // outputs
+             "r"( 1 ), "r"( &v_ ): // inputs
+             "memory", "cc" );
++#endif
+ 
+         return r == 0;
+     }
diff -pruN 1.46.1-7/debian/patches/series 1.46.1-7ubuntu3/debian/patches/series
--- 1.46.1-7/debian/patches/series	2011-05-10 02:29:51.000000000 +0000
+++ 1.46.1-7ubuntu3/debian/patches/series	2012-01-02 15:08:26.000000000 +0000
@@ -11,3 +11,5 @@ kfreebsd-thread.patch
 fusion-name-qual.patch
 boost-1.44-py3.1.patch
 changeset_71050.diff
+gcc-atomic-intrinsics.patch
+gcc-4.7-threading-detection.patch
diff -pruN 1.46.1-7/debian/rules 1.46.1-7ubuntu3/debian/rules
--- 1.46.1-7/debian/rules	2011-07-23 03:05:46.000000000 +0000
+++ 1.46.1-7ubuntu3/debian/rules	2011-10-27 01:52:45.000000000 +0000
@@ -16,8 +16,7 @@ SHLIBS_VERSION = (>= 1.46.1-1)
 pyversions = $(shell pyversions -rv) $(shell py3versions -rv)
 
 # Boost libraries for which we want separate packages
-boost_libs := date-time filesystem graph-parallel graph iostreams math \
-	mpi mpi-python						       \
+boost_libs := date-time filesystem graph iostreams math \
 	program-options python regex random serialization signals      \
 	system test						       \
 	thread wave
@@ -30,7 +29,6 @@ boost_lib_test := prg_exec_monitor test_
 
 # These are special cases for suffixes.  Generally come from --python-buildid, so begin with a dash.
 boost_suffixes_python := $(addprefix -py,$(subst .,,$(pyversions)))
-boost_suffixes_mpi-python := $(boost_suffixes_python)
 
 # Files that are generated by filtering a template
 filtered_files = \
@@ -149,8 +147,6 @@ else
 JAM_OPT += --disable-long-double
 endif
 
-MPI_CONFIG = "using mpi ;"
-
 exampledir = debian/libboost$(PKGVERSION)-doc/usr/share/doc/libboost$(PKGVERSION)-doc/examples
 htmldir = debian/libboost$(PKGVERSION)-doc/usr/share/doc/libboost$(PKGVERSION)-doc/HTML
 pyste_prefix = $(CURDIR)/debian/libboost-python$(PKGVERSION)-dev/usr
@@ -169,7 +165,6 @@ debian/bjam.1: $(bjam)
 
 user-config.jam:
 	echo $(TOOLSET_CONFIG) > $@
-	echo $(MPI_CONFIG)     >> $@
 	for pyver in $(filter-out $(shell pyversions -dv),$(pyversions)); do \
 		echo "using python : $$pyver : /usr ;" >> $@; \
 	done
@@ -182,8 +177,7 @@ build-stamp: $(bjam) user-config.jam
 	for pyver in $(pyversions); do \
 	 	pyid=$$(echo $$pyver | tr -d .); \
 		echo "Building Boost.Python for python version $$pyver"; \
-	 	$(JAM) --with-python --with-mpi --python-buildid=py$$pyid python=$$pyver; \
-	 	mv stage/lib/mpi.so stage/lib/mpi-py$$pyid.so; \
+	 	$(JAM) --with-python --python-buildid=py$$pyid python=$$pyver; \
 	done
 
 	cd $(bbv2dir) && ./bootstrap.sh --with-toolset=gcc
@@ -238,12 +232,11 @@ install: build clean-debhelper $(filtere
 	@$(call cp_debhelper,libboost-dev,libboost$(PKGVERSION)-dev)
 	@$(call cp_debhelper,libboost-doc,libboost$(PKGVERSION)-doc)
 	@$(call cp_debhelper,libboost-python-dev,libboost-python$(PKGVERSION)-dev)
-	@$(call cp_debhelper,libboost-mpi-python-dev,libboost-mpi-python$(PKGVERSION)-dev)
 
 	$(JAM) --prefix=$(CURDIR)/debian/tmp/usr install --without-python                        
 	for pyver in $(pyversions); do \
 		pyid=`echo $$pyver | tr -d .`; \
-		$(JAM) --prefix=$(CURDIR)/debian/tmp/usr install --with-python --with-mpi --python-buildid=py$$pyid python=$$pyver; \
+		$(JAM) --prefix=$(CURDIR)/debian/tmp/usr install --with-python --python-buildid=py$$pyid python=$$pyver; \
 	done
 
 	# Install Boost.Build v2 & jam
@@ -251,7 +244,6 @@ install: build clean-debhelper $(filtere
 	mv debian/tmp/usr/share/boost-build/example debian/boost-build-examples
 
 	install --mode=755 -D debian/rtupdate debian/tmp/usr/share/python/runtime.d/libboost-python$(PKGVERSION)-dev.rtupdate
-	install --mode=755 -D debian/rtupdate debian/tmp/usr/share/python/runtime.d/libboost-mpi-python$(PKGVERSION)-dev.rtupdate
 
 	find debian/tmp/usr/include debian/tmp/usr/share/boost-build -type f | xargs chmod 644
 	find debian/tmp -name .cvsignore | xargs rm -f
@@ -296,20 +288,9 @@ install: build clean-debhelper $(filtere
 	cat debian/example-files | xargs cp -a --parents --target-directory=$(exampledir)
 	find $(exampledir) -type f | xargs chmod 644
 
-	# package libboost-mpi-python$(SOVERSION)
-	dh_install -plibboost-mpi-python$(SOVERSION)
-	for pyver in $(pyversions); do \
-		pyid=`echo $$pyver | tr -d .`; \
-		dh_install -plibboost-mpi-python$(SOVERSION) libs/mpi/build/__init__.py usr/lib/python$$pyver/site-packages/boost; \
-		dh_installdirs -plibboost-mpi-python$(SOVERSION) usr/lib/python$$pyver/site-packages/boost; \
-		cp stage/lib/mpi-py$$pyid.so debian/libboost-mpi-python$(SOVERSION)/usr/lib/python$$pyver/site-packages/boost/mpi.so; \
-	done
-	# package libboost-mpi-python$(PKGVERSION)-dev
-	dh_install -plibboost-python$(PKGVERSION)-dev --autodest \
-	   debian/tmp/usr/share/python/runtime.d/libboost-mpi-python$(PKGVERSION)-dev.rtupdate
 	# package libboost-python$(PKGVERSION)-dev
 	dh_install -plibboost-python$(PKGVERSION)-dev --autodest \
-	   debian/tmp/usr/share/python/runtime.d/libboost-python$(PKGVERSION)-dev.rtupdate
+	  debian/tmp/usr/share/python/runtime.d/libboost-python$(PKGVERSION)-dev.rtupdate
 
 	cd libs/python/pyste/install && python setup.py install --no-compile --prefix=$(pyste_prefix) --install-lib=$(pyste_prefix)/share/pyshared
 	mv $(pyste_prefix)/bin/pyste.py $(pyste_prefix)/bin/pyste
diff -pruN 1.46.1-7/debian/source/format 1.46.1-7ubuntu3/debian/source/format
--- 1.46.1-7/debian/source/format	2009-12-18 06:11:23.000000000 +0000
+++ 1.46.1-7ubuntu3/debian/source/format	2011-10-27 01:49:51.000000000 +0000
@@ -1 +1 @@
-3.0 (quilt)
\ No newline at end of file
+3.0 (quilt)
diff -pruN 1.46.1-7/.pc/applied-patches 1.46.1-7ubuntu3/.pc/applied-patches
--- 1.46.1-7/.pc/applied-patches	2012-01-02 18:44:40.000000000 +0000
+++ 1.46.1-7ubuntu3/.pc/applied-patches	2012-01-02 18:45:48.000000000 +0000
@@ -11,3 +11,5 @@ kfreebsd-thread.patch
 fusion-name-qual.patch
 boost-1.44-py3.1.patch
 changeset_71050.diff
+gcc-atomic-intrinsics.patch
+gcc-4.7-threading-detection.patch
diff -pruN 1.46.1-7/.pc/gcc-4.7-threading-detection.patch/boost/config/stdlib/libstdcpp3.hpp 1.46.1-7ubuntu3/.pc/gcc-4.7-threading-detection.patch/boost/config/stdlib/libstdcpp3.hpp
--- 1.46.1-7/.pc/gcc-4.7-threading-detection.patch/boost/config/stdlib/libstdcpp3.hpp	1970-01-01 00:00:00.000000000 +0000
+++ 1.46.1-7ubuntu3/.pc/gcc-4.7-threading-detection.patch/boost/config/stdlib/libstdcpp3.hpp	2011-03-07 13:07:30.000000000 +0000
@@ -0,0 +1,145 @@
+//  (C) Copyright John Maddock 2001.
+//  (C) Copyright Jens Maurer 2001.
+//  Use, modification and distribution are subject to the
+//  Boost Software License, Version 1.0. (See accompanying file
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//  See http://www.boost.org for most recent version.
+
+//  config for libstdc++ v3
+//  not much to go in here:
+
+#define BOOST_GNU_STDLIB 1
+
+#ifdef __GLIBCXX__
+#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__)
+#else
+#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__)
+#endif
+
+#if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T)
+#  define BOOST_NO_CWCHAR
+#  define BOOST_NO_CWCTYPE
+#  define BOOST_NO_STD_WSTRING
+#  define BOOST_NO_STD_WSTREAMBUF
+#endif
+
+#if defined(__osf__) && !defined(_REENTRANT) \
+  && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) )
+// GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header
+// file is included, therefore for consistency we define it here as well.
+#  define _REENTRANT
+#endif
+
+#ifdef __GLIBCXX__ // gcc 3.4 and greater:
+#  if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
+        || defined(_GLIBCXX__PTHREADS)
+      //
+      // If the std lib has thread support turned on, then turn it on in Boost
+      // as well.  We do this because some gcc-3.4 std lib headers define _REENTANT
+      // while others do not...
+      //
+#     define BOOST_HAS_THREADS
+#  else
+#     define BOOST_DISABLE_THREADS
+#  endif
+#elif defined(__GLIBCPP__) \
+        && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \
+        && !defined(_GLIBCPP__PTHREADS)
+   // disable thread support if the std lib was built single threaded:
+#  define BOOST_DISABLE_THREADS
+#endif
+
+#if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT)
+// linux on arm apparently doesn't define _REENTRANT
+// so just turn on threading support whenever the std lib is thread safe:
+#  define BOOST_HAS_THREADS
+#endif
+
+#if !defined(_GLIBCPP_USE_LONG_LONG) \
+    && !defined(_GLIBCXX_USE_LONG_LONG)\
+    && defined(BOOST_HAS_LONG_LONG)
+// May have been set by compiler/*.hpp, but "long long" without library
+// support is useless.
+#  undef BOOST_HAS_LONG_LONG
+#endif
+
+// Apple doesn't seem to reliably defined a *unix* macro
+#if !defined(CYGWIN) && (  defined(__unix__)  \
+                        || defined(__unix)    \
+                        || defined(unix)      \
+                        || defined(__APPLE__) \
+                        || defined(__APPLE)   \
+                        || defined(APPLE))
+#  include <unistd.h>
+#endif
+
+#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
+#  define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
+#  define BOOST_HAS_SLIST
+#  define BOOST_HAS_HASH
+#  define BOOST_SLIST_HEADER <ext/slist>
+# if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
+#   define BOOST_HASH_SET_HEADER <ext/hash_set>
+#   define BOOST_HASH_MAP_HEADER <ext/hash_map>
+# else
+#   define BOOST_HASH_SET_HEADER <backward/hash_set>
+#   define BOOST_HASH_MAP_HEADER <backward/hash_map>
+# endif
+#endif
+
+//  stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
+//  __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
+//  developers. He also commented:
+//
+//       "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
+//       GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
+//       Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
+//       than any release in the 4.2 series."
+//
+//  Another resource for understanding stdlibc++ features is:
+//  http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
+
+//  C++0x headers in GCC 4.3.0 and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+#  define BOOST_NO_0X_HDR_ARRAY
+#  define BOOST_NO_0X_HDR_RANDOM
+#  define BOOST_NO_0X_HDR_REGEX
+#  define BOOST_NO_0X_HDR_TUPLE
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_STD_UNORDERED  // deprecated; see following
+#  define BOOST_NO_0X_HDR_UNORDERED_MAP
+#  define BOOST_NO_0X_HDR_UNORDERED_SET
+#endif
+
+//  C++0x headers in GCC 4.4.0 and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+#  define BOOST_NO_0X_HDR_CHRONO
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_FORWARD_LIST
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#  define BOOST_NO_0X_HDR_MUTEX
+#  define BOOST_NO_0X_HDR_RATIO
+#  define BOOST_NO_0X_HDR_SYSTEM_ERROR
+#  define BOOST_NO_0X_HDR_THREAD
+#endif
+
+//  C++0x features in GCC 4.5.0 and later
+//
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+#  define BOOST_NO_NUMERIC_LIMITS_LOWEST
+#endif
+
+//  C++0x headers not yet implemented
+//
+#  define BOOST_NO_0X_HDR_CODECVT
+#  define BOOST_NO_0X_HDR_CONCEPTS
+#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
+#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#  define BOOST_NO_0X_HDR_TYPEINDEX
+
+//  --- end ---
diff -pruN 1.46.1-7/.pc/gcc-atomic-intrinsics.patch/boost/smart_ptr/detail/spinlock_gcc_arm.hpp 1.46.1-7ubuntu3/.pc/gcc-atomic-intrinsics.patch/boost/smart_ptr/detail/spinlock_gcc_arm.hpp
--- 1.46.1-7/.pc/gcc-atomic-intrinsics.patch/boost/smart_ptr/detail/spinlock_gcc_arm.hpp	1970-01-01 00:00:00.000000000 +0000
+++ 1.46.1-7ubuntu3/.pc/gcc-atomic-intrinsics.patch/boost/smart_ptr/detail/spinlock_gcc_arm.hpp	2009-03-02 16:22:16.000000000 +0000
@@ -0,0 +1,85 @@
+#ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED
+#define BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED
+
+//
+//  Copyright (c) 2008 Peter Dimov
+//
+//  Distributed under the Boost Software License, Version 1.0.
+//  See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#include <boost/smart_ptr/detail/yield_k.hpp>
+
+namespace boost
+{
+
+namespace detail
+{
+
+class spinlock
+{
+public:
+
+    int v_;
+
+public:
+
+    bool try_lock()
+    {
+        int r;
+
+        __asm__ __volatile__(
+            "swp %0, %1, [%2]":
+            "=&r"( r ): // outputs
+            "r"( 1 ), "r"( &v_ ): // inputs
+            "memory", "cc" );
+
+        return r == 0;
+    }
+
+    void lock()
+    {
+        for( unsigned k = 0; !try_lock(); ++k )
+        {
+            boost::detail::yield( k );
+        }
+    }
+
+    void unlock()
+    {
+        __asm__ __volatile__( "" ::: "memory" );
+        *const_cast< int volatile* >( &v_ ) = 0;
+    }
+
+public:
+
+    class scoped_lock
+    {
+    private:
+
+        spinlock & sp_;
+
+        scoped_lock( scoped_lock const & );
+        scoped_lock & operator=( scoped_lock const & );
+
+    public:
+
+        explicit scoped_lock( spinlock & sp ): sp_( sp )
+        {
+            sp.lock();
+        }
+
+        ~scoped_lock()
+        {
+            sp_.unlock();
+        }
+    };
+};
+
+} // namespace detail
+} // namespace boost
+
+#define BOOST_DETAIL_SPINLOCK_INIT {0}
+
+#endif // #ifndef BOOST_SMART_PTR_DETAIL_SPINLOCK_GCC_ARM_HPP_INCLUDED
