Skip to content

Commit

Permalink
add setup_py_install and setup_py_build actions
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwb authored and jtimberman committed Nov 8, 2012
1 parent 25d35c5 commit a4db153
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
26 changes: 23 additions & 3 deletions libraries/provider_ark.rb
Expand Up @@ -109,16 +109,36 @@ def action_install_with_make
end
end

# needs a test, start here http://guide.python-distribute.org/quickstart.html
def action_setup_py

#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
b = Chef::Resource::Script::Bash.new("setup.py", run_context)
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)
Expand Down
2 changes: 1 addition & 1 deletion libraries/resource_ark.rb
Expand Up @@ -27,7 +27,7 @@ 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)
@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
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Expand Up @@ -3,7 +3,7 @@
license "Apache 2.0"
description "Installs/Configures ark"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.13"
version "0.0.14"

%w{ debian ubuntu centos redhat fedora }.each do |os|
supports os
Expand Down

0 comments on commit a4db153

Please sign in to comment.