Index: py25-bsddb/Portfile
===================================================================
--- py25-bsddb/Portfile	(revision 22156)
+++ py25-bsddb/Portfile	(working copy)
@@ -42,5 +42,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-bz2/Portfile
===================================================================
--- py25-bz2/Portfile	(revision 22156)
+++ py25-bz2/Portfile	(working copy)
@@ -41,5 +41,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-curses/Portfile
===================================================================
--- py25-curses/Portfile	(revision 22156)
+++ py25-curses/Portfile	(working copy)
@@ -40,5 +40,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-gdbm/Portfile
===================================================================
--- py25-gdbm/Portfile	(revision 22156)
+++ py25-gdbm/Portfile	(working copy)
@@ -39,5 +39,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-hashlib/Portfile
===================================================================
--- py25-hashlib/Portfile	(revision 22156)
+++ py25-hashlib/Portfile	(working copy)
@@ -38,5 +38,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-mx-base/Portfile
===================================================================
--- py25-mx-base/Portfile	(revision 22156)
+++ py25-mx-base/Portfile	(working copy)
@@ -25,5 +25,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-mx-experimental/Portfile
===================================================================
--- py25-mx-experimental/Portfile	(revision 22156)
+++ py25-mx-experimental/Portfile	(working copy)
@@ -29,5 +29,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-readline/Portfile
===================================================================
--- py25-readline/Portfile	(revision 22156)
+++ py25-readline/Portfile	(working copy)
@@ -37,5 +37,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-socket-ssl/Portfile
===================================================================
--- py25-socket-ssl/Portfile	(revision 22156)
+++ py25-socket-ssl/Portfile	(working copy)
@@ -37,5 +37,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-sqlite3/Portfile
===================================================================
--- py25-sqlite3/Portfile	(revision 22156)
+++ py25-sqlite3/Portfile	(working copy)
@@ -41,5 +41,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-tkinter/Portfile
===================================================================
--- py25-tkinter/Portfile	(revision 22156)
+++ py25-tkinter/Portfile	(working copy)
@@ -38,5 +38,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-zlib/Portfile
===================================================================
--- py25-zlib/Portfile	(revision 22156)
+++ py25-zlib/Portfile	(working copy)
@@ -39,5 +39,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: py25-zopeinterface/Portfile
===================================================================
--- py25-zopeinterface/Portfile	(revision 22156)
+++ py25-zopeinterface/Portfile	(working copy)
@@ -22,5 +22,5 @@
 build.cmd		${prefix}/bin/python2.5 setup.py
 build.target	build
 destroot.cmd	${build.cmd}
-destroot.destdir	--prefix=${prefix} --root=${destroot}
+destroot.destdir	--root=${destroot}
 
Index: python25/files/patch-setup.py
===================================================================
--- python25/files/patch-setup.py	(revision 22156)
+++ python25/files/patch-setup.py	(working copy)
@@ -5,7 +5,7 @@
  
  # This global variable is used to hold the list of modules to be disabled.
 -disabled_module_list = []
-+disabled_module_list = ["zlib","_hashlib","_ssl","_bsddb","_sqlite3","_tkinter","bz2","gdbm","readline","_curses","_curses_panel","pyexpat"]
++disabled_module_list = ["zlib","_hashlib","_ssl","_bsddb","_sqlite3","_tkinter","bz2","gdbm","readline","_curses","_curses_panel"]
  
  def add_dir_to_list(dirlist, dir):
      """Add the directory 'dir' to the list 'dirlist' (at the front) if
Index: python25/Portfile
===================================================================
--- python25/Portfile	(revision 22156)
+++ python25/Portfile	(working copy)
@@ -26,6 +26,10 @@
 
 patchfiles		patch-setup.py
 
+post-patch {
+	reinplace "s|/Applications/MacPython|/Applications/MacPorts/MacPython|g" ${worksrcpath}/Mac/Makefile.in
+}
+
 configure.args	--enable-shared \
 			--mandir=${prefix}/share/man \
 			--bindir=${prefix}/bin \
@@ -40,8 +44,25 @@
 
 destroot.target	install maninstall
 post-destroot {
-	system "cd ${destroot}${prefix}/bin && mv idle idle2.5 && mv pydoc pydoc2.5 && mv python-config python-config2.5 && mv smtpd.py smtpd2.5.py && rm python"
-	system "cd ${destroot}${prefix}/share/man/man1 && mv python.1 python2.5.1"
+	if { [variant_isset framework] } {
+		if { [variant_isset default_python] } {
+			system "ln -s \"${prefix}/Library/Frameworks/Python.framework/Versions/2.5/bin/python-config2.5\" ${destroot}/${prefix}/bin/python2.5-config"
+		} else {
+			system "cd ${destroot}${prefix}/bin && rm idle && rm pydoc && rm python && mv python-config python2.5-config && rm pythonw && rm smtpd.py"
+		}
+	} else {
+		if { [variant_isset default_python] } {
+			system "cd ${destroot}${prefix}/bin && ln idle idle2.5 && ln pydoc pydoc2.5 && ln python-config python-config2.5 && ln smtpd.py smtpd2.5.py"
+		} else {
+			system "cd ${destroot}${prefix}/bin && mv idle idle2.5 && mv pydoc pydoc2.5 && mv python-config python-config2.5 && mv smtpd.py smtpd2.5.py && rm python"
+		}
+	}
+
+	if { ![variant_isset default_python] } {
+		system "cd ${destroot}${prefix}/share/man/man1 && mv python.1 python2.5.1"
+	} else {
+		system "ln -s ./python.1.gz ${destroot}${prefix}/share/man/man1/python2.5.1.gz"
+	}
 }
 
 platform darwin 8 {
@@ -50,3 +71,10 @@
 	configure.args-append 	--with-cxx=/usr/bin/g++-4.0
 }
 
+variant default_python {}
+
+variant framework {
+	configure.args-delete   --disable-framework
+	configure.args-append   --enable-framework=${prefix}/Library/Frameworks \
+		--enable-toolbox-glue
+}

