--- Portfile.orig	2013-06-25 11:25:40.000000000 -0700
+++ Portfile	2013-06-25 11:23:43.000000000 -0700
@@ -27,7 +27,8 @@
 master_sites        http://archive.ipython.org/release/${version}
 distname            ${realname}-${version}
 
-checksums           rmd160  afdd4e7fed6b3d23d5577b66671c9b868ef1f847 \
+checksums           ${distname}${extract.suffix} \
+                    rmd160  afdd4e7fed6b3d23d5577b66671c9b868ef1f847 \
                     sha256  17fbeea1dff2318d617d90fdf7af4eb35dc48c61389a2dffaab8ff100fb100ea
 
 python.versions     24 25 26 27 31 32 33
@@ -37,7 +38,8 @@
     revision            4
     master_sites        http://archive.ipython.org/release/${version}
     distname            ${realname}-${version}
-    checksums           md5     8a1bd1a9be272f4ddf4de99e5c1ad0dc \
+    checksums           ${distname}${extract.suffix} \
+                        md5     8a1bd1a9be272f4ddf4de99e5c1ad0dc \
                         sha1    2d069416b31ed03eb1cad36f84ef2337362ac6a9 \
                         rmd160  3d522f80290caa72e1c4fc60b2d56369c8c66eba
 }
@@ -47,7 +49,8 @@
     revision            2
     master_sites        http://archive.ipython.org/release/${version}
     distname            ${realname}-${version}
-    checksums           md5     dda59bfc6e256ce786c4bc4aadb220a4 \
+    checksums           ${distname}${extract.suffix} \
+                        md5     dda59bfc6e256ce786c4bc4aadb220a4 \
                         sha1    d45b97b0f458fd517cb2bfa9ebb3c671c46a21c0 \
                         rmd160  365a4eb9b534df1a9aa8717f173e9a032224ea01
 }
@@ -77,6 +80,13 @@
     variant notebook requires parallel description "Support for IPython HTML notebook" {
         depends_lib-append      port:py${python.version}-tornado
     }
+    variant mathjax requires notebook description "Install offline copy of MathJax 2.2" {
+        distfiles-append        v2.2:mathjax
+        master_sites-append     https://github.com/mathjax/MathJax/tarball:mathjax
+        checksums-append        v2.2 \
+                                rmd160  6cbbfc96b41191580ea49f99f5f7e47b6346d6da \
+                                sha256  3c01dc8c3fd6869311d45c15c348f7ad682aefa3ae03ccf201f9cad83e26ceb1
+    }
 }
 
 if {$subport != $name} {
@@ -113,6 +123,9 @@
             #    ln -s ${python.prefix}/share/man/man1/${f}.1.gz ${destroot}${prefix}/share/man/man1/${f}3-${python.branch}.1.gz
             # }
         }
+        if {[variant_isset mathjax]} {
+            move ${workpath}/mathjax-MathJax-54280bb ${destroot}${python.pkgd}/IPython/frontend/html/notebook/static/mathjax
+        }
     }
 
     if {${python.version} >= 30} {
