Index: trunk/dports/lang/python24/Portfile
===================================================================
--- trunk/dports/lang/python24/Portfile	(revision 37813)
+++ trunk/dports/lang/python24/Portfile	(revision 37814)
@@ -3,140 +3,125 @@
 PortSystem 1.0
 
-name            python24
-version         2.4.5
-revision        1
-set major_version   2
-set minor_version   4
-categories      lang
-platforms       darwin freebsd linux
-maintainers     nomaintainer
-description     An interpreted, object-oriented programming language
-long_description    Python is an interpreted, interactive, object-oriented \
-                    programming language.
+name                    python24
+version                 2.4.5
+revision                2
+set major               2
+set branch              2.4
+categories              lang
+platforms               darwin
+maintainers             nomaintainer
 
-homepage        http://www.python.org/
-master_sites    ${homepage}ftp/python/${version}/ \
-                ftp://ftp.python.org/pub/python/${version}/
-distname        Python-${version}
-checksums       md5 750b652bfdd12675e102bbe25e5e9893
-patchfiles      patch-configure \
-                patch-Makefile.pre.in \
-                patch-Lib-cgi.py \
-                patch-Lib-site.py \
-                patch-setup.py \
-                patch-Include-pyport.h \
-                patch-Mac-OSX-Makefile.in \
-                patch-Mac-OSX-IDLE-Makefile.in \
-                patch-Mac-OSX-PythonLauncher-Makefile.in
-#the bzip2-archive of 2.4.5 on python.org is broken (its a gzip-archive..);
-#use_bzip2       yes
-extract.suffix	.tgz
+description             An interpreted, object-oriented programming language
+long_description        Python is an interpreted, interactive, object-oriented \
+                        programming language.
 
-depends_lib     port:gettext
+homepage                http://www.python.org/
+master_sites            ${homepage}/ftp/python/${version}/ \
+                        ftp://ftp.python.org/pub/python/${version}/ \
+                        ftp://ftp.fastorama.com/mirrors/ftp.python.org/pub/python/${version}/ \
+                        ftp://ftp.python.jp/pub/python/${version}/
 
-configure.args  --enable-shared \
-                --mandir=${prefix}/share/man \
-                --bindir=${prefix}/bin \
-                --libdir=${prefix}/lib \
-                --without-readline \
-                --enable-framework=${prefix}/Library/Frameworks \
-                --disable-tk \
-                --enable-ipv6
+distname                Python-${version}
+extract.suffix          .tgz
+
+checksums               md5     750b652bfdd12675e102bbe25e5e9893 \
+                        sha1    927c6e93ed3ea3bee4e07eff4b0f14254dc04147 \
+                        rmd160  6c1c2905b166038fda5edb14baadbeb59acc8005
+
+patchfiles              patch-configure \
+                        patch-Makefile.pre.in \
+                        patch-Lib-cgi.py \
+                        patch-Lib-site.py \
+                        patch-setup.py \
+                        patch-Include-pyport.h \
+                        patch-Mac-OSX-Makefile.in \
+                        patch-Mac-OSX-IDLE-Makefile.in \
+                        patch-Mac-OSX-PythonLauncher-Makefile.in
+
+depends_lib             port:gettext
+
+configure.args          --enable-shared \
+                        --enable-framework=${prefix}/Library/Frameworks \
+                        --mandir=${prefix}/share/man \
+                        --without-readline \
+                        --disable-tk \
+                        --enable-ipv6
+
+use_parallel_build      no
 
 post-patch {
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/cgi.py
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/site.py
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Mac/OSX/Makefile.in
-    reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
+        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/cgi.py
+        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Lib/site.py
+        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/Mac/OSX/Makefile.in
+        reinplace "s|__PREFIX__|${prefix}|g" ${worksrcpath}/setup.py
 }
 
-build.target    all libpython2.4.dylib
+build.target            all libpython${branch}.dylib
 
 # Workaround for case-sensitive file systems
 post-build {
     if { ![file exists ${worksrcpath}/python.exe] } {
-        ln -s python ${worksrcpath}/python.exe  
+        ln -s python ${worksrcpath}/python.exe
     }
 }
 
-test.run        yes
-test.target     test
+test.run                yes
+test.target             test
 
