Skip to content

Commit b939930

Browse files
committed
Merge pull request mdxp#31 from mdxp/legacy_packages
Legacy packages for 0.8.x support (0.10.x default for packages). Remove rpm support. Closes #30 and #19
2 parents 452edb6 + ac4ebdd commit b939930

File tree

4 files changed

+25
-26
lines changed

4 files changed

+25
-26
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## v1.1.0:
2+
* rewrite the package install; remove rpm support since there are no longer any packages available anywhere
3+
* add support to install `legacy_packages` from ubuntu repo as well as the latest 0.10.x branch (this is default).
4+
15
## v1.0.4:
26
* add support for binary installation method ([@JulesAU][])
37

attributes/default.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@
2525
default['nodejs']['dir'] = '/usr/local'
2626
default['nodejs']['npm'] = '1.2.0'
2727
default['nodejs']['src_url'] = "http://nodejs.org/dist"
28+
29+
# Set this to true to install the legacy packages (0.8.x) from ubuntu/debian repositories; default is false (using the latest stable 0.10.x)
30+
default['nodejs']['legacy_packages'] = false

metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
license "Apache 2.0"
44
description "Installs/Configures nodejs"
55
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
6-
version "1.0.4"
6+
version "1.1.0"
77
name "nodejs"
88
provides "nodejs"
99

recipes/install_from_package.rb

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#
22
# Author:: Nathan L Smith ([email protected])
3+
# Author:: Marius Ducea ([email protected])
34
# Cookbook Name:: nodejs
45
# Recipe:: package
56
#
67
# Copyright 2012, Cramer Development, Inc.
8+
# Copyright 2013, Opscale
79
#
810
# Licensed under the Apache License, Version 2.0 (the "License");
911
# you may not use this file except in compliance with the License.
@@ -19,39 +21,29 @@
1921
#
2022

2123
case node['platform_family']
22-
when 'rhel', 'fedora'
23-
file = '/usr/local/src/nodejs-stable-release.noarch.rpm'
24-
25-
remote_file file do
26-
source 'http://nodejs.tchol.org/repocfg/el/nodejs-stable-release.noarch.rpm'
27-
action :create_if_missing
28-
end
29-
30-
yum_package 'nodejs-stable-release' do
31-
source file
32-
options '--nogpgcheck'
33-
end
34-
35-
%w{ nodejs nodejs-compat-symlinks npm }.each do |pkg|
36-
package pkg
37-
end
3824
when 'debian'
25+
if node['nodejs']['legacy_packages'] == true
26+
repo = 'http://ppa.launchpad.net/chris-lea/node.js-legacy/ubuntu'
27+
packages = %w{ nodejs npm }
28+
else
29+
repo = 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu'
30+
packages = %w{ nodejs }
31+
end
3932
apt_repository 'node.js' do
40-
uri 'http://ppa.launchpad.net/chris-lea/node.js/ubuntu'
33+
uri repo
4134
distribution node['lsb']['codename']
4235
components ['main']
4336
keyserver "keyserver.ubuntu.com"
4437
key "C7917B12"
4538
action :add
4639
end
47-
48-
%w{ nodejs npm }.each do |pkg|
49-
package pkg
50-
end
5140
when 'smartos'
52-
%w{ nodejs }.each do |pkg|
53-
package pkg
54-
end
41+
packages = %w{ nodejs }
5542
else
56-
include_recipe "nodejs::install_from_source"
43+
Chef::Log.error "There are no nodejs packages for this platform; please use the source or binary method to install node"
44+
return
45+
end
46+
47+
packages.each do |node_pkg|
48+
package node_pkg
5749
end

0 commit comments

Comments
 (0)