homebrew-core/Formula/gitbucket.rb
2015-10-06 20:37:18 +01:00

65 lines
1.9 KiB
Ruby

class Gitbucket < Formula
desc "GitHub clone"
homepage "https://github.com/takezoe/gitbucket"
url "https://github.com/takezoe/gitbucket/releases/download/3.7/gitbucket.war"
sha256 "4de0834506486f772b81cba53c69639b223d3516274f696ec21429a25cf80db7"
bottle do
cellar :any_skip_relocation
sha256 "ac0d9b0b78279918fbd30b39c999aa8dba0f461791261325133f07c00528cd48" => :el_capitan
sha256 "3b8b1b681bf59e5939ffd5e8afec5f4cdf710ecab065e75616fdf710e4bf8818" => :yosemite
sha256 "b54d0e3c3dad7506cd3547facb4dda5982d0a9b7e0a409015cb6ef888d8ae2bd" => :mavericks
end
head do
url "https://github.com/takezoe/gitbucket.git"
depends_on :ant => :build
end
def install
if build.head?
system "ant"
libexec.install "war/target/gitbucket.war", "."
else
libexec.install "gitbucket.war"
end
end
plist_options :manual => "java -jar #{HOMEBREW_PREFIX}/opt/gitbucket/libexec/gitbucket.war"
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>gitbucket</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-Dmail.smtp.starttls.enable=true</string>
<string>-jar</string>
<string>#{opt_libexec}/gitbucket.war</string>
<string>--host=127.0.0.1</string>
<string>--port=8080</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
def caveats; <<-EOS.undent
Note: When using launchctl the port will be 8080.
EOS
end
test do
io = IO.popen("java -jar #{libexec}/gitbucket.war")
sleep 12
Process.kill("SIGINT", io.pid)
Process.wait(io.pid)
io.read !~ /Exception/
end
end