aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorelliottcable2009-09-20 23:43:18 -0800
committerelliottcable2009-09-22 13:15:15 -0800
commiteaa86409d9fe46e6236a760af849f148ecca8163 (patch)
tree988e7227ed906de2cb970aa1af63a95cb23dc3d6
parentd7c3954e30a377c2473fc2ec2c3bab6e501c6d2b (diff)
downloadhomebrew-eaa86409d9fe46e6236a760af849f148ecca8163.tar.bz2
Added a Formula to install the EC2 API tools.
Unfortunately, dealing with them requires quite a bit of shell configuration. I offered the best documentation of this configuration that I could, but it’s fairly verbose and a bit repulsive… unfortunately, the other option (attempting to preform the setup automatically) turns out to be even messier, and prone to mistakes to boot.
-rw-r--r--Library/Formula/ec2-api-tools.rb47
1 files changed, 47 insertions, 0 deletions
diff --git a/Library/Formula/ec2-api-tools.rb b/Library/Formula/ec2-api-tools.rb
new file mode 100644
index 000000000..c5d6ceab8
--- /dev/null
+++ b/Library/Formula/ec2-api-tools.rb
@@ -0,0 +1,47 @@
+require 'brewkit'
+
+class Ec2ApiTools <Formula
+ @homepage='http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351'
+ @url='http://ec2-downloads.s3.amazonaws.com/ec2-api-tools-1.3-41620.zip'
+ @md5='14734acff6ac8f6899de0398d3eeb0f6'
+ @version='1.3-41620'
+
+ def install
+ # Nothing to be done but copying things into place
+ FileUtils.rm Dir['bin/*\.cmd']
+
+ (prefix+bin).install Dir['bin/ec2-*']
+ prefix.install 'lib'
+ end
+
+ def caveats
+ puts <<-EOS
+==============================================================================
+Before you can utilize the EC2 API tools, you must export several environment
+variables to your $SHELL. The easiest way to do this is to add them to your
+dotfiles. If you’re running the `bash` shell (the default), you’ll want to add
+them to `~/.bash_profile`. If this is the case, run `nano ~/.bash_profile` at
+a terminal to edit said file. zsh users will want to edit `~/.zprofile`
+instead.
+
+ export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home/"
+ export EC2_HOME="#{prefix.to_s}/"
+
+However, you’re still not ready to use the tools. You need to download your
+X.509 certificate and private key from Amazon Web Services. These files are
+available at the following URL:
+
+http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key
+
+You should download two `.pem` files, one starting with `pk-`, and one
+starting with `cert-`. You need to put both into a folder in your home
+directory, `~/.ec2`, and then add the following to your profile file:
+
+ export EC2_PRIVATE_KEY="$(/bin/ls $HOME/.ec2/pk-*.pem)"
+ export EC2_CERT="$(/bin/ls $HOME/.ec2/cert-*.pem)"
+
+==============================================================================
+ EOS
+ end
+
+end