<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -20,8 +20,35 @@ def dependenciesMet(packages):
             print(&quot;%s package is not installed.&quot; % package)
             met = False
     return met
+
+def copy_built_files(files, build_dir):
+    for f in files:
+        shutil.copy('tmp/%s/%s' % (build_dir, f), 'build/bin')
+        
+def usage():
+    print(&quot;Usage: %s component_name&quot; % sys.argv[0])
     
+def get_config(component):
+    config_file = open(&quot;%s-conf&quot; % component)
+    config = { }
+    for setting in config_file:
+        if len(setting.split('=')) &gt; 1:
+            if (len(setting.split(' '))) &gt; 1:
+                config[setting.split('=')[0]] = setting.rstrip('\n').split('=')[1].split(' ')
+            else:
+                config[setting.split('=')[0]] = setting.rstrip('\n').split('=')[1]
+    return config
+
 def main():
+    if len(sys.argv) != 2:
+        usage()
+        sys.exit(1)
+    component = sys.argv[1]
+    
+    print(&quot;building %s&quot; % component)
+
+    config = get_config(component)
+    
     create_dir('tmp')
     create_dir('build')
     create_dir('build/bin')
@@ -29,22 +56,23 @@ def main():
     os.chdir('tmp')
 
     print(&quot;checking build depedencies...&quot;)
-    if not dependenciesMet(['libevent1','libevent-dev']):
-        print(&quot;install dependencies and try again&quot;)
+    if not dependenciesMet(config['BUILDDEP']):
+        print(&quot;install dependencies using the following command and try again&quot;)
+        print(&quot;sudo apt-get install %s&quot; % &quot; &quot;.join(config['BUILDDEP']))
         sys.exit(1)
         
     print(&quot;downloading source...&quot;)
     try:
-        proc.check_call(['wget','-c', 'http://www.danga.com/memcached/dist/memcached-1.2.6.tar.gz'])
+        proc.check_call(['wget','-c', '%s/%s' % (config['SOURCEPATH'], config['SOURCETARFILE'])])
     except proc.CalledProcessError:
         sys.exit(1)
 
     print(&quot;extracting tar ball...&quot;)    
-    memcached = tarfile.open(name='memcached-1.2.6.tar.gz', mode='r:gz')
+    memcached = tarfile.open(name=config['SOURCETARFILE'], mode='r:gz')
     memcached.extractall()
     
     print(&quot;configuring...&quot;)
-    os.chdir('memcached-1.2.6')
+    os.chdir(config['BUILDDIR'])
     try:
         proc.check_call(['./configure'])
     except proc.CalledProcessError:
@@ -58,8 +86,7 @@ def main():
 
     print(&quot;copying built files...&quot;)
     os.chdir('../..')
-    shutil.copy('tmp/memcached-1.2.6/memcached', 'build/bin')
-    shutil.copy('tmp/memcached-1.2.6/memcached-debug', 'build/bin')
+    copy_built_files(config['INSTALLFILES'], config['BUILDDIR'])
     
 if __name__ == &quot;__main__&quot;:
     main()</diff>
      <filename>build.py</filename>
    </modified>
    <modified>
      <diff>@@ -2,3 +2,4 @@ BUILDDEP=libevent1 libevent-dev
 SOURCETARFILE=memcached-1.2.6.tar.gz
 SOURCEPATH=http://www.danga.com/memcached/dist
 INSTALLFILES=memcached memcached-debug
+BUILDDIR=memcached-1.2.6</diff>
      <filename>memcached-conf</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e9e53ba25aa34e16d4f4b9c159955ad2f9641085</id>
    </parent>
  </parents>
  <author>
    <name>Christian Carey</name>
    <email>ccarey@apophxf130dh1.(none)</email>
  </author>
  <url>http://github.com/CarlosGabaldon/dolomite/commit/32310dfb874c022441cd1692b1918fc411bb118c</url>
  <id>32310dfb874c022441cd1692b1918fc411bb118c</id>
  <committed-date>2009-02-25T06:46:35-08:00</committed-date>
  <authored-date>2009-02-24T14:02:45-08:00</authored-date>
  <message>convert build script to configured build

Signed-off-by: Carlos Gabaldon &lt;cgabaldon@cox.net&gt;</message>
  <tree>238bd5cfd0da9384ff22b95a9f428f2a7cfbde70</tree>
  <committer>
    <name>Carlos Gabaldon</name>
    <email>cgabaldon@cox.net</email>
  </committer>
</commit>
