-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
194 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
# | ||
# Author:: Marius Ducea ([email protected]) | ||
# Cookbook Name:: etckeeper | ||
# Recipe:: default | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
= DESCRIPTION: | ||
|
||
Installs Node.JS from source. | ||
|
||
= REQUIREMENTS: | ||
|
||
== Platform: | ||
|
||
Tested on Debian Lenny. Should work fine on Ubuntu, Centos, etc. | ||
|
||
== Cookbooks: | ||
|
||
Opscode cookbooks (http://github.com/opscode/cookbooks/tree/master) | ||
|
||
* build-essential | ||
|
||
= ATTRIBUTES: | ||
|
||
* nodejs[:version] - release version of node to install | ||
* nodejs[:dir] - location where node will be installed, default /usr/local | ||
* nodejs[:npm] - version of npm to install | ||
|
||
= USAGE: | ||
|
||
Include the nodejs recipe to install node from source on your system: | ||
|
||
include_recipe "nodejs" | ||
|
||
Include the npm recipe to install npm: | ||
|
||
include_recipe "nodejs::npm" | ||
|
||
= LICENSE and AUTHOR: | ||
|
||
Author:: Marius Ducea ([email protected]) | ||
|
||
Copyright:: 2010, Promet Solutions | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# | ||
# Cookbook Name:: nodejs | ||
# Attributes:: nodejs | ||
# | ||
# Copyright 2010, Promet Solutions | ||
# | ||
# 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. | ||
# | ||
|
||
default.nodejs[:version] = "0.2.0" | ||
default.nodejs[:dir] = "/usr/local" | ||
default.nodejs[:npm] = "0.1.27-12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"recipes": { | ||
"nodejs::npm": "Installs npm - a package manager for node", | ||
"nodejs": "Installs Node.JS from source" | ||
}, | ||
"replacing": { | ||
}, | ||
"attributes": { | ||
}, | ||
"maintainer_email": "[email protected]", | ||
"groupings": { | ||
}, | ||
"dependencies": { | ||
"build-essential": [ | ||
|
||
] | ||
}, | ||
"recommendations": { | ||
}, | ||
"long_description": "= DESCRIPTION:\n\nInstalls Node.JS from source.\n\n= REQUIREMENTS:\n\n== Platform:\n\nTested on Debian Lenny. Should work fine on Ubuntu, Centos, etc.\n\n== Cookbooks:\n\nOpscode cookbooks (http://github.com/opscode/cookbooks/tree/master)\n\n* build-essential\n\n= ATTRIBUTES:\n\n* nodejs[:version] - release version of node to install\n* nodejs[:dir] - location where node will be installed, default /usr/local\n* nodejs[:npm] - version of npm to install\n\n= USAGE:\n\nInclude the nodejs recipe to install node from source on your system:\n\n include_recipe \"nodejs\"\n\nInclude the npm recipe to install npm:\n \n include_recipe \"nodejs::npm\"\n\n= LICENSE and AUTHOR:\n\nAuthor:: Marius Ducea ([email protected])\n\nCopyright:: 2010, Promet Solutions\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n", | ||
"suggestions": { | ||
}, | ||
"platforms": { | ||
}, | ||
"license": "Apache 2.0", | ||
"version": "0.1.1", | ||
"conflicting": { | ||
}, | ||
"name": "nodejs", | ||
"providing": { | ||
}, | ||
"description": "Installs/Configures nodejs", | ||
"maintainer": "Promet Solutions" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
maintainer "Promet Solutions" | ||
maintainer_email "[email protected]" | ||
license "Apache 2.0" | ||
description "Installs/Configures nodejs" | ||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc')) | ||
version "0.1.1" | ||
recipe "nodejs", "Installs Node.JS from source" | ||
recipe "nodejs::npm", "Installs npm - a package manager for node" | ||
|
||
depends "build-essential" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Author:: Marius Ducea ([email protected]) | ||
# Cookbook Name:: nodejs | ||
# Recipe:: default | ||
# | ||
# Copyright 2010, Promet Solutions | ||
# | ||
# 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. | ||
# | ||
|
||
include_recipe "build-essential" | ||
|
||
case node[:platform] | ||
when "centos","redhat","fedora" | ||
package "openssl-devel" | ||
when "debian","ubuntu" | ||
package "libssl-dev" | ||
end | ||
|
||
bash "install nodejs from source" do | ||
cwd "/usr/local/src" | ||
user "root" | ||
code <<-EOH | ||
wget http://nodejs.org/dist/node-v#{node[:nodejs][:version]}.tar.gz && \ | ||
tar zxf node-v#{node[:nodejs][:version]}.tar.gz && \ | ||
cd node-v#{node[:nodejs][:version]} && \ | ||
./configure --prefix=#{node[:nodejs][:dir]} && \ | ||
make && \ | ||
make install | ||
EOH | ||
not_if {File.exists?("/usr/local/src/node-v#{node[:nodejs][:version]}/node")} | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# | ||
# Author:: Marius Ducea ([email protected]) | ||
# Cookbook Name:: nodejs | ||
# Recipe:: npm | ||
# | ||
# Copyright 2010, Promet Solutions | ||
# | ||
# 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. | ||
# | ||
|
||
include_recipe "nodejs" | ||
|
||
bash "install npm - package manager for node" do | ||
cwd "/usr/local/src" | ||
user "root" | ||
code <<-EOH | ||
mkdir -p npm-v#{node[:nodejs][:npm]} && \ | ||
cd npm-v#{node[:nodejs][:npm]} | ||
curl -L http://github.com/isaacs/npm/tarball/v#{node[:nodejs][:npm]} | tar xzf - --strip-components=1 && \ | ||
make uninstall install | ||
EOH | ||
not_if {File.exists?("/usr/local/bin/npm-#{node[:nodejs][:npm]}")} | ||
end | ||
|