--- Portfile.orig	2008-08-16 00:11:19.000000000 -0400
+++ Portfile	2008-10-26 20:06:12.000000000 -0400
@@ -3,10 +3,9 @@
 PortSystem 1.0
 
 name			boost
-version			1.35.0
-revision		2
+version			1.36.0
 categories		devel
-maintainers		sanchom@gmail.com
+maintainers		gmail.com:sanchom
 description		Collection of portable C++ source libraries
 long_description 	Boost provides free portable peer-reviewed C++ \
 			libraries. The emphasis is on portable libraries \
@@ -15,15 +14,21 @@
 master_sites		sourceforge
 distname		${name}_[strsed ${version} {g/[.]/_/}]
 use_bzip2		yes
-checksums		md5 dce952a7214e72d6597516bcac84048b
+checksums		md5 328bfec66c312150e4c2a78dcecb504b \
+			sha1 b8f0f5d90b260aff995ef38fad4eee5e73d00810 \
+			rmd160 0ac38ee3c355c22fd5534bc806bf516890e5182d
 platforms		darwin
 use_parallel_build	yes
 
-patchfiles		patch-tools-build-v2-tools-darwin.jam \
-			patch-boost-serialization-utility.hpp \
-			patch-configure
+patchfiles		patch-configure
 
 depends_build		bin:bjam:boost-jam
+depends_lib		port:zlib port:bzip2
+
+build.env-append	BZIP2_INCLUDE=${prefix}/include BZIP2_LIBPATH=${prefix}/lib \
+			ZLIB_INCLUDE=${prefix}/include ZLIB_LIBPATH=${prefix}/lib
+destroot.env-append	BZIP2_INCLUDE=${prefix}/include BZIP2_LIBPATH=${prefix}/lib \
+			ZLIB_INCLUDE=${prefix}/include ZLIB_LIBPATH=${prefix}/lib
 
 platform darwin 9 {
 	depends_build-append	port:gmake
@@ -34,8 +39,8 @@
 	post-destroot {
 
 		# get the library version as it shows up in the library names:
-		# eg. 1_35
-		# this should be ...] 0 2] {_}] when 1_35_1 and later come out
+		# eg. 1_36
+		# this should be ...] 0 2] {_}] when 1_36_1 and later come out
 		set libver [join [lrange [split ${version} {.}] 0 1] {_}]
 		
 		# ensure the identification name of the dynamic libraries agree
@@ -53,6 +58,9 @@
 			foreach lib2 [glob -directory ${destroot}${prefix}/lib/ *-${libver}.dylib] {
 				system "install_name_tool -change ${libtail} ${installed_name} ${lib2}"
 			}
+			if { [variant_isset openmpi] && ( [variant_isset python24] || [variant_isset python25] || [variant_isset python26] ) } {
+				system "install_name_tool -change ${libtail} ${installed_name} ${destroot}${prefix}/lib/mpi.so"
+			}
 		}
 
 		# create relative symbolic links to the versioned libraries (.dylib only;
@@ -89,31 +97,58 @@
 		}
 		
 		# create a symbolic link in the include directory pointing to the current
-		# version of the boost include directory (e.g. boost-1_35/boost -> include/boost)
+		# version of the boost include directory (e.g. boost-1_36/boost -> include/boost)
 		system "cd  ${destroot}${prefix}/lib; ln -fs boost-${libver}/boost ${destroot}${prefix}/include/boost"
+		
+		if { [variant_isset openmpi] && ( [variant_isset python24] || [variant_isset python25] || [variant_isset python26] ) } {
+			if { [variant_isset python24] } {
+				set spkg ${prefix}/lib/python2.4/site-packages
+			} elseif { [variant_isset python25] } {
+				set spkg ${prefix}/lib/python2.5/site-packages
+			} elseif { [variant_isset python26] } {
+				# Can be removed once MacPorts 1.7.0 is released
+				if {![info exists frameworks_dir]} {
+					set frameworks_dir ${prefix}/Library/Frameworks
+				}
+				set spkg ${frameworks_dir}/Python.framework/Versions/2.6/lib/python2.6/site-packages
+			}
+			
+			xinstall -m 755 -d ${destroot}${spkg}
+			system "mv ${destroot}${prefix}/lib/mpi.so ${destroot}${spkg}"
+			system "install_name_tool -id ${spkg}/mpi.so ${destroot}${spkg}/mpi.so"			
+		}
 	}
 }
 
-destroot.args		PREFIX=${destroot}${prefix} EPREFIX=${destroot}${prefix} \
-			LIBDIR=${destroot}${prefix}/lib INCLUDEDIR=${destroot}${prefix}/include \
-			install
+destroot.destdir	prefix=${destroot}${prefix}
 
 configure.args		--without-libraries=python --without-icu --with-bjam=${prefix}/bin/bjam
 
-variant python24 conflicts python25 {
+variant python24 conflicts python25 python26 {
 	set pyversion		2.4
-	depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
+	depends_lib-append      port:python[strsed ${pyversion} {g/[.]//}]
+
+	configure.python	${prefix}/bin/python${pyversion}
 
 	configure.args-delete	--without-libraries=python
-	configure.args-append   --with-python=python${pyversion}
 }
 
-variant python25 conflicts python24 {
+variant python25 conflicts python24 python26 {
 	set pyversion		2.5
-	depends_lib-append      lib:libpython${pyversion}:python[strsed ${pyversion} {g/[.]//}]
+	depends_lib-append      port:python[strsed ${pyversion} {g/[.]//}]
+
+	configure.python	${prefix}/bin/python${pyversion}
+
+	configure.args-delete	--without-libraries=python
+}
+
+variant python26 conflicts python24 python25 {
+	set pyversion		2.6
+	depends_lib-append      port:python[strsed ${pyversion} {g/[.]//}]
+
+	configure.python	${prefix}/bin/python${pyversion}
 
 	configure.args-delete	--without-libraries=python
-	configure.args-append   --with-python=python${pyversion}
 }
 
 variant icu {
@@ -128,6 +163,7 @@
 
 	configure.env-append	EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
 	build.env-append	    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
+	destroot.env-append	    EXPAT_INCLUDE=${prefix}/include EXPAT_LIBPATH=${prefix}/lib
 }
 
 variant openmpi {
@@ -153,8 +189,6 @@
     }
 }
 
-# Should no longer conflict with icu in version 1.35.1, see:
-# http://svn.boost.org/trac/boost/ticket/1928
-variant complete conflicts icu description {Build all library types (debug, static, single-threaded)} {
+variant complete description {Build all library types (debug, static, single-threaded)} {
     patchfiles-append   patch-build-type-Jamroot
 }
