homebrew-core/Formula/jetty.rb
Dan 1294ff2fe3 jetty 9.3.7.v20160115
Closes Homebrew/homebrew#48864.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-02-05 14:55:46 +00:00

41 lines
1.1 KiB
Ruby

class Jetty < Formula
desc "Java servlet engine and webserver"
homepage "https://www.eclipse.org/jetty/"
url "http://download.eclipse.org/jetty/9.3.7.v20160115/dist/jetty-distribution-9.3.7.v20160115.tar.gz"
version "9.3.7.v20160115"
sha256 "624990a139ea455587dd681a5c15298e31bf60e6c8e1d742ce8500c8298887c3"
bottle :unneeded
depends_on :java => "1.8+"
def install
libexec.install Dir["*"]
(libexec+"logs").mkpath
bin.mkpath
Dir.glob("#{libexec}/bin/*.sh") do |f|
scriptname = File.basename(f, ".sh")
(bin+scriptname).write <<-EOS.undent
#!/bin/bash
JETTY_HOME=#{libexec}
#{f} "$@"
EOS
chmod 0755, bin+scriptname
end
end
test do
ENV["JETTY_BASE"] = testpath
cp_r Dir[libexec/"*"], testpath
pid = fork { exec bin/"jetty", "start" }
sleep 5 # grace time for server start
begin
assert_match /Jetty running pid=\d+/, shell_output("#{bin}/jetty check")
assert_equal "Stopping Jetty: OK\n", shell_output("#{bin}/jetty stop")
ensure
Process.kill 9, pid
Process.wait pid
end
end
end