Go back to using self compiled node.js.

The version of node.js packaged by ubuntu does not seem to play nice
with require-kernel and etherpad-lite. Go back to compiling version
0.6.16 of node.js which is tested and appears to be working.

Change-Id: Ib9bda5d7acbda06561398a0c715b28e46edb531d
This commit is contained in:
Clark Boylan 2012-06-21 17:52:43 +00:00
parent 6511e79399
commit 2437144192
2 changed files with 61 additions and 14 deletions

View File

@ -44,6 +44,39 @@ define git_repo (
}
# define to build from source using ./configure && make && make install.
define buildsource(
$dir = $title,
$user = 'root',
$creates = '/nonexistant/file'
) {
exec { "./configure in ${dir}":
command => './configure',
path => "/usr/bin:/bin:/usr/local/bin:${dir}",
user => $user,
cwd => $dir,
creates => $creates
} ->
exec { "make in ${dir}":
command => 'make',
path => '/usr/bin:/bin',
user => $user,
cwd => $dir,
creates => $creates
} ->
exec { "make install in ${dir}":
command => 'make install',
path => '/usr/bin:/bin',
user => $user,
cwd => $dir,
creates => $creates
}
}
# Class to install etherpad lite. Puppet acts a lot like a package manager
# through this class.
#
@ -86,18 +119,39 @@ class etherpad_lite (
mode => 0664,
}
git_repo { 'nodejs_repo':
repo => 'https://github.com/joyent/node.git',
dest => "${base_install_dir}/nodejs",
branch => 'v0.6.16-release',
clone_only => 'true',
require => Package['git']
}
package { ['gzip',
'curl',
'python',
'libssl-dev',
'pkg-config',
'abiword',
'build-essential',
'nodejs',
'npm',]:
'build-essential']:
ensure => present
}
package { ['nodejs', 'npm']:
ensure => purged
}
buildsource { "${base_install_dir}/nodejs":
creates => '/usr/local/bin/node',
require => [Package['gzip'],
Package['curl'],
Package['python'],
Package['libssl-dev'],
Package['pkg-config'],
Package['build-essential'],
Git_repo['nodejs_repo']]
}
git_repo { 'etherpad_repo':
repo => 'https://github.com/Pita/etherpad-lite.git',
dest => "${base_install_dir}/etherpad-lite",
@ -113,16 +167,9 @@ class etherpad_lite (
cwd => "${base_install_dir}/etherpad-lite",
environment => "HOME=${base_log_dir}/${ep_user}",
require => [Git_repo['etherpad_repo'],
Package['gzip'],
Package['curl'],
Package['python'],
Package['libssl-dev'],
Package['pkg-config'],
Package['build-essential'],
Package['nodejs'],
Package['npm']
],
before => File["${base_install_dir}/etherpad-lite/settings.json"]
Buildsource["${base_install_dir}/nodejs"]],
before => File["${base_install_dir}/etherpad-lite/settings.json"],
creates => "${base_install_dir}/etherpad-lite/node_modules"
}
file { '/etc/init/etherpad-lite.conf':

View File

@ -20,7 +20,7 @@ end script
script
cd $EPHOME
exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- node node_modules/ep_etherpad-lite/node/server.js \
exec su -s /bin/sh -c 'exec "$0" "$@"' $EPUSER -- /usr/local/bin/node node_modules/ep_etherpad-lite/node/server.js \
>> $EPLOGS/access.log \
2>> $EPLOGS/error.log
end script