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

# My god! 20,000 files?!
# TODO trim that a bit? Seems crazy.

class Jruby <Formula
  @url='http://dist.codehaus.org/jruby/1.3.1/jruby-src-1.3.1.tar.gz'
  @homepage='http://jruby.org/'
  @md5='c7e2aa4a3065db445a8b3e17ecff9fe0'

  def install
    system "ant"

    Dir.chdir 'bin' do
      FileUtils.rm Dir['*.bat']
      Dir['*'].each do |file|
        FileUtils.mv file, "j#{file}" unless file.match /^[j_]/
      end
    end
    
    # Only keep the MacOSX native libraries
    Dir.chdir 'lib/native' do
      Dir['*'].each do |file|
        FileUtils.rm_f file unless file == 'darwin'
      end
    end

    prefix.install Dir['*']
  end
end