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

SOLR_START_SCRIPT = <<-end_script
#!/bin/sh
if [ -z "$1" ]; then
  echo "Usage: $ solr path/to/config/dir"
else 
  cd %s/example && java -Dsolr.solr.home=$1 -jar start.jar
fi
end_script

class Solr <Formula
  url 'http://apache.deathculture.net/lucene/solr/1.4.1/apache-solr-1.4.1.tgz'
  homepage 'http://lucene.apache.org/solr/'
  md5 '258a020ed8c3f44e13b09e8ae46a1c84'

  def install
    prefix.mkpath
    prefix.install Dir['*']
    (bin+'solr').write(SOLR_START_SCRIPT % prefix)
  end

  def caveats
    <<-END_CAVEATS
To start solr: 
    $ solr path/to/solr/config/dir

See the solr homepage for more setup information:
    $ brew home solr

    END_CAVEATS
  end
end