Skip to content
Browse files

Install s3cmd from source so that we aren't bound to whatever comes w…

…ith a given linux distribution.
  • Loading branch information...
1 parent 24a306e commit 75ff7411cdc702cda19b261fe4f0a0f60b6f015f @freerobby committed Jul 18, 2012
Showing with 26 additions and 7 deletions.
  1. +4 −0 attributes/default.rb
  2. +22 −7 recipes/default.rb
View
4 attributes/default.rb
@@ -4,3 +4,7 @@
# S3 credentials
default[:s3cmd][:aws_access_key_id] = ""
default[:s3cmd][:aws_secret_access_key] = ""
+
+default[:s3cmd][:version] = "v1.1.0-beta3"
+default[:s3cmd][:user] = "root"
+default[:s3cmd][:install_prefix_root] = "/usr/local"
View
29 recipes/default.rb
@@ -3,21 +3,36 @@
# Recipe:: default
#
-#install s3cmd
-package "s3cmd" do
- action :upgrade
+package "git"
+package "python-setuptools"
+
+git "#{node[:s3cmd][:install_prefix_root]}/share/s3cmd" do
+ repository "git://github.com/s3tools/s3cmd.git"
+ reference node[:s3cmd][:version]
+ action :sync
+end
+
+execute "build_s3cmd" do
+ user node[:s3cmd][:user]
+ cwd "#{node[:s3cmd][:install_prefix_root]}/share/s3cmd"
+ command "python setup.py install"
+ action :run
end
+# Link the binary to the one we built
+link "#{node[:s3cmd][:install_prefix_root]}/bin/s3cmd" do
+ to "#{node[:s3cmd][:install_prefix_root]}/share/s3cmd/s3cmd"
+ action :create
+end
#deploy configuration for each user. Change s3cfg.erb template in your site cookbook to set
#you access key and secret.
-node[:s3cmd][:users].each do |user|
-
+node[:s3cmd][:users].each do |user|
home = user.to_s == :root.to_s ? "/root" : "/home/#{user}"
template "s3cfg" do
path "#{home}/.s3cfg"
source "s3cfg.erb"
mode 0655
- end
-end
+ end
+end

0 comments on commit 75ff741

Please sign in to comment.
Something went wrong with that request. Please try again.