blob: bc7f453454a3d41c4fcaebe7808e280a27f419e9 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
 | require 'formula'
class H2 < Formula
  homepage 'http://www.h2database.com/'
  url 'http://www.h2database.com/h2-2015-03-02.zip'
  version '1.4.186'
  sha1 '39906db100cbef8c36973689906c9fa0c1440721'
  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
    chmod 0755, "bin/h2.sh"
    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>
            <string>#{opt_bin}/h2</string>
            <string>-tcp</string>
            <string>-web</string>
            <string>-pg</string>
        </array>
        <key>WorkingDirectory</key>
        <string>#{HOMEBREW_PREFIX}</string>
      </dict>
    </plist>
    EOS
  end
end
 |