diff --git a/build-essential/README.md b/build-essential/README.md new file mode 100644 index 0000000..3e72caa --- /dev/null +++ b/build-essential/README.md @@ -0,0 +1,23 @@ +DESCRIPTION +=========== + +Installs packages required for compiling C software from source. + +LICENSE AND AUTHOR +================== + +Author:: Joshua Timberman () + +Copyright 2009, Opscode, Inc. + +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. diff --git a/build-essential/metadata.json b/build-essential/metadata.json new file mode 100644 index 0000000..2a121fc --- /dev/null +++ b/build-essential/metadata.json @@ -0,0 +1,45 @@ +{ + "suggestions": { + }, + "dependencies": { + }, + "long_description": "", + "conflicting": { + }, + "providing": { + }, + "license": "Apache 2.0", + "maintainer": "Opscode, Inc.", + "version": "0.7.1", + "attributes": { + }, + "replacing": { + }, + "maintainer_email": "cookbooks@opscode.com", + "groupings": { + }, + "platforms": { + "debian": [ + + ], + "centos": [ + + ], + "fedora": [ + + ], + "ubuntu": [ + + ], + "redhat": [ + + ] + }, + "description": "Installs C compiler / build tools", + "name": "build-essential", + "recipes": { + "build-essential": "Installs C compiler and build tools on Linux" + }, + "recommendations": { + } +} \ No newline at end of file diff --git a/build-essential/metadata.rb b/build-essential/metadata.rb new file mode 100644 index 0000000..7d5056f --- /dev/null +++ b/build-essential/metadata.rb @@ -0,0 +1,10 @@ +maintainer "Opscode, Inc." +maintainer_email "cookbooks@opscode.com" +license "Apache 2.0" +description "Installs C compiler / build tools" +version "0.7.1" +recipe "build-essential", "Installs C compiler and build tools on Linux" + +%w{ fedora redhat centos ubuntu debian }.each do |os| + supports os +end diff --git a/build-essential/recipes/default.rb b/build-essential/recipes/default.rb new file mode 100644 index 0000000..b4dcce0 --- /dev/null +++ b/build-essential/recipes/default.rb @@ -0,0 +1,43 @@ +# +# Cookbook Name:: build-essential +# Recipe:: default +# +# Copyright 2008-2009, Opscode, Inc. +# +# 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. +# + +case node[:platform] +when "ubuntu","debian" + %w{build-essential binutils-doc}.each do |pkg| + package pkg do + action :install + end + end +when "centos" + package "gcc" do + action :install + end +end + +package "autoconf" do + action :install +end + +package "flex" do + action :install +end + +package "bison" do + action :install +end diff --git a/erlang/attributes/default.rb b/erlang/attributes/default.rb new file mode 100644 index 0000000..f084f8c --- /dev/null +++ b/erlang/attributes/default.rb @@ -0,0 +1 @@ +default[:erlang][:gui_tools] = false diff --git a/erlang/metadata.json b/erlang/metadata.json new file mode 100644 index 0000000..b78035d --- /dev/null +++ b/erlang/metadata.json @@ -0,0 +1,36 @@ +{ + "suggestions": { + }, + "dependencies": { + }, + "long_description": "", + "conflicting": { + }, + "providing": { + }, + "license": "Apache 2.0", + "maintainer": "Opscode, Inc.", + "version": "0.8.2", + "attributes": { + }, + "replacing": { + }, + "maintainer_email": "cookbooks@opscode.com", + "groupings": { + }, + "platforms": { + "debian": [ + + ], + "ubuntu": [ + + ] + }, + "description": "Installs erlang, optionally install GUI tools.", + "name": "erlang", + "recipes": { + "erlang": "Installs erlang" + }, + "recommendations": { + } +} \ No newline at end of file diff --git a/erlang/metadata.rb b/erlang/metadata.rb new file mode 100644 index 0000000..d093233 --- /dev/null +++ b/erlang/metadata.rb @@ -0,0 +1,11 @@ +maintainer "Opscode, Inc." +maintainer_email "cookbooks@opscode.com" +license "Apache 2.0" +description "Installs erlang, optionally install GUI tools." +version "0.8.2" + +recipe "erlang", "Installs erlang" + +%w{ ubuntu debian }.each do |os| + supports os +end diff --git a/erlang/recipes/default.rb b/erlang/recipes/default.rb new file mode 100644 index 0000000..e7d606f --- /dev/null +++ b/erlang/recipes/default.rb @@ -0,0 +1,27 @@ +# Cookbook Name:: erlang +# Recipe:: default +# Author:: Joe Williams +# +# Copyright 2008-2009, Joe Williams +# +# 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. +# + +case node[:platform] +when "debian", "ubuntu" + erlpkg = node[:erlang][:gui_tools] ? "erlang" : "erlang-nox" + package erlpkg + package "erlang-dev" +else + package "erlang" +end diff --git a/ucspi-tcp/README.md b/ucspi-tcp/README.md new file mode 100644 index 0000000..f7db0db --- /dev/null +++ b/ucspi-tcp/README.md @@ -0,0 +1,35 @@ +Description +=========== + +Installs DJB's ucspi-tcp software. + +Requirements +============ + +Should work on ArchLinux, Debian and Ubuntu. Source installation may work on Red Hat family distributions. + +Requires build-essential cookbook. + +Usage +===== + +Include the ucspi-tcp recipe in the run list. The recipe will automatically detect the platform and attempt to install based on what should be available. + +License and Author +================== + +Author: Joshua Timberman () + +Copyright 2010, Opscode, Inc. + +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. diff --git a/ucspi-tcp/attributes/default.rb b/ucspi-tcp/attributes/default.rb new file mode 100644 index 0000000..dca3514 --- /dev/null +++ b/ucspi-tcp/attributes/default.rb @@ -0,0 +1,37 @@ +# +# Cookbook Name:: ucspi-tcp +# Attribute:: default +# +# Copyright 2010, Opscode, Inc +# +# 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. +# + +case platform +when "ubuntu" + if platform_version.to_f >= 9.04 + set[:ucspi][:bin_dir] = "/usr/bin" + else + set[:ucspi][:bin_dir] = "/usr/local/bin" + end +when "debian" + if platform_version.to_f >= 5.0 + set[:ucspi][:bin_dir] = "/usr/bin" + else + set[:ucspi][:bin_dir] = "/usr/local/bin" + end +when "arch" + set[:ucspi][:bin_dir] = "/usr/bin" +else + set[:ucspi][:bin_dir] = "/usr/local/bin" +end diff --git a/ucspi-tcp/metadata.json b/ucspi-tcp/metadata.json new file mode 100644 index 0000000..c8cadc5 --- /dev/null +++ b/ucspi-tcp/metadata.json @@ -0,0 +1,48 @@ +{ + "suggestions": { + }, + "dependencies": { + "build-essential": [ + + ] + }, + "long_description": "Description\n===========\n\nInstalls DJB's ucspi-tcp software.\n\nRequirements\n============\n\nShould work on ArchLinux, Debian and Ubuntu. Source installation may work on Red Hat family distributions.\n\nRequires build-essential cookbook.\n\nUsage\n=====\n\nInclude the ucspi-tcp recipe in the run list. The recipe will automatically detect the platform and attempt to install based on what should be available.\n\nLicense and Author\n==================\n\nAuthor: Joshua Timberman ()\n\nCopyright 2010, Opscode, Inc.\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", + "conflicting": { + }, + "providing": { + }, + "license": "Apache 2.0", + "maintainer": "Opscode, Inc.", + "version": "1.0.0", + "attributes": { + }, + "replacing": { + }, + "maintainer_email": "cookbooks@opscode.com", + "groupings": { + }, + "platforms": { + "rhel": [ + + ], + "debian": [ + + ], + "centos": [ + + ], + "arch": [ + + ], + "ubuntu": [ + + ] + }, + "description": "Installs ucspi-tcp", + "name": "ucspi-tcp", + "recipes": { + "ucspi-tcp": "Installs ucspi-tcp" + }, + "recommendations": { + } +} \ No newline at end of file diff --git a/ucspi-tcp/metadata.rb b/ucspi-tcp/metadata.rb new file mode 100644 index 0000000..d62fab5 --- /dev/null +++ b/ucspi-tcp/metadata.rb @@ -0,0 +1,16 @@ +maintainer "Opscode, Inc." +maintainer_email "cookbooks@opscode.com" +license "Apache 2.0" +description "Installs ucspi-tcp" +long_description IO.read(File.join(File.dirname(__FILE__), 'README.md')) +version "1.0.0" + +recipe "ucspi-tcp", "Installs ucspi-tcp" + +%w{ build-essential }.each do |cb| + depends cb +end + +%w{ ubuntu debian centos rhel arch }.each do |os| + supports os +end diff --git a/ucspi-tcp/recipes/default.rb b/ucspi-tcp/recipes/default.rb new file mode 100644 index 0000000..a4a8481 --- /dev/null +++ b/ucspi-tcp/recipes/default.rb @@ -0,0 +1,59 @@ +# +# Cookbook Name:: ucspi-tcp +# Recipe:: default +# +# Copyright 2010, Opscode, Inc. +# +# 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" + +installation_method = value_for_platform( + "arch" => { "default" => "aur" }, + "debian" => { "4.0" => "source", "default" => "package" }, + "ubuntu" => { + "6.06" => "source", + "6.10" => "source", + "7.04" => "source", + "7.10" => "source", + "8.04" => "source", + "default" => "package" + }, + "default" => { "default" => "source" } +) + +case installation_method +when "package" + package "ucspi-tcp" do + action :install + end +when "aur" + pacman_aur "ucspi-tcp" do + action [:build,:install] + end +when "source" + bash "install_ucspi" do + user "root" + cwd "/tmp" + code <<-EOH + (cd /tmp; wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz) + (cd /tmp; tar zxvf ucspi-tcp-0.88.tar.gz) + (cd /tmp/ucspi-tcp-0.88; perl -pi -e 's/extern int errno;/\#include /' error.h) + (cd /tmp/ucspi-tcp-0.88; make setup check) + EOH + not_if { ::File.exists?("#{node[:ucspi][:bin_dir]}/tcpserver") } + end +else + Chef::Log.info("Could not find an installation method for platform #{node[:platform]}, version #{node[:platform_version]}") +end