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 Label gitbucket ProgramArguments /usr/bin/java -Dmail.smtp.starttls.enable=true -jar #{opt_libexec}/gitbucket.war --host=127.0.0.1 --port=8080 RunAtLoad 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