Fix eplite node.js install problems.

Two problems installing node.js for etherpad lite on a new host:
1. Install may be attempted before repository is properly cloned.
2. Installing node from source may take longer than the default exec
timeout.

Fix this by adding more order requirements and increase the exec timeout
when running make on node.js.

Change-Id: I74c225ee725e6e67b54dbf8ba7795d28e82c66e3
Reviewed-on: https://review.openstack.org/16013
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Reviewed-by: Jeremy Stanley <fungi@yuggoth.org>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
diff --git a/manifests/init.pp b/manifests/init.pp
index df44cf5..01e856f 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -2,6 +2,7 @@
 define buildsource(
   $dir     = $title,
   $user    = 'root',
+  $timeout = 300,
   $creates = '/nonexistant/file'
 ) {
 
@@ -18,6 +19,7 @@
     path    => '/usr/bin:/bin',
     user    => $user,
     cwd     => $dir,
+    timeout => $timeout,
     creates => $creates
   } ->
 
@@ -75,7 +77,10 @@
     provider => git,
     source   => 'https://github.com/joyent/node.git',
     revision => $nodejs_version,
-    require  => Package['git']
+    require  => [
+        Package['git'],
+        File["${base_install_dir}"],
+      ],
   }
 
   package { ['gzip',
@@ -93,6 +98,7 @@
   }
 
   buildsource { "${base_install_dir}/nodejs":
+    timeout => 900, # 15 minutes
     creates => '/usr/local/bin/node',
     require => [Package['gzip'],
                 Package['curl'],