--- /opt/local/var/macports/sources/rsync.macports.org/release/ports/python/py26-googleappengine/Portfile	2010-04-02 10:26:29.000000000 -0400
+++ Portfile	2010-04-14 14:40:45.000000000 -0400
@@ -6,6 +6,7 @@
 
 name                    py26-googleappengine
 version                 1.3.2
+revision                1
 categories-append       devel www
 maintainers             snc openmaintainer
 description             The Google App Engine Python SDK
@@ -23,8 +24,35 @@
                     sha1    9390f8250ef4d7acdf7ff42a7eab8f3646ade9f6 \
                     rmd160  dea73e8b0a0fe4e04a7262125cd115170d9a6310
 
+# contents of lib directory, minus cacerts
+depends_lib-append      port:py26-antlr3 \
+                        port:py26-django \
+                        port:py26-ipaddr \
+                        port:py26-webob \
+                        port:py26-yaml
+
+set python.branch       2.6
+set python.prefix       ${frameworks_dir}/Python.framework/Versions/${python.branch}
+set python.pkgd ${python.prefix}/lib/python${python.branch}/site-packages
+
 destroot {
+    # delete libs (already installed, due to dependencies)
+    file delete -force \
+        ${worksrcpath}/lib/antlr3 \
+        ${worksrcpath}/lib/django \
+        ${worksrcpath}/lib/ipaddr \
+        ${worksrcpath}/lib/webob \
+        ${worksrcpath}/lib/yaml
+    # delete tools dir (deprecated)
+    file delete -force ${worksrcpath}/tools
+    # install modified work directory into destroot
     file rename ${worksrcpath} ${destroot}${prefix}/share/${worksrcdir}
+    
+    # add this directory to the Python path, so we can import google
+    xinstall -d ${destroot}${python.pkgd}
+    set fp [open "${destroot}${python.pkgd}/googleappengine.pth" "w"]
+    puts $fp "${prefix}/share/${worksrcdir}"
+    close $fp
 }
 build {}
 
