2013-09-19 16:29:00 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class DynamodbLocal < Formula
|
2013-12-14 11:31:17 +00:00
|
|
|
homepage 'https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html'
|
2014-04-27 03:59:49 +00:00
|
|
|
url 'http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_2014-04-24.tar.gz'
|
|
|
|
version '2014-04-24'
|
|
|
|
sha1 '16e7fcf5b71498d72e093b1fbd6cf17e989bea84'
|
2013-09-19 16:29:00 +00:00
|
|
|
|
|
|
|
def data_path
|
|
|
|
var/'data/dynamodb-local'
|
|
|
|
end
|
|
|
|
|
|
|
|
def log_path
|
|
|
|
var/'log/dynamodb-local.log'
|
|
|
|
end
|
|
|
|
|
|
|
|
def bin_wrapper; <<-EOS.undent
|
|
|
|
#!/bin/sh
|
2014-04-28 21:45:16 +00:00
|
|
|
cd #{data_path} && java -Djava.library.path=#{libexec}/DynamodbLocal_lib -jar #{libexec}/DynamoDBLocal.jar "$@"
|
2013-09-19 16:29:00 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
prefix.install %w[LICENSE.txt README.txt third_party_licenses]
|
2013-12-14 11:31:17 +00:00
|
|
|
libexec.install %w[DynamoDBLocal_lib DynamoDBLocal.jar]
|
2013-09-19 16:29:00 +00:00
|
|
|
(bin/'dynamodb-local').write(bin_wrapper)
|
|
|
|
end
|
|
|
|
|
|
|
|
def post_install
|
|
|
|
data_path.mkpath
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2013-12-14 11:31:17 +00:00
|
|
|
DynamoDB Local supports the Java Runtime Engine (JRE) version 6.x or
|
|
|
|
newer; it will not run on older JRE versions.
|
2013-09-19 16:29:00 +00:00
|
|
|
|
2013-12-14 11:31:17 +00:00
|
|
|
In this release, the local database file format has changed;
|
|
|
|
therefore, DynamoDB Local will not be able to read data files
|
|
|
|
created by older releases.
|
2013-09-19 16:29:00 +00:00
|
|
|
|
|
|
|
Data: #{data_path}
|
|
|
|
Logs: #{log_path}
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
plist_options :manual => "#{HOMEBREW_PREFIX}/bin/dynamodb-local"
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<false/>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>#{bin}/dynamodb-local</string>
|
|
|
|
</array>
|
|
|
|
<key>StandardErrorPath</key>
|
|
|
|
<string>#{log_path}</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|