aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/jetty.rb
blob: c80e7bcd39084b0f3bd81f6b175c0f3be339d567 (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
require 'formula'

class Jetty < Formula
  homepage 'http://www.eclipse.org/jetty/'
  url 'http://eclipse.org/downloads/download.php?file=/jetty/8.1.8.v20121106/dist/jetty-distribution-8.1.8.v20121106.tar.gz&r=1'
  version '8.1.8'
  sha1 '19f6c1758d5b6d73702c08574062b63195a404b5'

  devel do
    url 'http://eclipse.org/downloads/download.php?file=/jetty/9.0.0.M4/dist/jetty-distribution-9.0.0.M4.tar.gz&r=1'
    version '9.0.0.M4'
    sha1 '98c4463b9fe1559e4e85cf75def5a21d2feef9e7'
  end

  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