File tree 2 files changed +15
-6
lines changed
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 19
19
#
20
20
21
21
default [ '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
+
23
29
default [ 'python' ] [ 'url' ] = 'http://www.python.org/ftp/python'
24
30
default [ 'python' ] [ 'version' ] = '2.7.1'
25
31
default [ 'python' ] [ 'checksum' ] = '80e387bcf57eae8ce26726753584fd63e060ec11682d1145af921e85fd612292'
26
32
default [ '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 18
18
# limitations under the License.
19
19
#
20
20
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"
22
23
23
24
# Ubuntu's python-setuptools, python-pip and python-virtualenv packages
24
25
# are broken...this feels like Rubygems!
27
28
remote_file "#{ Chef ::Config [ :file_cache_path ] } /distribute_setup.py" do
28
29
source "http://python-distribute.org/distribute_setup.py"
29
30
mode "0644"
30
- not_if { ::File . exists? ( python_bindir + ' pip' ) }
31
+ not_if { ::File . exists? ( " #{ pip_bindir } / pip" ) }
31
32
end
32
33
33
34
bash "install-pip" do
34
35
cwd Chef ::Config [ :file_cache_path ]
35
36
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
38
39
EOF
39
- not_if { ::File . exists? ( python_bindir + ' pip' ) }
40
+ not_if { ::File . exists? ( " #{ pip_bindir } / pip" ) }
40
41
end
You can’t perform that action at this time.
0 commit comments