File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1919#
2020
2121default [ 'python' ] [ 'install_method' ] = 'package'
22- default [ 'python' ] [ 'prefix_dir' ] = '/usr/local'
22+
23+ if python [ 'install_method' ] == 'package'
24+ default [ 'python' ] [ 'prefix_dir' ] = '/usr'
25+ else
26+ default [ 'python' ] [ 'prefix_dir' ] = '/usr/local'
27+ end
28+
2329default [ 'python' ] [ 'url' ] = 'http://www.python.org/ftp/python'
2430default [ 'python' ] [ 'version' ] = '2.7.1'
2531default [ 'python' ] [ 'checksum' ] = '80e387bcf57eae8ce26726753584fd63e060ec11682d1145af921e85fd612292'
2632default [ 'python' ] [ 'configure_options' ] = %W{ --prefix=#{ python [ 'prefix_dir' ] } }
33+
34+ default [ 'python' ] [ 'pip' ] [ 'prefix_dir' ] = '/usr/local'
Original file line number Diff line number Diff line change 1818# limitations under the License.
1919#
2020
21- python_bindir = "#{ node [ 'python' ] [ 'prefix_dir' ] } /bin/"
21+ python_bindir = "#{ node [ 'python' ] [ 'prefix_dir' ] } /bin"
22+ pip_bindir = "#{ node [ 'python' ] [ 'pip' ] [ 'prefix_dir' ] } /bin"
2223
2324# Ubuntu's python-setuptools, python-pip and python-virtualenv packages
2425# are broken...this feels like Rubygems!
2728remote_file "#{ Chef ::Config [ :file_cache_path ] } /distribute_setup.py" do
2829 source "http://python-distribute.org/distribute_setup.py"
2930 mode "0644"
30- not_if { ::File . exists? ( python_bindir + ' pip' ) }
31+ not_if { ::File . exists? ( " #{ pip_bindir } / pip" ) }
3132end
3233
3334bash "install-pip" do
3435 cwd Chef ::Config [ :file_cache_path ]
3536 code <<-EOF
36- #{ python_bindir } python distribute_setup.py
37- #{ python_bindir } easy_install pip
37+ #{ python_bindir } / python distribute_setup.py
38+ #{ pip_bindir } / easy_install pip
3839 EOF
39- not_if { ::File . exists? ( python_bindir + ' pip' ) }
40+ not_if { ::File . exists? ( " #{ pip_bindir } / pip" ) }
4041end
You can’t perform that action at this time.
0 commit comments