diff --git a/recipes/pip.rb b/recipes/pip.rb index 17110fa..cf9f4cf 100644 --- a/recipes/pip.rb +++ b/recipes/pip.rb @@ -29,22 +29,30 @@ pip_binary = "/usr/bin/pip" elsif platform_family?("smartos") pip_binary = "/opt/local/bin/pip" +elsif platform_family?("debian") + pip_binary = "/usr/bin/pip" else pip_binary = "/usr/local/bin/pip" end -cookbook_file "#{Chef::Config[:file_cache_path]}/get-pip.py" do - source 'get-pip.py' - mode "0644" - not_if { ::File.exists?(pip_binary) } -end +if node['python']['pip_install_method'] == 'package' + package "python-pip" do + action :install + end +else + cookbook_file "#{Chef::Config[:file_cache_path]}/get-pip.py" do + source 'get-pip.py' + mode "0644" + not_if { ::File.exists?(pip_binary) } + end -execute "install-pip" do - cwd Chef::Config[:file_cache_path] - command <<-EOF - #{node['python']['binary']} get-pip.py - EOF - not_if { ::File.exists?(pip_binary) } + execute "install-pip" do + cwd Chef::Config[:file_cache_path] + command <<-EOF + #{node['python']['binary']} get-pip.py + EOF + not_if { ::File.exists?(pip_binary) } + end end python_pip 'setuptools' do