2013-10-25 03:49:37 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class H2 < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Java SQL database"
|
2013-10-25 03:49:37 +00:00
|
|
|
homepage 'http://www.h2database.com/'
|
2015-06-14 15:17:49 +00:00
|
|
|
url 'http://www.h2database.com/h2-2015-04-10.zip'
|
|
|
|
version '1.4.187'
|
|
|
|
sha1 '20241dfbe12c1986d46b928f8ca1689b1be1fc97'
|
2013-10-25 03:49:37 +00:00
|
|
|
|
|
|
|
def script; <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
cd #{libexec} && bin/h2.sh "$@"
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
# Remove windows files
|
|
|
|
rm_f Dir["bin/*.bat"]
|
|
|
|
|
|
|
|
# Fix the permissions on the script
|
2014-03-31 17:33:26 +00:00
|
|
|
chmod 0755, "bin/h2.sh"
|
2013-10-25 03:49:37 +00:00
|
|
|
|
|
|
|
libexec.install Dir['*']
|
|
|
|
(bin+'h2').write script
|
|
|
|
end
|
|
|
|
|
|
|
|
plist_options :manual => 'h2'
|
|
|
|
|
|
|
|
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>
|
2014-03-06 05:28:31 +00:00
|
|
|
<string>#{opt_bin}/h2</string>
|
2013-10-25 03:49:37 +00:00
|
|
|
<string>-tcp</string>
|
|
|
|
<string>-web</string>
|
|
|
|
<string>-pg</string>
|
|
|
|
</array>
|
|
|
|
<key>WorkingDirectory</key>
|
|
|
|
<string>#{HOMEBREW_PREFIX}</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|