Adds build functionality to the dev server. 

A few changes here. 

1. A simple webui for building packages in the source tree. 
2. A shell script that you can run on your netbook to kick of a build of a given package, download the result, and install it. 
3. Refactored update/build functionality into classes so that the build env paths can be shared. 
4. devkit.sh downloads an upsatart task that starts ssh at boot time.

More info in the dev server manual - 
https://docs.google.com/a/google.com/Doc?docid=0AT6qlIKi36JQY2M1Y3B2bWNfMTZkems5eGducg&hl=en

Review URL: http://chromereview.prom.corp.google.com/1187017

git-svn-id: svn://chrome-svn/chromeos/trunk@207 06c00378-0e64-4dae-be16-12b19f9950a1
diff --git a/devserver.py b/devserver.py
index da11242..67db0ff 100644
--- a/devserver.py
+++ b/devserver.py
@@ -8,13 +8,15 @@
 import web
 import sys
 
-
 global updater
 updater = None
 
+global buildbot
+buildbot = None
+
 class index:
   def GET(self):
-    pkgs = buildutil.GetPackages()
+    pkgs = buildbot.GetPackages()
     return render.index(pkgs)
 
 class update:
@@ -25,8 +27,26 @@
   def POST(self):
     return updater.HandleUpdatePing(web.data())
 
+class webbuild:
+  """
+    builds the package specified by the pkg parameter. Then redirects to index
+  """
   def GET(self):
-    web.debug("Value of updater is %s" % updater)
+    input = web.input()
+    web.debug("called %s " % input.pkg)
+    output = buildbot.BuildPackage(input.pkg)
+    web.debug("copied %s to static" % output)
+    raise web.seeother('/')
+
+class build:
+  """
+    builds the package specified by the pkg parameter and returns the name
+    of the output file.
+  """
+  def GET(self):
+    input = web.input()
+    web.debug("called %s " % input.pkg)
+    return buildbot.BuildPackage(input.pkg)
 
 if __name__ == "__main__":
 
@@ -37,9 +57,13 @@
   os.system("mkdir -p %s" % static_dir)
 
   updater = autoupdate.Autoupdate(root_dir=root_dir, static_dir=static_dir)
+  buildbot = buildutil.BuildUtil(root_dir=root_dir, static_dir=static_dir)
 
   urls = ('/', 'index',
-          '/update', 'update')
+          '/update', 'update',
+          '/webbuild', 'webbuild',
+          '/build', 'build')
+
   app = web.application(urls, globals())
   render = web.template.render('templates/')