add ubuntu platform
diff --git a/src/platforms.js b/src/platforms.js
index bcd2613..795fad3 100644
--- a/src/platforms.js
+++ b/src/platforms.js
@@ -5,5 +5,6 @@
     'wp7': require('./platforms/wp7'),
     'wp8': require('./platforms/wp8'),
     'windows8' : require('./platforms/windows8'),
-    'firefoxos': require('./platforms/firefoxos')
+    'firefoxos': require('./platforms/firefoxos'),
+    'ubuntu': require('./platforms/ubuntu')
 };
diff --git a/src/platforms/ubuntu.js b/src/platforms/ubuntu.js
new file mode 100644
index 0000000..884b542
--- /dev/null
+++ b/src/platforms/ubuntu.js
@@ -0,0 +1,107 @@
+/*
+ *
+ * Copyright 2013 Canonical Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+function replaceAt(str, index, char) {
+    return str.substr(0, index) + char + str.substr(index + char.length);
+}
+
+function toCamelCase(str) {
+    return str.split('-').map(function(str) {
+        return replaceAt(str, 0, str[0].toUpperCase());
+    }).join('');
+}
+
+var fs = require('fs')
+   , path = require('path')
+   , xml_helpers = require(path.join(__dirname, '..', 'util', 'xml-helpers'));
+
+module.exports = {
+    www_dir:function(project_dir) {
+        return path.join(project_dir, 'www');
+    },
+
+    package_name:function (project_dir) {
+        var config_path = path.join(project_dir, 'config.xml');
+        var widget_doc = xml_helpers.parseElementtreeSync(config_path);
+        return widget_doc._root.attrib['id'];
+    },
+    "source-file":{
+        install:function(source_el, plugin_dir, project_dir, plugin_id) {
+            var shell = require('shelljs');
+            var dest = path.join(project_dir, "build", "src", "plugins", plugin_id);
+            shell.mkdir(dest);
+            shell.cp(path.join(plugin_dir, source_el.attrib.src), dest);
+
+            shell.exec('touch ' + path.join(project_dir, "CMakeLists.txt"))
+        },
+        uninstall:function(source_el, project_dir, plugin_id) {
+            var shell = require('shelljs');
+
+            var dest = path.join(project_dir, "build", "src", "plugins", plugin_id);
+            shell.rm(path.join(dest, path.basename(source_el.attrib.src)));
+        }
+    },
+    "header-file":{
+        install:function(source_el, plugin_dir, project_dir, plugin_id) {
+            var shell = require('shelljs');
+            var dest = path.join(project_dir, "build", "src", "plugins", plugin_id);
+            shell.mkdir(dest);
+            shell.cp(path.join(plugin_dir, source_el.attrib.src), dest);
+
+            var plugins = path.join(project_dir, "build", "src", "coreplugins.cpp");
+            src = String(fs.readFileSync(plugins));
+
+            src = src.replace('INSERT_HEADER_HERE', '#include "plugins/' + plugin_id + "/" + path.basename(source_el.attrib.src) +'"\nINSERT_HEADER_HERE');
+            var class_name = plugin_id.match(/\.[^.]+$/)[0].substr(1);
+            class_name = toCamelCase(class_name);
+            src = src.replace('INSERT_PLUGIN_HERE', 'INIT_PLUGIN(' + class_name + ');INSERT_PLUGIN_HERE');
+
+            fs.writeFileSync(plugins, src);
+        },
+        uninstall:function(source_el, project_dir, plugin_id) {
+            var shell = require('shelljs');
+            var dest = path.join(project_dir, "build", "src", "plugins", plugin_id);
+            shell.rm(path.join(dest, path.basename(source_el.attrib.src)));
+
+            var plugins = path.join(project_dir, "build", "src", "coreplugins.cpp");
+            src = String(fs.readFileSync(plugins));
+
+            src = src.replace('#include "plugins/' + plugin_id + "/" + path.basename(source_el.attrib.src) +'"', '');
+            var class_name = plugin_id.match(/\.[^.]+$/)[0].substr(1);
+            class_name = toCamelCase(class_name);
+            src = src.replace('INIT_PLUGIN(' + class_name + ');', '');
+
+            fs.writeFileSync(plugins, src);
+        }
+    },
+    "resource-file":{
+        install:function(source_el, plugin_dir, project_dir, plugin_id) {
+            var shell = require('shelljs');
+            var dest = path.join(project_dir, "qml");
+            shell.mkdir(dest);
+            shell.cp(path.join(plugin_dir, source_el.attrib.src), dest);
+        },
+        uninstall:function(source_el, project_dir, plugin_id) {
+            var shell = require('shelljs');
+
+            var dest = path.join(project_dir, "qml");
+            shell.rm(path.join(dest, path.basename(source_el.attrib.src)));
+        }
+    }
+};
diff --git a/src/util/config-changes.js b/src/util/config-changes.js
index c9f625b..5fa9983 100644
--- a/src/util/config-changes.js
+++ b/src/util/config-changes.js
@@ -460,7 +460,9 @@
     } else {
         // special-case config.xml target that is just "config.xml". this should be resolved to the real location of the file.
         if (file == 'config.xml') {
-            if (platform == 'android') {
+            if (platform == 'ubuntu') {
+                filepath = path.join(project_dir, 'config.xml');
+            } else if (platform == 'android') {
                 filepath = path.join(project_dir, 'res', 'xml', 'config.xml');
             } else {
                 var matches = glob.sync(path.join(project_dir, '**', 'config.xml'));