-destroot.target frameworkinstall maninstall
+destroot.target         frameworkinstall maninstall
+
 post-destroot {
-    if { [variant_isset macosx]} {
-        set framewdir ${prefix}/Library/Frameworks/Python.framework
-        xinstall -m 755 -d ${destroot}${framewdir}/Versions/2.4/include
-       ln -s Versions/Current/lib ${destroot}${framewdir}/Libraries
-       ln -sf ${framewdir}/Versions/2.4/bin/pydoc ${destroot}${prefix}/bin/pydoc
-       ln -sf ${framewdir}/Versions/2.4/bin/pydoc ${destroot}${prefix}/bin/pydoc24
-       ln -s ${prefix}/lib/python2.4/config ${destroot}${framewdir}/Versions/2.4/lib/python2.4/config
-       ln -s ${framewdir}/Versions/2.4/lib/libpython${major_version}.${minor_version}.dylib ${destroot}${prefix}/lib/libpython${version}.dylib
-       ln -s ${framewdir}/Versions/2.4/lib/libpython${major_version}.${minor_version}.dylib ${destroot}${prefix}/lib/libpython${major_version}.${minor_version}.dylib
-       ln -s ${framewdir}/Versions/2.4/lib/libpython${major_version}.${minor_version}.dylib ${destroot}${prefix}/lib/libpython${major_version}.dylib
-       ln -s ${framewdir}/Versions/2.4/lib/libpython${major_version}.${minor_version}.dylib ${destroot}${prefix}/lib/libpython.dylib
-    } elseif { [variant_isset darwin]} {
-       ln -s libpython${major_version}.${minor_version}.dylib ${destroot}${prefix}/lib/libpython${version}.dylib
-       ln -s libpython${major_version}.${minor_version}.dylib ${destroot}${prefix}/lib/libpython${major_version}.dylib
-       ln -s libpython${major_version}.${minor_version}.dylib ${destroot}${prefix}/lib/libpython.dylib
-    } else {
-        system "cd ${destroot}${prefix}/lib && \
-        ln -s libpython${major_version}.${minor_version}.so \
-            libpython${version}.so && \
-        ln -s libpython${major_version}.${minor_version}.so \
-            libpython${major_version}.so && \
-        ln -s libpython${major_version}.${minor_version}.so \
-            libpython.so"
-    }
-}
+        set framewpath ${prefix}/Library/Frameworks/Python.framework
+        set framewdir  ${framewpath}/Versions/${branch}
 
-# needed to trigger the variant_isset check above
-platform macosx {}
+        foreach dir { lib include } {
+            file rename ${destroot}${framewdir}/${dir}/python${branch} ${destroot}${prefix}/${dir}
+            ln -s ${destroot}${prefix}/${dir}/python${branch} ${destroot}${framewdir}/${dir}/python${branch}
+        }
 
-# delete symlinks without version suffix, use python_select instead to choose version
-platform darwin {
-    post-destroot {
-        file delete ${destroot}${prefix}/bin/python
-        file delete ${destroot}${prefix}/bin/pythonw
-        file delete ${destroot}${prefix}/bin/idle
-        file delete ${destroot}${prefix}/bin/pydoc
-        file delete ${destroot}${prefix}/bin/smtpd.py
-        file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python2.4.1
+        file rename ${destroot}${framewdir}/lib/libpython${branch}.dylib ${destroot}${prefix}/lib
+        ln -s ${destroot}${prefix}/lib/libpython${branch}.dylib ${destroot}${framewdir}/lib/libpython${branch}.dylib
+
+        file rename ${destroot}${prefix}/share/man/man1/python.1 ${destroot}${prefix}/share/man/man1/python${branch}.1
+
+        # delete symlinks without version suffix, use python_select instead to choose version
+        foreach bin { python pythonw idle pydoc smtpd.py } {
+            file delete ${destroot}${prefix}/bin/${bin}
+        }
+        foreach bin [list python${branch} pythonw${branch} idle${branch} pydoc${branch} smtpd${branch}.py] {
+            file rename -force ${destroot}${framewdir}/bin/${bin} ${destroot}${prefix}/bin
+            ln -s ${prefix}/bin/${bin} ${destroot}${framewdir}/bin/${bin}
+        }
+
+        foreach dir { Headers Resources Python Versions/Current } {
+            file delete ${destroot}${framewpath}/${dir}
+        }
 
         # install select file for python_select
         xinstall -m 755 -d ${destroot}${prefix}/etc/select/python
-        xinstall -m 644 ${filespath}/python24 ${destroot}${prefix}/etc/select/python/
-    }
+        xinstall -m 644 ${filespath}/python[string map {. {}} ${branch}] ${destroot}${prefix}/etc/select/python/
 }
 
-platform puredarwin {
-    configure.args-delete   --enable-framework=${prefix}/Library/Frameworks
-    configure.args-append   --disable-toolbox-glue --disable-framework
-    destroot.target     install maninstall
+post-activate {
+    ui_msg "\nTo fully complete your installation and make python $branch the default, please run
+\n\tsudo port install python_select \
+\n\tsudo python_select $name\n"
 }
 
 platform darwin 8 {
-    configure.args-append --with-cxx=/usr/bin/g++-4.0
+        # TODO: would configure.compiler be more appropriate?
+        configure.args-append           --with-cxx=/usr/bin/g++-4.0
 }
 
 platform darwin 9 {
-    configure.cppflags-append    -D__DARWIN_UNIX03
+        configure.cppflags-append       -D__DARWIN_UNIX03
 }
 
-platform freebsd {
-    configure.args-delete   --enable-framework=${prefix}/Library/Frameworks
-    configure.args-append   --disable-framework
-    build.target        all libpython2.4.so
-    destroot.target     install maninstall
-}
+# TODO: test if this universal variant actually works
+# variant universal {
+        # configure.args-append           --enable-universalsdk
+# }
 
-platform linux {
-    configure.args-delete   --enable-framework=${prefix}/Library/Frameworks
-    configure.args-append   --disable-framework
-    build.target        all libpython2.4.so
-    destroot.target     install maninstall
-}
-
-livecheck.check regex
-livecheck.url   http://www.python.org/download/releases/
-livecheck.regex Python (2.4.\[0-9\]+)
+livecheck.check         regex
+livecheck.url           ${homepage}download/releases/
+livecheck.regex         Python (${branch}.\[0-9\]+)
