require 'formula' class Jetty < Formula homepage 'http://www.eclipse.org/jetty/' url 'http://eclipse.org/downloads/download.php?file=/jetty/9.0.3.v20130506/dist/jetty-distribution-9.0.3.v20130506.tar.gz&r=1' version '9.0.3' sha1 'aa91d5629c325e6fc87bf562c480d04ed36d8783' def install rm_rf Dir['bin/*.{cmd,bat]}'] libexec.install Dir['*'] (libexec+'logs').mkpath bin.mkpath Dir["#{libexec}/bin/*.sh"].each 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 end