aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/bigdata.rb
blob: d121dc34eb02dbeb11c4938936794a42a150cb95 (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
class Bigdata < Formula
  homepage "http://www.blazegraph.com/bigdata"
  url "https://downloads.sourceforge.net/project/bigdata/bigdata/1.5.1/bigdata-bundled.jar"
  sha256 "092ecfb1293de27ef40c02795a34ac410e30d175623a342b27271952f01c1f1a"
  version "1.5.1"

  depends_on :java => "1.7+"

  def install
    libexec.install "bigdata-bundled.jar"
    bin.write_jar_script libexec/"bigdata-bundled.jar", "bigdata"
  end

  plist_options :startup => "true", :manual => "bigdata start"

  def plist; <<-EOS.undent
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//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>Program</key>
        <string>#{bin}/bigdata</string>
        <key>RunAtLoad</key>
        <true/>
        <key>WorkingDirectory</key>
        <string>#{prefix}</string>
      </dict>
    </plist>
    EOS
  end

  test do
    server = fork do
      system bin/"bigdata"
    end
    sleep 5
    Process.kill("TERM", server)
    File.exist? "bigdata.jnl"
    File.exist? "rules.log"
  end
end