diff --git a/attributes/default.rb b/attributes/default.rb index ba97ee6..5e3fd06 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -18,10 +18,8 @@ # case node['platform_family'] -when 'smartos', 'rhel', 'debian', 'fedora' +when 'smartos', 'rhel', 'debian', 'fedora', 'mac_os_x' default['nodejs']['install_method'] = 'package' -when 'mac_os_x' - default['nodejs']['install_method'] = 'mac_pkg' else default['nodejs']['install_method'] = 'source' end @@ -30,7 +28,7 @@ default['nodejs']['version'] = '0.10.26' default['nodejs']['prefix_url'] = ::URI.join('http://nodejs.org/dist', "v#{node['nodejs']['version']}").to_s -default['nodejs']['install_repo'] = true +default['nodejs']['install_repo'] = true # Only if available, ie rhel / debian default['nodejs']['source']['url'] = nil # Auto generated default['nodejs']['source']['checksum'] = 'ef5e4ea6f2689ed7f781355012b942a2347e0299da0804a58de8e6281c4b1daa' diff --git a/attributes/packages.rb b/attributes/packages.rb index 565b7a3..b75af5a 100644 --- a/attributes/packages.rb +++ b/attributes/packages.rb @@ -1,12 +1,13 @@ case node['platform_family'] when 'debian' default['nodejs']['repo'] = 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu' - default['nodejs']['packages'] = node['nodejs']['install_repo'] ? %w(nodejs) : %w(nodejs npm nodejs-dev) + default['nodejs']['packages'] = node['nodejs']['install_repo'] ? 'nodejs' : %w(nodejs npm nodejs-dev) when 'rhel', 'fedora' default['nodejs']['packages'] = %w(nodejs nodejs-devel npm) when 'smartos' - default['nodejs']['packages'] = %w(nodejs) + default['nodejs']['packages'] = 'nodejs' +when 'mac_os_x' + default['nodejs']['packages'] = 'node' else - Chef::Log.error 'There are no nodejs packages for this platform; please use the source or binary method to install node' - return + Chef::Log.info 'There are no nodejs packages for this platform; please use the source or binary method to install node' end diff --git a/metadata.rb b/metadata.rb index 926b7cc..7ce4c4a 100644 --- a/metadata.rb +++ b/metadata.rb @@ -18,6 +18,7 @@ depends 'yum-epel' depends 'build-essential' depends 'ark' depends 'apt' +depends 'homebrew', '~> 1.5.5' %w(debian ubuntu centos redhat smartos mac_os_x).each do |os| supports os