Skip to content
Browse files

add ark, java, elasticsearch

  • Loading branch information...
1 parent c26b08d commit 19a17aafd09c21c0a91dcfce9e16b2217aaf66a4 Nguyễn Tuấn Anh committed Nov 7, 2012
View
3 .gitmodules
@@ -0,0 +1,3 @@
+[submodule "elasticsearch"]
+ path = elasticsearch
+ url = https://github.com/karmi/cookbook-elasticsearch
View
3 ark/.gitignore
@@ -0,0 +1,3 @@
+*~
+.vagrant
+tmp
View
6 ark/.travis.yml
@@ -0,0 +1,6 @@
+language: ruby
+gemfile:
+ - test/support/Gemfile
+rvm:
+ - 1.9.3
+script: BUNDLE_GEMFILE=test/support/Gemfile bundle exec rake foodcritic
View
15 ark/CHANGELOG.md
@@ -0,0 +1,15 @@
+0.0.10 (May 23, 2012)
+---------------------
+
+New features
+* use autogen.sh to generate configure script for configure action
+ https://github.com/bryanwb/chef-ark/issues/16
+* support more file extensions https://github.com/bryanwb/chef-ark/pull/18
+* add extension attribute which allows you to download files which do
+ not have the file extension as part of the URL
+
+Bug fixes
+* strip_leading_dir not working for zip files
+ https://github.com/bryanwb/chef-ark/issues/19
+
+
View
3 ark/Gemfile
@@ -0,0 +1,3 @@
+source :rubygems
+
+gem 'test-kitchen', :git => 'git@github.com:opscode/test-kitchen.git'
View
129 ark/Gemfile.lock
@@ -0,0 +1,129 @@
+GIT
+ remote: git@github.com:opscode/test-kitchen.git
+ revision: 89dbbe974f03379dcd0db99d59784bcf3d771345
+ specs:
+ test-kitchen (0.5.0)
+ foodcritic (~> 1.2.0)
+ hashr (~> 0.0.20)
+ highline (>= 1.6.9)
+ librarian (~> 0.0.20)
+ mixlib-cli (~> 1.2.2)
+ vagrant (~> 1.0.2)
+ yajl-ruby (~> 1.1.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ archive-tar-minitar (0.5.2)
+ bunny (0.8.0)
+ chef (10.12.0)
+ bunny (>= 0.6.0)
+ erubis
+ highline (>= 1.6.9)
+ json (>= 1.4.4, <= 1.6.1)
+ mixlib-authentication (>= 1.1.0)
+ mixlib-cli (>= 1.1.0)
+ mixlib-config (>= 1.1.2)
+ mixlib-log (>= 1.3.0)
+ mixlib-shellout
+ moneta
+ net-ssh (~> 2.2.2)
+ net-ssh-multi (~> 1.1.0)
+ ohai (>= 0.6.0)
+ rest-client (>= 1.0.4, < 1.7.0)
+ treetop (~> 1.4.9)
+ uuidtools
+ yajl-ruby (~> 1.1)
+ childprocess (0.3.5)
+ ffi (~> 1.0, >= 1.0.6)
+ coderay (0.9.8)
+ erubis (2.7.0)
+ ffi (1.1.5)
+ foodcritic (1.2.0)
+ gherkin (~> 2.8.0)
+ gist (~> 2.0.4)
+ nokogiri (~> 1.5.0, != 1.5.2, != 1.5.1)
+ pry (~> 0.9.7.4)
+ pry-doc (~> 0.3.0)
+ rak (~> 1.4)
+ treetop (~> 1.4.10)
+ yajl-ruby (~> 1.1.0)
+ gherkin (2.8.0)
+ json (>= 1.4.6)
+ gist (2.0.4)
+ hashr (0.0.21)
+ highline (1.6.13)
+ i18n (0.6.0)
+ ipaddress (0.8.0)
+ json (1.5.4)
+ librarian (0.0.24)
+ archive-tar-minitar (>= 0.5.2)
+ chef (>= 0.10)
+ highline
+ thor (~> 0.15)
+ log4r (1.1.10)
+ method_source (0.6.7)
+ ruby_parser (>= 2.3.1)
+ mime-types (1.19)
+ mixlib-authentication (1.3.0)
+ mixlib-log
+ mixlib-cli (1.2.2)
+ mixlib-config (1.1.2)
+ mixlib-log (1.4.1)
+ mixlib-shellout (1.1.0)
+ moneta (0.6.0)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-ssh (2.2.2)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
+ net-ssh-multi (1.1)
+ net-ssh (>= 2.1.4)
+ net-ssh-gateway (>= 0.99.0)
+ nokogiri (1.5.5)
+ ohai (6.14.0)
+ ipaddress
+ mixlib-cli
+ mixlib-config
+ mixlib-log
+ systemu
+ yajl-ruby
+ polyglot (0.3.3)
+ pry (0.9.7.4)
+ coderay (~> 0.9.8)
+ method_source (~> 0.6.7)
+ ruby_parser (>= 2.3.1)
+ slop (~> 2.1.0)
+ pry-doc (0.3.0)
+ pry (>= 0.9.0)
+ yard (>= 0.6.4)
+ rak (1.4)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ ruby_parser (2.3.1)
+ sexp_processor (~> 3.0)
+ sexp_processor (3.2.0)
+ slop (2.1.0)
+ systemu (2.5.2)
+ thor (0.16.0)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ uuidtools (2.1.3)
+ vagrant (1.0.3)
+ archive-tar-minitar (= 0.5.2)
+ childprocess (~> 0.3.1)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6.0)
+ json (~> 1.5.1)
+ log4r (~> 1.1.9)
+ net-scp (~> 1.0.4)
+ net-ssh (~> 2.2.2)
+ yajl-ruby (1.1.0)
+ yard (0.8.2.1)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ test-kitchen!
View
260 ark/README.md
@@ -0,0 +1,260 @@
+# <a name="title"></a> chef-ark [![Build Status](https://secure.travis-ci.org/bryanwb/chef-ark.png?branch=master)](http://travis-ci.org/bryanwb/chef-ark)
+
+Overview
+========
+
+An ''ark'' is like an archive but ''Kewler''
+
+Does the fetch-unpack-configure-build-install dance. This is a
+modified verion of Infochimps awesome install_from cookbook
+ [http://github.com/infochimps-cookbooks/install_from]. It has been
+ heavily refactored and extended to meet different use cases.
+
+Given a project `pig`, with url `http://apache.org/pig/pig-0.8.0.tar.gz`, and
+the default :path of `/usr/local`, this provider will
+
+* fetch it to to `/var/cache/chef/`
+* unpack it to :path (`/usr/local/pig-0.8.0`)
+* create a symlink for :home_dir (`/usr/local/pig`) pointing to :path
+* add specified binary commands to the enviroment PATH variable
+
+By default, the ark will not run again if the :path is not
+empty. Ark provides many actions to accommodate different use cases,
+such as :dump, :cherry_pick, :put, and :install_with_make.
+
+At this time ark only handles files available from URLs. It does not
+handle local files.
+
+
+Attributes
+==========
+
+You can customize the basic attributes to meet your organization's conventions
+
+* default[:ark][:apache_mirror] = 'http://apache.mirrors.tds.net'
+
+
+Resources/Providers
+===================
+
+* ark - does the extract/build/configure dance
+
+Actions
+=======
+
+- :install: extracts the file and creates a 'friendly' symbolic link
+ to the extracted directory path
+- :configure: configure ahead of the install action
+- :install_with_make: extracts the archive to a path, runs make, and
+ make install. It does _not_ run the configure step at this time
+- :dump: strips all directories from the archive and dumps the
+ contained files into a specified path
+- :cherry_pick: extract a specified file from an archive and places
+ in specified path
+- :put: extract the archive to a specified path, does not create any
+ symbolic links
+- :remove: removes the extracted directory and related symlink #TODO
+- :setup_py_build: runs the command "python setup.py build" in the
+ extracted directory
+- :setup_py_install: runs the comand "python setup.py install" in the
+ extracted directory
+
+# :put
+
+## Relevant Attribute Parameters
+
+- path: path to extract to, defaults to '/usr/local'
+- has_binaries: array of binary commands to symlink to
+ /usr/local/bin/, you must specify the relative path example: [ 'bin/java', 'bin/javaws' ]
+- append_env_path: boolean, if true, append the ./bin directory of the
+ extracted directory to the global PATH variable for all users
+
+# :dump
+
+
+NOTE: This currently only works for zip archives
+
+## Relevant Attribute Parameters
+
+- path: path to dump files to
+- mode: file mode for app_home, is an integer
+- creates: if you are appending files to a given directory, ark
+ needs a condition to test whether the file has already been
+ extracted. You can specify with creates, a file whose existence
+ indicates the ark has previously been extracted and does not need to
+ be extracted again
+
+# :cherry_pick
+
+
+## Relevant Attribute Parameters
+
+- path: directory to place file in
+- creates: specific file to cherry-pick
+
+
+ark
+===
+
+# Attribute Parameters
+
+- name: name of the package, defaults to the resource name
+- url: url for tarball, .tar.gz, .bin (oracle-specific), .war, and .zip
+ currently supported. Also supports special syntax
+ :name:version:apache_mirror: that will auto-magically construct
+ download url from the apache mirrors site
+- version: software version, defaults to "1" if not specified. The :dump, :cherry_pick, and :put actions do not use it
+- extension: The file extension of the file you are trying to
+ download. If not specified, ark tries to determine the file
+ extension by parsing the URL
+- checksum: sha256 checksum, used for security
+- mode: file mode for app_home, is an integer TODO
+- prefix_root: default prefix_root, for use with :install* actions
+- prefix_home: default directory prefix for a friendly symlink to the path, for
+ example /usr/local/maven -> /usr/local/maven-2.2.1
+- prefix_bin: default directory to place a symlink to a binary
+ command, example /opt/bin/mvn ->
+ /opt/maven-2.2.1/bin/mvn , where the prefix_bin is "/opt/bin"
+- path: path to extract the ark to, by default is
+ /usr/local/<name>-<version> for the :install, :install_with_make actions
+ the :install* actions overwrite any user-provided values for :path
+- home_dir: symbolic link to the path :prefix_root/:name-:version,
+ defaults to :prefix_root/:name , , does not apply to :dump, :put, or
+ :cherry_pick actions
+- has_binaries: array of binary commands to symlink to
+ /usr/local/bin/, you must specify the relative path example: [ 'bin/java', 'bin/javaws' ]
+- append_env_path: boolean, similar to has_binaries but less granular
+ - If true, append the ./bin directory of the extracted directory to
+ the PATH environment variable for all users, does this by placing a file in /etc/profile.d/ which will be read by all users
+ be added to the path. The commands are symbolically linked to
+ /usr/bin/* . Examples are mvn, java, javac, etc. This option
+ provides more granularity than the boolean option
+- environment: hash of environment variables to pass to invoked shell
+ commands like tar, unzip, configure, and make
+- strip_leading_dir: by default, ark strips the leading directory from
+ an archive, which is the default for both unzip and tar commands
+- autoconf_opts: an array of command line options for use with the GNU
+ autoconf script
+- make_opts: an array of command line options for use with make
+- owner: owner of extracted directory, set to "root" by default
+
+# Examples
+
+ # install Apache Ivy dependency resolution tool
+ ark "ivy" do
+ url 'http://someurl.example.com/ivy.tar.gz'
+ version '2.2.0'
+ checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'
+ action :install
+ end
+
+This example copies ivy.tar.gz to /var/cache/chef/ivy-2.2.0.tar.gz,
+unpacks its contents to /usr/local/ivy-2.2.0/ -- stripping the
+leading directory, and symlinks /usr/local/ivy to /usr/local/ivy-2.2.0
+
+
+ ark 'jdk' do
+ url 'http://download.example.com/jdk-7u2-linux-x64.tar.gz'
+ version '7.2'
+ path "/usr/local/jvm/"
+ home_dir "/usr/local/jvm/default"
+ checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'
+ append_env_path true
+ owner 'foobar'
+ end
+
+This example copies jdk-7u2-linux-x64.tar.gz to /var/cache/chef/jdk-7.2.tar.gz,
+unpacks its contents to /usr/local/jvm/jdk-7.2/ -- stripping the
+leading directory, symlinks /usr/local/jvm/default to
+/usr/local/jvm/jdk-7.2, and adds /usr/local/jvm/jdk-7.2/bin/ to
+the global PATH for all users. The user 'foobar' is the owner of the
+/usr/local/jvm/jdk-7.2 directory
+
+ # install Apache Ivy dependency resolution tool
+ # in <path>/resource_name in this case
+ # /usr/local/ivy, no symlink created
+ # it strips any leading directory if one exists in the tarball
+ ark "ivy" do
+ url 'http://someurl.example.com/ivy.tar.gz'
+ checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'
+ action :put
+ end
+
+ # install Apache Ivy dependency resolution tool
+ # in /home/foobar/ivy
+ # it does strip any leading directory if one exists
+ ark "ivy" do
+ path "/home/foobar
+ url 'http://someurl.example.com/ivy.tar.gz'
+ checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'
+ action :put
+ end
+
+
+
+ # strip all directories and dump files into path specified by
+ # the path attribute, you must specify the `creates` attribute
+ # in order to keep the extraction from running every time
+ # the directory path will be created if it doesn't already exist
+ ark "my_jars" do
+ url "http://example.com/bunch_of_jars.zip"
+ path "/usr/local/tomcat/lib"
+ creates "mysql.jar"
+ owner "tomcat"
+ action :dump
+ end
+
+ # extract specific files from a tarball, currently only handles
+ # one named file
+ ark 'mysql-connector-java' do
+ url 'http://oracle.com/mysql-connector.zip'
+ creates 'mysql-connector-java-5.0.8-bin.jar'
+ path '/usr/local/tomcat/lib'
+ action :cherry_pick
+ end
+
+
+ # build and install haproxy and use alternave values for
+ # prefix_root, prefix_home, and prefix_bin
+ ark "haproxy" do
+ url "http://haproxy.1wt.eu/download/1.5/src/snapshot/haproxy-ss-20120403.tar.gz"
+ version "1.5"
+ checksum 'ba0424bf7d23b3a607ee24bbb855bb0ea347d7ffde0bec0cb12a89623cbaf911'
+ make_opts [ 'TARGET=linux26' ]
+ prefix_root '/opt'
+ prefix_home '/opt'
+ prefix_bin '/opt/bin'
+ action :install_with_make
+ end
+
+ # you can also pass multiple actions to ark and supply the file extension
+ # in case the file extension can not be determined by the URL
+ ark "test_autogen" do
+ url 'https://github.com/zeromq/libzmq/tarball/master'
+ extension "tar.gz"
+ action [ :configure, :build_with_make ]
+ end
+
+
+
+## License and Author
+
+Author:: Philip (flip) Kromer - Infochimps, Inc(<coders@infochimps.com>)
+Author:: Bryan W. Berry (<bryan.berry@gmail.com>)
+Author:: Denis Barishev (<denis.barishev@gmail.com>)
+Copyright:: 2011, Philip (flip) Kromer - Infochimps, Inc
+Copyright:: 2012, Bryan W. Berry
+Copyright:: 2012, Denis Barishev
+
+
+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.
View
29 ark/Rakefile
@@ -0,0 +1,29 @@
+#!/usr/bin/env rake
+
+@cookbook = "ark"
+
+desc "Runs foodcritc linter"
+task :foodcritic do
+ if Gem::Version.new("1.9.2") <= Gem::Version.new(RUBY_VERSION.dup)
+ sandbox = File.join(File.dirname(__FILE__), %w{tmp foodcritic}, @cookbook)
+ prepare_foodcritic_sandbox(sandbox)
+
+ sh "foodcritic --epic-fail any #{File.dirname(sandbox)}"
+ else
+ puts "WARN: foodcritic run is skipped as Ruby #{RUBY_VERSION} is < 1.9.2."
+ end
+end
+
+task :default => 'foodcritic'
+
+private
+
+def prepare_foodcritic_sandbox(sandbox)
+ files = %w{*.md *.rb attributes definitions files providers
+ recipes resources templates}
+
+ rm_rf sandbox
+ mkdir_p sandbox
+ cp_r Dir.glob("{#{files.join(',')}}"), sandbox
+ puts "\n\n"
+end
View
15 ark/Toftfile
@@ -0,0 +1,15 @@
+require 'rubygems'
+require 'toft'
+
+include Toft
+
+n1 = create_node "n1", {:ip => '192.168.20.2'}
+
+n1.start
+
+n1.run_chef [ "recipe[chef_handler]", "recipe[minitest-handler::recipes]", "recipe[ark::test]" ]
+
+n1.stop
+
+n1.destroy
+
View
52 ark/Vagrantfile
@@ -0,0 +1,52 @@
+distros = {
+ :lucid32 => {
+ :url => 'https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-ubuntu-10.04-i386.box',
+ :recipe => "openjdk",
+ :run_list => [ "apt" ]
+ },
+ :centos6_3_32 => {
+ :url => 'https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-centos-6.3-i386.box',
+ :recipe => "openjdk"
+ },
+ :debian_squeeze_32 => {
+ :url => 'http://mathie-vagrant-boxes.s3.amazonaws.com/debian_squeeze_32.box',
+ :recipe => "openjdk",
+ :run_list => [ "apt" ]
+ },
+ :precise32 => {
+ :url => 'https://opscode-vm.s3.amazonaws.com/vagrant/boxes/opscode-ubuntu-12.04-i386.box',
+ :recipe => "openjdk",
+ :run_list => [ "apt" ]
+ }
+}
+
+Vagrant::Config.run do |config|
+
+ distros.each_pair do |name,options|
+ config.vm.define name do |dist_config|
+ dist_config.vm.box = name.to_s
+ dist_config.vm.box_url = options[:url]
+
+ dist_config.vm.customize do |vm|
+ vm.name = name.to_s
+ vm.memory_size = 1024
+ end
+
+ dist_config.vm.provision :chef_solo do |chef|
+
+ chef.cookbooks_path = [ '/tmp/ark-cookbooks' ]
+ chef.provisioning_path = '/etc/vagrant-chef'
+ chef.log_level = :debug
+ chef.add_recipe "minitest-handler"
+ chef.add_recipe "ark"
+ chef.add_recipe "ark::test"
+
+ if options[:run_list]
+ options[:run_list].each {|recipe| chef.run_list.insert(0, recipe) }
+ end
+
+ end
+ end
+ end
+end
+
View
5 ark/attributes/default.rb
@@ -0,0 +1,5 @@
+
+default['ark']['apache_mirror'] = 'http://apache.mirrors.tds.net'
+default['ark']['prefix_root'] = "/usr/local"
+default['ark']['prefix_bin'] = "/usr/local/bin"
+default['ark']['prefix_home'] = "/usr/local"
View
BIN ark/files/default/foo.tar.gz
Binary file not shown.
View
BIN ark/files/default/foo.tbz
Binary file not shown.
View
BIN ark/files/default/foo.tgz
Binary file not shown.
View
BIN ark/files/default/foo.zip
Binary file not shown.
View
90 ark/files/default/tests/minitest/default_test.rb
@@ -0,0 +1,90 @@
+require 'minitest/spec'
+
+describe_recipe 'ark::test' do
+
+ # It's often convenient to load these includes in a separate
+ # helper along with
+ # your own helper methods, but here we just include them directly:
+ include MiniTest::Chef::Assertions
+ include MiniTest::Chef::Context
+ include MiniTest::Chef::Resources
+
+ it "installed the unzip package" do
+ package("unzip").must_be_installed
+ end
+
+ if RUBY_PLATFORM =~ /freebsd/
+ it "installs the gnu tar package on freebsc" do
+ package("gtar").must_be_installed
+ end
+ end
+
+ it "puts an ark in the desired directory w/out symlinks" do
+ directory("/usr/local/test_put").must_exist
+ end
+
+ it "dumps the correct files into place with correct owner and group" do
+ file("/usr/local/foo_dump/foo1.txt").must_have(:owner, "foobarbaz").and(:group, "foobarbaz")
+ end
+
+ it "cherrypicks the mysql connector and set the correct owner and group" do
+ file("/usr/local/foo_cherry_pick/foo1.txt").must_have(:owner, "foobarbaz").and(:group, "foobarbaz")
+ end
+
+ it "creates directory and symlink properly for the full ark install" do
+ directory("/usr/local/foo-2").must_have(:owner, "foobarbaz").and(:group, "foobarbaz")
+ link("/usr/local/foo").must_exist.with(:link_type, :symbolic).and(:to, "/usr/local/foo-2")
+ end
+
+ it "symlinks multiple binary commands" do
+ link("/usr/local/bin/do_foo").must_exist.with(:link_type, :symbolic).and(:to, "/usr/local/foo-2/bin/do_foo")
+ link("/usr/local/bin/do_more_foo").must_exist.with(:link_type, :symbolic).and(:to, "/usr/local/foo-2/bin/do_more_foo")
+ end
+
+ it "appends to the environment PATH" do
+ unless RUBY_PLATFORM =~ /freebsd/
+ file("/etc/profile.d/foo_append_env.sh").must_include '/usr/local/foo_append_env-7.0.26/bin'
+
+ bin_path_present = !ENV['PATH'].scan( '/usr/local/foo_append_env-7.0.26/bin').empty?
+ assert bin_path_present
+ end
+ end
+
+ it "doesn't strip top-level directory if specified" do
+ directory( "/usr/local/foo_dont_strip/foo_sub").must_exist
+ end
+
+ it "does strip for zip file" do
+ file("/usr/local/foo_zip_strip/foo1.txt").must_exist
+ end
+
+
+ it "successfully compiles haproxy" do
+ file("/usr/local/haproxy-1.5/haproxy").must_exist
+ end
+
+ unless RUBY_PLATFORM =~ /freebsd/
+ it "installs haproxy binary" do
+ file("/usr/local/sbin/haproxy").must_exist
+ directory("/usr/local/doc/haproxy").must_exist
+ end
+ end
+
+ it "creates an alternate prefix_bin" do
+ link("/opt/bin/do_foo").must_exist.with(:link_type, :symbolic).and(:to, "/opt/foo_alt_bin-3/bin/do_foo")
+ end
+
+ it "properly unpacks .tbz and .tgz archives" do
+ file("/usr/local/foo_tbz/foo1.txt").must_exist
+ file("/usr/local/foo_tgz/foo1.txt").must_exist
+ end
+
+ it "sends notification when resource updated" do
+ file("/tmp/foobarbaz/notification_successful.txt").must_exist
+ end
+
+ it "uses autogen.sh to generate configure script" do
+ file("/usr/local/test_autogen-1/configure").must_exist
+ end
+
+end
View
90 ark/files/default/tests/minitest/test_test.rb
@@ -0,0 +1,90 @@
+require 'minitest/spec'
+
+describe_recipe 'ark::test' do
+
+ # It's often convenient to load these includes in a separate
+ # helper along with
+ # your own helper methods, but here we just include them directly:
+ include MiniTest::Chef::Assertions
+ include MiniTest::Chef::Context
+ include MiniTest::Chef::Resources
+
+ it "installed the unzip package" do
+ package("unzip").must_be_installed
+ end
+
+ if RUBY_PLATFORM =~ /freebsd/
+ it "installs the gnu tar package on freebsc" do
+ package("gtar").must_be_installed
+ end
+ end
+
+ it "puts an ark in the desired directory w/out symlinks" do
+ directory("/usr/local/test_put").must_exist
+ end
+
+ it "dumps the correct files into place with correct owner and group" do
+ file("/usr/local/foo_dump/foo1.txt").must_have(:owner, "foobarbaz").and(:group, "foobarbaz")
+ end
+
+ it "cherrypicks the mysql connector and set the correct owner and group" do
+ file("/usr/local/foo_cherry_pick/foo1.txt").must_have(:owner, "foobarbaz").and(:group, "foobarbaz")
+ end
+
+ it "creates directory and symlink properly for the full ark install" do
+ directory("/usr/local/foo-2").must_have(:owner, "foobarbaz").and(:group, "foobarbaz")
+ link("/usr/local/foo").must_exist.with(:link_type, :symbolic).and(:to, "/usr/local/foo-2")
+ end
+
+ it "symlinks multiple binary commands" do
+ link("/usr/local/bin/do_foo").must_exist.with(:link_type, :symbolic).and(:to, "/usr/local/foo-2/bin/do_foo")
+ link("/usr/local/bin/do_more_foo").must_exist.with(:link_type, :symbolic).and(:to, "/usr/local/foo-2/bin/do_more_foo")
+ end
+
+ it "appends to the environment PATH" do
+ unless RUBY_PLATFORM =~ /freebsd/
+ file("/etc/profile.d/foo_append_env.sh").must_include '/usr/local/foo_append_env-7.0.26/bin'
+
+ bin_path_present = !ENV['PATH'].scan( '/usr/local/foo_append_env-7.0.26/bin').empty?
+ assert bin_path_present
+ end
+ end
+
+ it "doesn't strip top-level directory if specified" do
+ directory( "/usr/local/foo_dont_strip/foo_sub").must_exist
+ end
+
+ it "does strip for zip file" do
+ file("/usr/local/foo_zip_strip/foo1.txt").must_exist
+ end
+
+
+ it "successfully compiles haproxy" do
+ file("/usr/local/haproxy-1.5/haproxy").must_exist
+ end
+
+ unless RUBY_PLATFORM =~ /freebsd/
+ it "installs haproxy binary" do
+ file("/usr/local/sbin/haproxy").must_exist
+ directory("/usr/local/doc/haproxy").must_exist
+ end
+ end
+
+ it "creates an alternate prefix_bin" do
+ link("/opt/bin/do_foo").must_exist.with(:link_type, :symbolic).and(:to, "/opt/foo_alt_bin-3/bin/do_foo")
+ end
+
+ it "properly unpacks .tbz and .tgz archives" do
+ file("/usr/local/foo_tbz/foo1.txt").must_exist
+ file("/usr/local/foo_tgz/foo1.txt").must_exist
+ end
+
+ it "sends notification when resource updated" do
+ file("/tmp/foobarbaz/notification_successful.txt").must_exist
+ end
+
+ it "uses autogen.sh to generate configure script" do
+ file("/usr/local/test_autogen-1/configure").must_exist
+ end
+
+end
View
433 ark/libraries/provider_ark.rb
@@ -0,0 +1,433 @@
+#
+# Cookbook Name:: ark
+# Provider:: Ark
+#
+# Author:: Bryan W. Berry <bryan.berry@gmail.com>
+# Copyright 2012, Bryan W. Berry
+#
+# 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.
+#
+
+require 'chef/provider'
+
+class Chef
+ class Provider
+ class Ark < Chef::Provider
+
+ def load_current_resource
+ @current_resource = Chef::Resource::Ark.new(@new_resource.name)
+ end
+
+ def action_download
+ unless new_resource.url =~ /^(http|ftp).*$/
+ new_resource.url = set_apache_url(url)
+ end
+ unless unpacked? new_resource.path
+ f = Chef::Resource::RemoteFile.new(new_resource.release_file, run_context)
+ f.source new_resource.url
+ if new_resource.checksum
+ f.checksum new_resource.checksum
+ end
+ f.run_action(:create)
+ end
+ end
+
+ def action_dump
+ set_dump_paths
+ action_download
+ action_dump_contents
+ action_set_owner new_resource.path
+ end
+
+ def action_install
+ set_paths
+ action_download
+ action_unpack
+ action_set_owner new_resource.path
+ action_install_binaries
+ action_link_paths
+ end
+
+ def action_autogen
+ b = Chef::Resource::Script::Bash.new("autogen.sh to generate configure", run_context)
+ b.cwd new_resource.path
+ b.environment new_resource.environment
+ b.code "./autogen.sh"
+ b.run_action(:run)
+ end
+
+ def action_configure
+ set_paths
+ action_download
+ action_unpack
+ unless ::File.exists?(::File.join(new_resource.path, 'configure'))
+ action_autogen
+ end
+ unless ::File.exists?(::File.join(new_resource.path, 'config.status'))
+ b = Chef::Resource::Execute.new("configure with autoconf", run_context)
+ b.cwd new_resource.path
+ b.environment new_resource.environment
+ b.command "./configure #{new_resource.autoconf_opts.join(' ')}"
+ b.run_action(:run)
+ end
+ end
+
+ def action_build_with_make
+ unless new_resource.creates and ::File.exists? new_resource.creates
+ set_paths
+ action_download
+ action_unpack
+ b = Chef::Resource::Script::Bash.new("build with make", run_context)
+ b.cwd new_resource.path
+ b.environment new_resource.environment
+ b.code "make #{new_resource.make_opts.join(' ')}"
+ b.run_action(:run)
+ action_set_owner new_resource.path
+ action_link_paths
+ action_install_binaries
+ end
+ end
+
+ def action_install_with_make
+ unless new_resource.creates and ::File.exists? new_resource.creates
+ action_build_with_make
+ b = Chef::Resource::Script::Bash.new("make install", run_context)
+ b.cwd new_resource.path
+ b.environment new_resource.environment
+ b.code "make install"
+ b.run_action(:run)
+ end
+ end
+
+
+ #TODO needs a test, start here http://guide.python-distribute.org/quickstart.html
+ def action_setup_py_build
+ unless new_resource.creates and ::File.exists? new_resource.creates
+ set_paths
+ action_download
+ action_unpack
+ b = Chef::Resource::Script::Bash.new("setup.py build", run_context)
+ b.cwd new_resource.path
+ b.environment new_resource.environment
+ b.code "python setup.py build"
+ b.run_action(:run)
+ end
+ end
+
+ #TODO needs a test, start here http://guide.python-distribute.org/quickstart.html
+ def action_setup_py_install
+ unless new_resource.creates and ::File.exists? new_resource.creates
+ set_paths
+ action_download
+ action_unpack
+ b = Chef::Resource::Script::Bash.new("setup.py install", run_context)
+ b.cwd new_resource.path
+ b.environment new_resource.environment
+ b.code "python setup.py install"
+ b.run_action(:run)
+ end
+ end
+
+ alias action_setup_py action_setup_py_install
+
+ def action_link_paths
+ l = Chef::Resource::Link.new(new_resource.home_dir, run_context)
+ l.to new_resource.path
+ l.run_action(:create)
+ end
+
+ def action_cherry_pick
+ full_path = ::File.join(new_resource.path, new_resource.creates)
+ set_dump_paths
+ action_download
+ action_cherry_pick_contents full_path
+ action_set_owner full_path
+ end
+
+ def action_put
+ set_put_paths
+ action_download
+ action_unpack
+ action_set_owner new_resource.path
+ end
+
+ def action_cherry_pick_contents(full_path)
+ chef_mkdir_p new_resource.path
+ cmd = expand_cmd
+ unless unpacked? new_resource.path
+ eval("#{cmd}_cherry_pick")
+ new_resource.updated_by_last_action(true)
+ end
+ end
+
+ def action_dump_contents
+ full_path = ::File.join(new_resource.path, new_resource.creates)
+ chef_mkdir_p new_resource.path
+ cmd = expand_cmd
+ unless unpacked? full_path
+ eval("#{cmd}_dump")
+ new_resource.updated_by_last_action(true)
+ end
+ end
+
+ def action_unpack
+ chef_mkdir_p new_resource.path
+ cmd = expand_cmd
+ unless unpacked? new_resource.path
+ eval(cmd)
+ new_resource.updated_by_last_action(true)
+ end
+ end
+
+ def action_set_owner(path)
+ require 'fileutils'
+ FileUtils.chown_R new_resource.owner, new_resource.group, path
+ FileUtils.chmod_R new_resource.mode, path
+ end
+
+ def action_install_binaries
+ unless new_resource.has_binaries.empty?
+ new_resource.has_binaries.each do |bin|
+ file_name = ::File.join(new_resource.prefix_bin, ::File.basename(bin))
+ l = Chef::Resource::Link.new(file_name, run_context)
+ l.to ::File.join(new_resource.path, bin)
+ l.run_action(:create)
+ end
+ end
+ if new_resource.append_env_path
+ append_to_env_path
+ end
+ end
+
+ private
+
+ def unpacked?(path)
+ if new_resource.creates
+ full_path = ::File.join(new_resource.path, new_resource.creates)
+ else
+ full_path = path
+ end
+ if ::File.directory? full_path
+ if ::File.stat(full_path).nlink == 2
+ false
+ else
+ true
+ end
+ elsif ::File.exists? full_path
+ true
+ else
+ false
+ end
+ end
+
+ def expand_cmd
+ case parse_file_extension
+ when /tar.gz|tgz/ then "tar_xzf"
+ when /tar.bz2|tbz/ then "tar_xjf"
+ when /zip|war|jar/ then "unzip"
+ else raise "Don't know how to expand #{new_resource.url}"
+ end
+ end
+
+ def set_paths
+ release_ext = parse_file_extension
+ prefix_bin = new_resource.prefix_bin.nil? ? new_resource.run_context.node['ark']['prefix_bin'] : new_resource.prefix_bin
+ prefix_root = new_resource.prefix_root.nil? ? new_resource.run_context.node['ark']['prefix_root'] : new_resource.prefix_root
+ if new_resource.prefix_home.nil?
+ default_home_dir = ::File.join(new_resource.run_context.node['ark']['prefix_home'], "#{new_resource.name}")
+ else
+ default_home_dir = ::File.join(new_resource.prefix_home, "#{new_resource.name}")
+ end
+ # set effective paths
+ new_resource.prefix_bin = prefix_bin
+ new_resource.version ||= "1" # initialize to one if nil
+ new_resource.path = ::File.join(prefix_root, "#{new_resource.name}-#{new_resource.version}")
+ new_resource.home_dir ||= default_home_dir
+ Chef::Log.debug("path is #{new_resource.path}")
+ new_resource.release_file = ::File.join(Chef::Config[:file_cache_path], "#{new_resource.name}.#{release_ext}")
+ end
+
+ def set_put_paths
+ release_ext = parse_file_extension
+ path = new_resource.path.nil? ? new_resource.run_context.node['ark']['prefix_root'] : new_resource.path
+ new_resource.path = ::File.join(path, "#{new_resource.name}")
+ Chef::Log.debug("path is #{new_resource.path}")
+ new_resource.release_file = ::File.join(Chef::Config[:file_cache_path], "#{new_resource.name}.#{release_ext}")
+ end
+
+ def set_dump_paths
+ release_ext = parse_file_extension
+ new_resource.release_file = ::File.join(Chef::Config[:file_cache_path], "#{new_resource.name}.#{release_ext}")
+ end
+
+ def parse_file_extension
+ if new_resource.extension.nil?
+ # purge any trailing redirect
+ url = new_resource.url.clone
+ url =~ /^https?:\/\/.*(.gz|bz2|bin|zip|jar|tgz|tbz)(\/.*\/)/
+ url.gsub!($2, '') unless $2.nil?
+ # remove tailing query string
+ release_basename = ::File.basename(url.gsub(/\?.*\z/, '')).gsub(/-bin\b/, '')
+ # (\?.*)? accounts for a trailing querystring
+ Chef::Log.debug("release_basename is #{release_basename}")
+ release_basename =~ %r{^(.+?)\.(tar\.gz|tar\.bz2|zip|war|jar|tgz|tbz)(\?.*)?}
+ Chef::Log.debug("file_extension is #{$2}")
+ new_resource.extension = $2
+ end
+ new_resource.extension
+ end
+
+ def set_apache_url(url_ref)
+ raise "Missing required resource attribute url" unless url_ref
+ url_ref.gsub!(/:name:/, name.to_s)
+ url_ref.gsub!(/:version:/, version.to_s)
+ url_ref.gsub!(/:apache_mirror:/, node['install_from']['apache_mirror'])
+ url_ref
+ end
+
+
+ def unzip
+ FileUtils.mkdir_p new_resource.path
+ if new_resource.strip_leading_dir
+ require 'tmpdir'
+ tmpdir = Dir.mktmpdir
+ cmd = Chef::ShellOut.new("unzip -q -u -o '#{new_resource.release_file}' -d '#{tmpdir}'")
+ cmd.run_command
+ cmd.error!
+ subdirectory_children = Dir.glob("#{tmpdir}/**")
+ if subdirectory_children.length == 1
+ subdir = subdirectory_children[0]
+ subdirectory_children = Dir.glob("#{subdir}/**")
+ end
+ FileUtils.mv subdirectory_children, new_resource.path
+ FileUtils.rm_rf tmpdir
+ else
+ cmd = Chef::ShellOut.new("unzip -q -u -o #{new_resource.release_file} -d #{new_resource.path}")
+ cmd.run_command
+ cmd.error!
+ end
+ end
+
+ def unzip_dump
+ cmd = Chef::ShellOut.new(
+ %Q{unzip -j -q -u -o '#{new_resource.release_file}' -d '#{new_resource.path}'}
+ )
+ cmd.run_command
+ cmd.error!
+ end
+
+ def unzip_cherry_pick
+ b = Chef::Resource::Script::Bash.new(new_resource.name, run_context)
+ b.code <<-EOS
+ unzip -t #{new_resource.release_file} "*/#{new_resource.creates}"
+ if [ $? -eq 11 ] ; then
+ unzip -j -o #{new_resource.release_file} "#{new_resource.creates}" -d #{new_resource.path}
+ else
+ unzip -j -o #{new_resource.release_file} "*/#{new_resource.creates}" -d #{new_resource.path}
+ fi
+ EOS
+ b.run_action(:run)
+ end
+
+ def tar_xjf
+ untar_cmd("xjf")
+ end
+
+ def tar_xzf
+ untar_cmd("xzf")
+ end
+
+ def tar_xjf_dump
+ Chef::Application.fatal!("Cannot yet dump paths for tar archives")
+ end
+
+ def tar_xzf_dump
+ Chef::Application.fatal!("Cannot yet dump paths for tar archives")
+ end
+
+ def tar_xjf_cherry_pick
+ untar_cmd_cherry_pick("xjf")
+ end
+
+ def tar_xzf_cherry_pick
+ untar_cmd_cherry_pick("xzf")
+ end
+
+ def untar_cmd(sub_cmd)
+ if new_resource.strip_leading_dir
+ strip_argument = "--strip-components=1"
+ else
+ strip_argument = ""
+ end
+
+ b = Chef::Resource::Script::Bash.new(new_resource.name, run_context)
+ cmd = %Q{#{tar_cmd} -#{sub_cmd} #{new_resource.release_file} #{strip_argument} -C #{new_resource.path} }
+ b.flags "-x"
+ b.code <<-EOH
+ tar -#{sub_cmd} #{new_resource.release_file} #{strip_argument} -C #{new_resource.path}
+ EOH
+ b.run_action(:run)
+ end
+
+ def untar_cmd_cherry_pick(sub_cmd)
+ dest = ::File.join(new_resource.path, new_resource.creates)
+ cmd = Chef::ShellOut.new(%Q{#{tar_cmd} --no-anchored -O -#{sub_cmd} '#{new_resource.release_file}' #{new_resource.creates} > '#{dest}';})
+ cmd.run_command
+ cmd.error!
+ end
+
+ def chef_mkdir_p(dir)
+ d = Chef::Resource::Directory.new(dir, run_context)
+ d.mode '0755'
+ d.recursive true
+ d.run_action(:create)
+ end
+
+ def append_to_env_path
+ if platform?("freebsd")
+ if new_resource.has_binaries.empty?
+ Chef::Log.warn "#{new_resource} specifies append_env_path but that is unimplemented on FreeBSD; " +
+ "consider using has_binaries"
+ else
+ Chef::Log.info "#{new_resource} specifies both has_binaries and append_env_path; " +
+ "the latter is a noop on FreeBSD."
+ end
+ return
+ end
+
+ new_path = ::File.join(new_resource.path, 'bin')
+ Chef::Log.debug("new_path is #{new_path}")
+ path = "/etc/profile.d/#{new_resource.name}.sh"
+ f = Chef::Resource::File.new(path, run_context)
+ f.content <<-EOF
+ export PATH=$PATH:#{new_path}
+ EOF
+ f.mode 0755
+ f.owner 'root'
+ f.group 'root'
+ f.run_action(:create)
+
+ bin_path = ::File.join(new_resource.path, 'bin')
+ if ENV['PATH'].scan(bin_path).empty?
+ ENV['PATH'] = ENV['PATH'] + ':' + bin_path
+ end
+ Chef::Log.debug("PATH after setting_path is #{ENV['PATH']}")
+ end
+
+ def tar_cmd
+ platform?("freebsd") ? "gtar" : "tar"
+ end
+ end
+ end
+end
+
View
64 ark/libraries/resource_ark.rb
@@ -0,0 +1,64 @@
+#
+# Cookbook Name:: ark
+# Resource:: Ark
+#
+# Author:: Bryan W. Berry <bryan.berry@gmail.com>
+# Copyright 2012, Bryan W. Berry
+#
+# 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.
+#
+
+require 'chef/resource'
+
+class Chef
+ class Resource
+ class Ark < Chef::Resource
+
+ def initialize(name, run_context=nil)
+ super
+ @resource_name = :ark
+ @allowed_actions.push(:install, :dump, :cherry_pick, :put, :install_with_make, :configure, :setup_py_build, :setup_py_install, :setup_py)
+ @action = :install
+ @provider = Chef::Provider::Ark
+ end
+
+ attr_accessor :path, :release_file, :prefix_bin, :prefix_root, :home_dir, :extension, :version
+
+ attribute :owner, :kind_of => String, :default => 'root'
+ attribute :group, :kind_of => [String, Fixnum], :default => 0
+ attribute :url, :kind_of => String, :required => true
+ attribute :path, :kind_of => String, :default => nil
+ attribute :full_path, :kind_of => String, :default => nil
+ attribute :append_env_path, :kind_of => [TrueClass, FalseClass], :default => false
+ attribute :checksum, :regex => /^[a-zA-Z0-9]{64}$/, :default => nil
+ attribute :has_binaries, :kind_of => Array, :default => []
+ attribute :creates, :kind_of => String, :default => nil
+ attribute :release_file, :kind_of => String, :default => ''
+ attribute :strip_leading_dir, :kind_of => [TrueClass, FalseClass], :default => true
+ attribute :mode, :kind_of => Fixnum, :default => 0755
+ attribute :prefix_root, :kind_of => String, :default => nil
+ attribute :prefix_home, :kind_of => String, :default => nil
+ attribute :prefix_bin, :kind_of => String, :default => nil
+ attribute :version, :kind_of => String, :default => nil
+ attribute :home_dir, :kind_of => String, :default => nil
+ attribute :environment, :kind_of => Hash, :default => {}
+ attribute :autoconf_opts, :kind_of => Array, :default => []
+ attribute :make_opts, :kind_of => Array, :default => []
+ attribute :home_dir, :kind_of => String, :default => nil
+ attribute :autoconf_opts, :kind_of => Array, :default => []
+ attribute :extension, :kind_of => String
+
+ end
+ end
+end
+
View
35 ark/metadata.json
@@ -0,0 +1,35 @@
+{
+ "name": "ark",
+ "description": "Installs/Configures ark",
+ "long_description": "# <a name=\"title\"></a> chef-ark [![Build Status](https://secure.travis-ci.org/bryanwb/chef-ark.png?branch=master)](http://travis-ci.org/bryanwb/chef-ark)\n\nOverview \n========\n\nAn ''ark'' is like an archive but ''Kewler''\n\nDoes the fetch-unpack-configure-build-install dance. This is a\nmodified verion of Infochimps awesome install_from cookbook\n [http://github.com/infochimps-cookbooks/install_from]. It has been\n heavily refactored and extended to meet different use cases.\n\nGiven a project `pig`, with url `http://apache.org/pig/pig-0.8.0.tar.gz`, and\nthe default :path of `/usr/local`, this provider will\n\n* fetch it to to `/var/cache/chef/`\n* unpack it to :path (`/usr/local/pig-0.8.0`)\n* create a symlink for :home_dir (`/usr/local/pig`) pointing to :path\n* add specified binary commands to the enviroment PATH variable\n\nBy default, the ark will not run again if the :path is not\nempty. Ark provides many actions to accommodate different use cases,\nsuch as :dump, :cherry_pick, :put, and :install_with_make.\n\nAt this time ark only handles files available from URLs. It does not\nhandle local files.\n\n\nAttributes\n==========\n\nYou can customize the basic attributes to meet your organization's conventions\n\n* default[:ark][:apache_mirror] = 'http://apache.mirrors.tds.net'\n\n\nResources/Providers\n===================\n\n* ark - does the extract/build/configure dance\n\nActions \n=======\n\n- :install: extracts the file and creates a 'friendly' symbolic link\n to the extracted directory path\n- :configure: configure ahead of the install action\n- :install_with_make: extracts the archive to a path, runs make, and\n make install. It does _not_ run the configure step at this time\n- :dump: strips all directories from the archive and dumps the\n contained files into a specified path\n- :cherry_pick: extract a specified file from an archive and places\n in specified path\n- :put: extract the archive to a specified path, does not create any\n symbolic links\n- :remove: removes the extracted directory and related symlink #TODO\n- :setup_py_build: runs the command \"python setup.py build\" in the\n extracted directory\n- :setup_py_install: runs the comand \"python setup.py install\" in the\n extracted directory\n\n# :put\n\n## Relevant Attribute Parameters\n\n- path: path to extract to, defaults to '/usr/local'\n- has_binaries: array of binary commands to symlink to\n /usr/local/bin/, you must specify the relative path example: [ 'bin/java', 'bin/javaws' ]\n- append_env_path: boolean, if true, append the ./bin directory of the\n extracted directory to the global PATH variable for all users\n\n# :dump\n\n\nNOTE: This currently only works for zip archives\n\n## Relevant Attribute Parameters\n\n- path: path to dump files to \n- mode: file mode for app_home, is an integer\n- creates: if you are appending files to a given directory, ark\n needs a condition to test whether the file has already been\n extracted. You can specify with creates, a file whose existence\n indicates the ark has previously been extracted and does not need to\n be extracted again\n\n# :cherry_pick\n\n\n## Relevant Attribute Parameters\n\n- path: directory to place file in\n- creates: specific file to cherry-pick\n\n\nark\n===\n\n# Attribute Parameters\n\n- name: name of the package, defaults to the resource name\n- url: url for tarball, .tar.gz, .bin (oracle-specific), .war, and .zip\n currently supported. Also supports special syntax\n :name:version:apache_mirror: that will auto-magically construct\n download url from the apache mirrors site\n- version: software version, defaults to \"1\" if not specified. The :dump, :cherry_pick, and :put actions do not use it\n- extension: The file extension of the file you are trying to\n download. If not specified, ark tries to determine the file\n extension by parsing the URL\n- checksum: sha256 checksum, used for security \n- mode: file mode for app_home, is an integer TODO\n- prefix_root: default prefix_root, for use with :install* actions\n- prefix_home: default directory prefix for a friendly symlink to the path, for\n example /usr/local/maven -> /usr/local/maven-2.2.1\n- prefix_bin: default directory to place a symlink to a binary\n command, example /opt/bin/mvn ->\n /opt/maven-2.2.1/bin/mvn , where the prefix_bin is \"/opt/bin\"\n- path: path to extract the ark to, by default is\n /usr/local/<name>-<version> for the :install, :install_with_make actions\n the :install* actions overwrite any user-provided values for :path\n- home_dir: symbolic link to the path :prefix_root/:name-:version,\n defaults to :prefix_root/:name , , does not apply to :dump, :put, or\n :cherry_pick actions\n- has_binaries: array of binary commands to symlink to\n /usr/local/bin/, you must specify the relative path example: [ 'bin/java', 'bin/javaws' ]\n- append_env_path: boolean, similar to has_binaries but less granular\n - If true, append the ./bin directory of the extracted directory to\n the PATH environment variable for all users, does this by placing a file in /etc/profile.d/ which will be read by all users\n be added to the path. The commands are symbolically linked to\n /usr/bin/* . Examples are mvn, java, javac, etc. This option\n provides more granularity than the boolean option\n- environment: hash of environment variables to pass to invoked shell\n commands like tar, unzip, configure, and make\n- strip_leading_dir: by default, ark strips the leading directory from\n an archive, which is the default for both unzip and tar commands \n- autoconf_opts: an array of command line options for use with the GNU\n autoconf script\n- make_opts: an array of command line options for use with make\n- owner: owner of extracted directory, set to \"root\" by default\n\n# Examples\n\n # install Apache Ivy dependency resolution tool\n ark \"ivy\" do\n url 'http://someurl.example.com/ivy.tar.gz'\n version '2.2.0' \n checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'\n action :install\n end\n \nThis example copies ivy.tar.gz to /var/cache/chef/ivy-2.2.0.tar.gz,\nunpacks its contents to /usr/local/ivy-2.2.0/ -- stripping the\nleading directory, and symlinks /usr/local/ivy to /usr/local/ivy-2.2.0\n\n\n ark 'jdk' do\n url 'http://download.example.com/jdk-7u2-linux-x64.tar.gz'\n version '7.2'\n path \"/usr/local/jvm/\"\n home_dir \"/usr/local/jvm/default\" \n checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'\n append_env_path true\n owner 'foobar'\n end\n\nThis example copies jdk-7u2-linux-x64.tar.gz to /var/cache/chef/jdk-7.2.tar.gz,\nunpacks its contents to /usr/local/jvm/jdk-7.2/ -- stripping the\nleading directory, symlinks /usr/local/jvm/default to\n/usr/local/jvm/jdk-7.2, and adds /usr/local/jvm/jdk-7.2/bin/ to\nthe global PATH for all users. The user 'foobar' is the owner of the\n/usr/local/jvm/jdk-7.2 directory\n\n # install Apache Ivy dependency resolution tool\n # in <path>/resource_name in this case\n # /usr/local/ivy, no symlink created\n # it strips any leading directory if one exists in the tarball\n ark \"ivy\" do\n url 'http://someurl.example.com/ivy.tar.gz'\n checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'\n action :put\n end\n\n # install Apache Ivy dependency resolution tool\n # in /home/foobar/ivy \n # it does strip any leading directory if one exists\n ark \"ivy\" do\n path \"/home/foobar\n url 'http://someurl.example.com/ivy.tar.gz'\n checksum '89ba5fde0c596db388c3bbd265b63007a9cc3df3a8e6d79a46780c1a39408cb5'\n action :put\n end\n\n \n\n # strip all directories and dump files into path specified by \n # the path attribute, you must specify the `creates` attribute\n # in order to keep the extraction from running every time\n # the directory path will be created if it doesn't already exist\n ark \"my_jars\" do\n url \"http://example.com/bunch_of_jars.zip\"\n path \"/usr/local/tomcat/lib\"\n creates \"mysql.jar\"\n owner \"tomcat\" \n action :dump\n end\n\n # extract specific files from a tarball, currently only handles\n # one named file\n ark 'mysql-connector-java' do\n url 'http://oracle.com/mysql-connector.zip'\n creates 'mysql-connector-java-5.0.8-bin.jar'\n path '/usr/local/tomcat/lib'\n action :cherry_pick\n end\n\n\n # build and install haproxy and use alternave values for\n # prefix_root, prefix_home, and prefix_bin\n ark \"haproxy\" do\n url \"http://haproxy.1wt.eu/download/1.5/src/snapshot/haproxy-ss-20120403.tar.gz\"\n version \"1.5\"\n checksum 'ba0424bf7d23b3a607ee24bbb855bb0ea347d7ffde0bec0cb12a89623cbaf911'\n make_opts [ 'TARGET=linux26' ]\n prefix_root '/opt'\n prefix_home '/opt'\n prefix_bin '/opt/bin'\n action :install_with_make\n end \n\n # you can also pass multiple actions to ark and supply the file extension\n # in case the file extension can not be determined by the URL\n ark \"test_autogen\" do\n url 'https://github.com/zeromq/libzmq/tarball/master'\n extension \"tar.gz\"\n action [ :configure, :build_with_make ]\n end \n\n\n \n## License and Author\n\nAuthor:: Philip (flip) Kromer - Infochimps, Inc(<coders@infochimps.com>) \nAuthor:: Bryan W. Berry (<bryan.berry@gmail.com>) \nAuthor:: Denis Barishev (<denis.barishev@gmail.com>) \nCopyright:: 2011, Philip (flip) Kromer - Infochimps, Inc \nCopyright:: 2012, Bryan W. Berry \nCopyright:: 2012, Denis Barishev \n\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",
+ "maintainer": "Bryan W. Berry",
+ "maintainer_email": "bryan.berry@gmail.com",
+ "license": "Apache 2.0",
+ "platforms": {
+ "debian": ">= 0.0.0",
+ "ubuntu": ">= 0.0.0",
+ "centos": ">= 0.0.0",
+ "redhat": ">= 0.0.0",
+ "fedora": ">= 0.0.0"
+ },
+ "dependencies": {
+ },
+ "recommendations": {
+ },
+ "suggestions": {
+ },
+ "conflicting": {
+ },
+ "providing": {
+ },
+ "replacing": {
+ },
+ "attributes": {
+ },
+ "groupings": {
+ },
+ "recipes": {
+ "ark::default": "Installs and configures ark"
+ },
+ "version": "0.0.15"
+}
View
12 ark/metadata.rb
@@ -0,0 +1,12 @@
+maintainer "Bryan W. Berry"
+maintainer_email "bryan.berry@gmail.com"
+license "Apache 2.0"
+description "Installs/Configures ark"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version "0.0.15"
+
+%w{ debian ubuntu centos redhat fedora }.each do |os|
+ supports os
+end
+
+recipe "ark::default", "Installs and configures ark"
View
26 ark/recipes/default.rb
@@ -0,0 +1,26 @@
+#
+# Cookbook Name:: ark
+# Recipe:: default
+#
+# Author:: Bryan W. Berry <bryan.berry@gmail.com>
+# Copyright 2012, Bryan W. Berry
+#
+# 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.
+#
+
+
+package "unzip"
+
+if platform?("freebsd")
+ package "gtar"
+end
View
131 ark/recipes/test.rb
@@ -0,0 +1,131 @@
+require 'fileutils'
+
+# remove file so we can test sending notification on its creation
+if ::File.exist? "/tmp/foobarbaz/foo1.txt"
+ FileUtils.rm_f "/tmp/foobarbaz/foo1.txt"
+end
+
+ruby_block "test_notification" do
+ block do
+ if ::File.exist? "/tmp/foobarbaz/foo1.txt"
+ FileUtils.touch "/tmp/foobarbaz/notification_successful.txt"
+ end
+ end
+ action :nothing
+end
+
+
+user 'foobarbaz'
+
+directory "/opt/bin" do
+ recursive true
+end
+
+ark 'test_put' do
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
+ checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
+ owner 'foobarbaz'
+ group 'foobarbaz'
+ action :put
+end
+
+ark "test_dump" do
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.zip'
+ checksum 'deea3a324115c9ca0f3078362f807250080bf1b27516f7eca9d34aad863a11e0'
+ path '/usr/local/foo_dump'
+ creates 'foo1.txt'
+ action :dump
+ owner 'foobarbaz'
+ group 'foobarbaz'
+end
+
+ark 'cherry_pick_test' do
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
+ checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
+ path '/usr/local/foo_cherry_pick'
+ owner 'foobarbaz'
+ group 'foobarbaz'
+ creates "foo1.txt"
+ action :cherry_pick
+end
+
+
+ark "foo" do
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
+ checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
+ version '2'
+ prefix_root "/usr/local"
+ owner "foobarbaz"
+ group 'foobarbaz'
+ has_binaries [ 'bin/do_foo', 'bin/do_more_foo' ]
+ action :install
+end
+
+ark "foo_append_env" do
+ version "7.0.26"
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
+ checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
+ append_env_path true
+ action :install
+end
+
+ark "foo_dont_strip" do
+ version "2"
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
+ checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
+ strip_leading_dir false
+ action :install
+end
+
+ark "foo_zip_strip" do
+ version "2"
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.zip'
+ checksum 'deea3a324115c9ca0f3078362f807250080bf1b27516f7eca9d34aad863a11e0'
+ action :install
+end
+
+
+ark "haproxy" do
+ url "http://haproxy.1wt.eu/download/1.5/src/snapshot/haproxy-ss-20120403.tar.gz"
+ version "1.5"
+ checksum 'ba0424bf7d23b3a607ee24bbb855bb0ea347d7ffde0bec0cb12a89623cbaf911'
+ make_opts [ 'TARGET=linux26' ]
+ action :install_with_make
+end unless platform?("freebsd")
+
+ark "foo_alt_bin" do
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tar.gz'
+ checksum '5996e676f17457c823d86f1605eaa44ca8a81e70d6a0e5f8e45b51e62e0c52e8'
+ version '3'
+ prefix_root "/opt"
+ prefix_home "/opt"
+ prefix_bin "/opt/bin"
+ owner "foobarbaz"
+ group 'foobarbaz'
+ has_binaries [ 'bin/do_foo' ]
+ action :install
+end
+
+ark "foo_tbz" do
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tbz'
+ version '3'
+end
+
+ark "foo_tgz" do
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.tgz'
+ version '3'
+end
+
+ark "test notification" do
+ url 'https://github.com/bryanwb/chef-ark/raw/master/files/default/foo.zip'
+ path "/tmp/foobarbaz"
+ creates "foo1.txt"
+ action :dump
+ notifies :create, "ruby_block[test_notification]", :immediately
+end
+
+ark "test_autogen" do
+ url 'https://github.com/zeromq/libzmq/tarball/master'
+ extension "tar.gz"
+ action :configure
+end
1 elasticsearch
@@ -0,0 +1 @@
+Subproject commit 82ecd00f6c2a08dfc7c7db5c5e3314de0a1331b3
View
7 java/.gitignore
@@ -0,0 +1,7 @@
+.bundle
+.cache
+.kitchen
+bin
+#*#
+*~
+.#*#
View
35 java/CHANGELOG.md
@@ -0,0 +1,35 @@
+## v1.6.0:
+
+* [COOK-1218] - Install Oracle JDK from Oracle download directly
+* [COOK-1631] - set JAVA_HOME in openjdk recipe
+* [COOK-1655] - Install correct architecture on Amazon Linux
+
+## v1.5.4:
+
+* [COOK-885] - update alternatives called on wrong file
+* [COOK-1607] - use shellout instead of execute resource to update
+ alternatives
+
+## v1.5.2:
+
+* [COOK-1200] - remove sun-java6-jre on Ubuntu before installing
+ Oracle's Java
+* [COOK-1260] - fails on Ubuntu 12.04 64bit with openjdk7
+* [COOK-1265] - Oracle Java should symlink the jar command
+
+## v1.5.0:
+
+* [COOK-1146] - Oracle now prevents download of JDK via non-browser
+* [COOK-1114] - fix File.exists?
+
+## v1.4.2:
+
+* [COOK-1051] - fix attributes typo and platform case switch
+ consistency
+
+## v1.4.0:
+
+* [COOK-858] - numerous updates: handle jdk6 and 7, switch from sun to
+ oracle, make openjdk default, add `java_ark` LWRP.
+* [COOK-942] - FreeBSD support
+* [COOK-520] - ArchLinux support
View
29 java/CONTRIBUTING
@@ -0,0 +1,29 @@
+If you would like to contribute, please open a ticket in JIRA:
+
+* http://tickets.opscode.com
+
+Create the ticket in the COOK project and use the cookbook name as the
+component.
+
+For all code contributions, we ask that contributors sign a
+contributor license agreement (CLA). Instructions may be found here:
+
+* http://wiki.opscode.com/display/chef/How+to+Contribute
+
+When contributing changes to individual cookbooks, please do not
+modify the version number in the metadata.rb. Also please do not
+update the CHANGELOG.md for a new version. Not all changes to a
+cookbook may be merged and released in the same versions. Opscode will
+handle the version updates during the release process. You are welcome
+to correct typos or otherwise make updates to documentation in the
+README.
+
+If a contribution adds new platforms or platform versions, indicate
+such in the body of the commit message(s), and update the relevant
+COOK ticket. When writing commit messages, it is helpful for others if
+you indicate the COOK ticket. For example:
+
+ git commit -m '[COOK-1041] Updated pool resource to correctly delete.'
+
+In the ticket itself, it is also helpful if you include log output of
+a successful Chef run, but this is not absolutely required.
View
3 java/Gemfile
@@ -0,0 +1,3 @@
+source :rubygems
+
+gem 'test-kitchen'
View
115 java/Gemfile.lock
@@ -0,0 +1,115 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ archive-tar-minitar (0.5.2)
+ bunny (0.7.9)
+ chef (10.14.2)
+ bunny (>= 0.6.0, < 0.8.0)
+ erubis
+ highline (>= 1.6.9)
+ json (>= 1.4.4, <= 1.6.1)
+ mixlib-authentication (>= 1.3.0)
+ mixlib-cli (>= 1.1.0)
+ mixlib-config (>= 1.1.2)
+ mixlib-log (>= 1.3.0)
+ mixlib-shellout
+ moneta
+ net-ssh (~> 2.2.2)
+ net-ssh-multi (~> 1.1.0)
+ ohai (>= 0.6.0)
+ rest-client (>= 1.0.4, < 1.7.0)
+ treetop (~> 1.4.9)
+ uuidtools
+ yajl-ruby (~> 1.1)
+ childprocess (0.3.5)
+ ffi (~> 1.0, >= 1.0.6)
+ coderay (1.0.7)
+ erubis (2.7.0)
+ ffi (1.1.5)
+ foodcritic (1.6.1)
+ erubis
+ gherkin (~> 2.11.1)
+ gist (~> 3.1.0)
+ nokogiri (= 1.5.0)
+ pry (~> 0.9.8.4)
+ rak (~> 1.4)
+ treetop (~> 1.4.10)
+ yajl-ruby (~> 1.1.0)
+ gherkin (2.11.2)
+ json (>= 1.4.6)
+ gist (3.1.0)
+ hashr (0.0.22)
+ highline (1.6.15)
+ i18n (0.6.1)
+ ipaddress (0.8.0)
+ json (1.5.4)
+ librarian (0.0.24)
+ archive-tar-minitar (>= 0.5.2)
+ chef (>= 0.10)
+ highline
+ thor (~> 0.15)
+ log4r (1.1.10)
+ method_source (0.7.1)
+ mime-types (1.19)
+ mixlib-authentication (1.3.0)
+ mixlib-log
+ mixlib-cli (1.2.2)
+ mixlib-config (1.1.2)
+ mixlib-log (1.4.1)
+ mixlib-shellout (1.1.0)
+ moneta (0.6.0)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-ssh (2.2.2)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
+ net-ssh-multi (1.1)
+ net-ssh (>= 2.1.4)
+ net-ssh-gateway (>= 0.99.0)
+ nokogiri (1.5.0)
+ ohai (6.14.1)
+ ipaddress
+ mixlib-cli
+ mixlib-config
+ mixlib-log
+ systemu
+ yajl-ruby
+ polyglot (0.3.3)
+ pry (0.9.8.4)
+ coderay (~> 1.0.5)
+ method_source (~> 0.7.1)
+ slop (>= 2.4.4, < 3)
+ rak (1.4)
+ rest-client (1.6.7)
+ mime-types (>= 1.16)
+ slop (2.4.4)
+ systemu (2.5.2)
+ test-kitchen (0.5.4)
+ foodcritic (~> 1.4)
+ hashr (~> 0.0.20)
+ highline (>= 1.6.9)
+ librarian (~> 0.0.20)
+ mixlib-cli (~> 1.2.2)
+ vagrant (~> 1.0.2)
+ yajl-ruby (~> 1.1.0)
+ thor (0.16.0)
+ treetop (1.4.10)
+ polyglot
+ polyglot (>= 0.3.1)
+ uuidtools (2.1.3)
+ vagrant (1.0.5)
+ archive-tar-minitar (= 0.5.2)
+ childprocess (~> 0.3.1)
+ erubis (~> 2.7.0)
+ i18n (~> 0.6.0)
+ json (~> 1.5.1)
+ log4r (~> 1.1.9)
+ net-scp (~> 1.0.4)
+ net-ssh (~> 2.2.2)
+ yajl-ruby (1.1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ test-kitchen
View
201 java/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+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.
View
202 java/README.md
@@ -0,0 +1,202 @@
+Description
+===========
+
+Installs a Java. Uses OpenJDK by default but supports installation of Oracle's JDK.
+
+This cookbook contains the `java_ark` LWPR which has been deprecated
+in favor of [ark](https://github.com/opscode-cookbooks/ark).
+
+**IMPORTANT NOTE**
+
+As of 26 March 2012 you can no longer directly download
+the JDK from Oracle's website without using a special cookie. This cookbook uses
+that cookie to download the oracle recipe on your behalf, but . . .
+
+the java::oracle recipe forces you to set either override
+the `node['java']['oracle']['accept_oracle_download_terms']` to true or set up a
+private repository accessible by HTTP.
+
+Example
+
+### override the `accept_oracle_download_terms`
+
+roles/base.rb
+This cookbook also provides the `java_ark` LWRP which other java
+cookbooks can use to install java-related applications from binary
+packages.
+
+ default_attributes(
+ :java => {
+ :oracle => {
+ "accept_oracle_download_terms" => true
+ }
+ }
+ )
+
+You are most encouraged to voice your complaints to Oracle and/or
+switch to OpenJDK.
+
+Requirements
+============
+
+Platform
+--------
+
+* Debian, Ubuntu
+* CentOS, Red Hat, Fedora, Scientific, Amazon
+* ArchLinux
+* FreeBSD
+
+Attributes
+==========
+
+See `attributes/default.rb` for default values.
+
+* `node["java"]["install_flavor"]` - Flavor of JVM you would like installed (`oracle` or
+`openjdk`), default `openjdk`.
+* `node['java']['java_home']` - Default location of the "`$JAVA_HOME`".
+* `node['java']['tarball']` - Name of the tarball to retrieve from your corporate
+repository default `jdk1.6.0_29_i386.tar.gz`
+* `node['java']['tarball_checksum']` - Checksum for the tarball, if you use a different
+tarball, you also need to create a new sha256 checksum
+* `node['java']['jdk']` - Version and architecture specific attributes for setting the
+URL on Oracle's site for the JDK, and the checksum of the .tar.gz.
+* `node['java']['remove_deprecated_packages']` - Removes the now deprecated Ubuntu JDK
+packages from the system, default `false`
+* `node['java']['oracle']['accept_oracle_download_terms']` - Indicates that you accept
+ Oracle's EULA
+
+Recipes
+=======
+
+default
+-------
+
+Include the default recipe in a run list, to get `java`. By default
+the `openjdk` flavor of Java is installed, but this can be changed by
+using the `install_flavor` attribute.
+
+OpenJDK is the default because of licensing changes made upstream by
+Oracle. See notes on the `oracle` recipe below.
+
+openjdk
+-------
+
+This recipe installs the `openjdk` flavor of Java.
+
+oracle
+------
+
+This recipe installs the `oracle` flavor of Java. This recipe does not
+use distribution packages as Oracle changed the licensing terms with
+JDK 1.6u27 and prohibited the practice for both the debian and EL worlds.
+
+For both debian and centos/rhel, this recipe pulls the binary
+distribution from the Oracle website, and installs it in the default
+JAVA_HOME for each distribution. For debian/ubuntu, this is
+/usr/lib/jvm/default-java. For Centos/RHEL, this is /usr/lib/jvm/java
+
+After putting the binaries in place, the oracle recipe updates
+/usr/bin/java to point to the installed JDK using the
+`update-alternatives` script
+
+oracle_i386
+-----------
+
+This recipe installs the 32-bit Java virtual machine without setting
+it as the default. This can be useful if you have applications on the
+same machine that require different versions of the JVM.
+
+Resources/Providers
+===================
+
+This cookbook contains the `java_ark` LWPR which has been deprecated
+in favor of [ark](https://github.com/opscode-cookbooks/ark).
+
+By default, the extracted directory is extracted to
+`app_root/extracted_dir_name` and symlinked to `app_root/default`
+
+# Actions
+
+- `:install`: extracts the tarball and makes necessary symlinks
+- `:remove`: removes the tarball and run update-alternatives for all
+ symlinked `bin_cmds`
+
+# Attribute Parameters
+
+- `url`: path to tarball, .tar.gz, .bin (oracle-specific), and .zip
+ currently supported
+- `checksum`: sha256 checksum, not used for security but avoid
+ redownloading the archive on each chef-client run
+- `app_home`: the default for installations of this type of
+ application, for example, `/usr/lib/tomcat/default`. If your
+ application is not set to the default, it will be placed at the same
+ level in the directory hierarchy but the directory name will be
+ `app_root/extracted_directory_name + "_alt"`
+- `app_home_mode`: file mode for app_home, is an integer
+- `bin_cmds`: array of binary commands that should be symlinked to
+ /usr/bin, examples are mvn, java, javac, etc. These cmds must be in
+ the bin/ subdirectory of the extracted folder. Will be ignored if this
+ java_ark is not the default
+- `owner`: owner of extracted directory, set to "root" by default
+- `default`: whether this the default installation of this package,
+ boolean true or false
+
+
+# Examples
+
+ # install jdk6 from Oracle
+ java_ark "jdk" do
+ url 'http://download.oracle.com/otn-pub/java/jdk/6u29-b11/jdk-6u29-linux-x64.bin'
+ checksum 'a8603fa62045ce2164b26f7c04859cd548ffe0e33bfc979d9fa73df42e3b3365'
+ app_home '/usr/local/java/default'
+ bin_cmds ["java", "javac"]
+ action :install
+ end
+
+
+Usage
+=====
+
+Simply include the `java` recipe where ever you would like Java installed.
+
+To install Oracle flavored Java on Debian or Ubuntu override the `node['java']['install_flavor']` attribute with in role:
+
+ name "java"
+ description "Install Oracle Java on Ubuntu"
+ override_attributes(
+ "java" => {
+ "install_flavor" => "oracle"
+ }
+ )
+ run_list(
+ "recipe[java]"
+ )
+
+Development
+===========
+
+This cookbook uses
+[test-kitchen](https://github.com/opscode/test-kitchen) for
+integration tests. Pull requests should pass existing tests in
+files/default/tests/minitest-handler. Additional tests are always welcome.
+
+License and Author
+==================
+
+Author:: Seth Chisamore (<schisamo@opscode.com>)
+Author:: Bryan W. Berry (<bryan.berry@gmail.com>)
+
+Copyright:: 2008-2012, 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.
View
60 java/attributes/default.rb
@@ -0,0 +1,60 @@
+#
+# Author:: Seth Chisamore (<schisamo@opscode.com>)
+# Cookbook Name:: java
+# Attributes:: 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.
+
+# remove the deprecated Ubuntu jdk packages
+default['java']['remove_deprecated_packages'] = false
+
+# default jdk attributes
+default['java']['install_flavor'] = "openjdk"
+default['java']['jdk_version'] = '6'
+default['java']['arch'] = kernel['machine'] =~ /x86_64/ ? "x86_64" : "i586"
+
+case platform
+when "centos","redhat","fedora","scientific","amazon"
+ default['java']['java_home'] = "/usr/lib/jvm/java"
+when "freebsd"
+ default['java']['java_home'] = "/usr/local/openjdk#{java['jdk_version']}"
+when "arch"
+ default['java']['java_home'] = "/usr/lib/jvm/java-#{java['jdk_version']}-openjdk"
+else
+ default['java']['java_home'] = "/usr/lib/jvm/default-java"
+end
+
+# If you change this to true, you can download directly from Oracle
+default['java']['oracle']['accept_oracle_download_terms'] = false
+
+# direct download paths for oracle, u been warned!
+
+# jdk6 attributes
+# x86_64
+default['java']['jdk']['6']['x86_64']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/6u33-b04/jdk-6u33-linux-x64.bin'
+default['java']['jdk']['6']['x86_64']['checksum'] = '215e38e49f7b1b8f0b66383598a51125dbaf04dbcc79de14732406df5e342fb9'
+
+# i586
+default['java']['jdk']['6']['i586']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/6u33-b04/jdk-6u33-linux-i586.bin'
+default['java']['jdk']['6']['i586']['checksum'] = 'bfb8f04ea18eb39a0e476b400a506d2614a3ce258d09a87d25e401e0f9b4d940'
+
+# jdk7 attributes
+# x86_64
+default['java']['jdk']['7']['x86_64']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/7u5-b06/jdk-7u5-linux-x64.tar.gz'
+default['java']['jdk']['7']['x86_64']['checksum'] = 'aaf0296f08007cb178ff45dea61125aedb8af0450f82e0f2fd51df5391c9e837'
+
+# i586
+default['java']['jdk']['7']['i586']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/7u5-b06/jdk-7u5-linux-i586.tar.gz'
+default['java']['jdk']['7']['i586']['checksum'] = '422dfe67a4885d47c0053b97f4a56fb4dced60799a1bb82f8266b0745a7149f7'
View
25 java/files/default/tests/minitest/openjdk_test.rb
@@ -0,0 +1,25 @@
+require 'minitest/spec'
+require 'open3'
+
+describe_recipe 'java::openjdk' do
+
+
+ include MiniTest::Chef::Assertions
+ include MiniTest::Chef::Context
+ include MiniTest::Chef::Resources
+
+ it "installs the correct version of the jdk" do
+ stdin,stdout,stderr = Open3.popen3( "java -version" )
+ version_line = stderr.readline
+ jdk_version = version_line.scan(/\.([678])\./)[0][0]
+ assert_equal node['java']['jdk_version'], jdk_version
+ end
+
+ it "properly sets JAVA_HOME environment variable" do
+ stdin,stdout,stderr = Open3.popen3( "echo $JAVA_HOME" )
+ java_home = stdout.readline.rstrip
+ assert_equal node['java']['java_home'], java_home
+ end
+
+end
+
View
24 java/files/default/tests/minitest/oracle_test.rb
@@ -0,0 +1,24 @@
+require 'minitest/spec'
+require 'open3'
+
+describe_recipe 'java::oracle' do
+
+
+ include MiniTest::Chef::Assertions
+ include MiniTest::Chef::Context
+ include MiniTest::Chef::Resources
+
+ it "installs the correct version of the jdk" do
+ stdin,stdout,stderr = Open3.popen3( "java -version" )
+ version_line = stderr.readline
+ jdk_version = version_line.scan(/\.([678])\./)[0][0]
+ assert_equal node['java']['jdk_version'], jdk_version
+ end
+
+ it "properly sets JAVA_HOME environment variable" do
+ stdin,stdout,stderr = Open3.popen3( "echo $JAVA_HOME" )
+ java_home = stdout.readline.rstrip
+ assert_equal node['java']['java_home'], java_home
+ end
+
+end
View
42 java/metadata.json
@@ -0,0 +1,42 @@
+{
+ "name": "java",
+ "description": "Installs Java runtime.",
+ "long_description": "Description\n===========\n\nInstalls a Java. Uses OpenJDK by default but supports installation of Oracle's JDK.\n\nThis cookbook contains the `java_ark` LWPR which has been deprecated\nin favor of [ark](https://github.com/opscode-cookbooks/ark).\n\n**IMPORTANT NOTE**\n\nAs of 26 March 2012 you can no longer directly download\nthe JDK from Oracle's website without using a special cookie. This cookbook uses\nthat cookie to download the oracle recipe on your behalf, but . . .\n\nthe java::oracle recipe forces you to set either override\nthe `node['java']['oracle']['accept_oracle_download_terms']` to true or set up a\nprivate repository accessible by HTTP.\n\nExample\n\n### override the `accept_oracle_download_terms`\n\nroles/base.rb\nThis cookbook also provides the `java_ark` LWRP which other java\ncookbooks can use to install java-related applications from binary\npackages.\n\n default_attributes(\n :java => {\n :oracle => {\n \"accept_oracle_download_terms\" => true\n }\n }\n )\n\nYou are most encouraged to voice your complaints to Oracle and/or\nswitch to OpenJDK.\n\nRequirements\n============\n\nPlatform\n--------\n\n* Debian, Ubuntu\n* CentOS, Red Hat, Fedora, Scientific, Amazon\n* ArchLinux\n* FreeBSD\n\nAttributes\n==========\n\nSee `attributes/default.rb` for default values.\n\n* `node[\"java\"][\"install_flavor\"]` - Flavor of JVM you would like installed (`oracle` or\n`openjdk`), default `openjdk`.\n* `node['java']['java_home']` - Default location of the \"`$JAVA_HOME`\".\n* `node['java']['tarball']` - Name of the tarball to retrieve from your corporate\nrepository default `jdk1.6.0_29_i386.tar.gz`\n* `node['java']['tarball_checksum']` - Checksum for the tarball, if you use a different\ntarball, you also need to create a new sha256 checksum\n* `node['java']['jdk']` - Version and architecture specific attributes for setting the\nURL on Oracle's site for the JDK, and the checksum of the .tar.gz.\n* `node['java']['remove_deprecated_packages']` - Removes the now deprecated Ubuntu JDK\npackages from the system, default `false`\n* `node['java']['oracle']['accept_oracle_download_terms']` - Indicates that you accept\n Oracle's EULA\n\nRecipes\n=======\n\ndefault\n-------\n\nInclude the default recipe in a run list, to get `java`. By default\nthe `openjdk` flavor of Java is installed, but this can be changed by\nusing the `install_flavor` attribute.\n\nOpenJDK is the default because of licensing changes made upstream by\nOracle. See notes on the `oracle` recipe below.\n\nopenjdk\n-------\n\nThis recipe installs the `openjdk` flavor of Java.\n\noracle\n------\n\nThis recipe installs the `oracle` flavor of Java. This recipe does not\nuse distribution packages as Oracle changed the licensing terms with\nJDK 1.6u27 and prohibited the practice for both the debian and EL worlds.\n\nFor both debian and centos/rhel, this recipe pulls the binary\ndistribution from the Oracle website, and installs it in the default\nJAVA_HOME for each distribution. For debian/ubuntu, this is\n/usr/lib/jvm/default-java. For Centos/RHEL, this is /usr/lib/jvm/java\n\nAfter putting the binaries in place, the oracle recipe updates\n/usr/bin/java to point to the installed JDK using the\n`update-alternatives` script\n\noracle_i386\n-----------\n\nThis recipe installs the 32-bit Java virtual machine without setting\nit as the default. This can be useful if you have applications on the\nsame machine that require different versions of the JVM.\n\nResources/Providers\n===================\n\nThis cookbook contains the `java_ark` LWPR which has been deprecated\nin favor of [ark](https://github.com/opscode-cookbooks/ark).\n\nBy default, the extracted directory is extracted to\n`app_root/extracted_dir_name` and symlinked to `app_root/default`\n\n# Actions\n\n- `:install`: extracts the tarball and makes necessary symlinks\n- `:remove`: removes the tarball and run update-alternatives for all\n symlinked `bin_cmds`\n\n# Attribute Parameters\n\n- `url`: path to tarball, .tar.gz, .bin (oracle-specific), and .zip\n currently supported\n- `checksum`: sha256 checksum, not used for security but avoid\n redownloading the archive on each chef-client run\n- `app_home`: the default for installations of this type of\n application, for example, `/usr/lib/tomcat/default`. If your\n application is not set to the default, it will be placed at the same\n level in the directory hierarchy but the directory name will be\n `app_root/extracted_directory_name + \"_alt\"`\n- `app_home_mode`: file mode for app_home, is an integer\n- `bin_cmds`: array of binary commands that should be symlinked to\n /usr/bin, examples are mvn, java, javac, etc. These cmds must be in\n the bin/ subdirectory of the extracted folder. Will be ignored if this\n java_ark is not the default\n- `owner`: owner of extracted directory, set to \"root\" by default\n- `default`: whether this the default installation of this package,\n boolean true or false\n\n\n# Examples\n\n # install jdk6 from Oracle\n java_ark \"jdk\" do\n url 'http://download.oracle.com/otn-pub/java/jdk/6u29-b11/jdk-6u29-linux-x64.bin'\n checksum 'a8603fa62045ce2164b26f7c04859cd548ffe0e33bfc979d9fa73df42e3b3365'\n app_home '/usr/local/java/default'\n bin_cmds [\"java\", \"javac\"]\n action :install\n end\n\n\nUsage\n=====\n\nSimply include the `java` recipe where ever you would like Java installed.\n\nTo install Oracle flavored Java on Debian or Ubuntu override the `node['java']['install_flavor']` attribute with in role:\n\n name \"java\"\n description \"Install Oracle Java on Ubuntu\"\n override_attributes(\n \"java\" => {\n \"install_flavor\" => \"oracle\"\n }\n )\n run_list(\n \"recipe[java]\"\n )\n\nDevelopment\n===========\n\nThis cookbook uses\n[test-kitchen](https://github.com/opscode/test-kitchen) for\nintegration tests. Pull requests should pass existing tests in\nfiles/default/tests/minitest-handler. Additional tests are always welcome.\n\nLicense and Author\n==================\n\nAuthor:: Seth Chisamore (<schisamo@opscode.com>)\nAuthor:: Bryan W. Berry (<bryan.berry@gmail.com>)\n\nCopyright:: 2008-2012, 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",
+ "maintainer": "Opscode, Inc.",
+ "maintainer_email": "cookbooks@opscode.com",
+ "license": "Apache 2.0",
+ "platforms": {
+ "debian": ">= 0.0.0",
+ "ubuntu": ">= 0.0.0",
+ "centos": ">= 0.0.0",
+ "redhat": ">= 0.0.0",
+ "scientific": ">= 0.0.0",
+ "fedora": ">= 0.0.0",
+ "amazon": ">= 0.0.0",
+ "arch": ">= 0.0.0",
+ "freebsd": ">= 0.0.0"
+ },
+ "dependencies": {
+ },
+ "recommendations": {
+ },
+ "suggestions": {
+ },
+ "conflicting": {
+ },
+ "providing": {
+ },
+ "replacing": {
+ },
+ "attributes": {
+ },
+ "groupings": {
+ },
+ "recipes": {
+ "java": "Installs Java runtime",
+ "java::openjdk": "Installs the OpenJDK flavor of Java",
+ "java::oracle": "Installs the Oracle flavor of Java",
+ "java::oracle_i386": "Installs the 32-bit jvm without setting it as the default"
+ },
+ "version": "1.6.0"
+}
View
16 java/metadata.rb
@@ -0,0 +1,16 @@
+maintainer "Opscode, Inc."
+maintainer_email "cookbooks@opscode.com"
+license "Apache 2.0"
+description "Installs Java runtime."
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version "1.6.0"
+
+recipe "java", "Installs Java runtime"
+recipe "java::openjdk", "Installs the OpenJDK flavor of Java"
+recipe "java::oracle", "Installs the Oracle flavor of Java"
+recipe "java::oracle_i386", "Installs the 32-bit jvm without setting it as the default"
+
+
+%w{ debian ubuntu centos redhat scientific fedora amazon arch freebsd }.each do |os|
+ supports os
+end
View
199 java/providers/ark.rb
@@ -0,0 +1,199 @@
+#
+# Author:: Bryan W. Berry (<bryan.berry@gmail.com>)
+# Cookbook Name:: java
+# Provider:: ark
+#