2010-04-21 08:45:34 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 18:09:03 +00:00
|
|
|
class Cassandra < Formula
|
2011-04-29 13:48:46 +00:00
|
|
|
url 'http://www.mirrorservice.org/sites/ftp.apache.org//cassandra/0.7.5/apache-cassandra-0.7.5-bin.tar.gz'
|
2010-04-21 08:45:34 +00:00
|
|
|
homepage 'http://cassandra.apache.org'
|
2011-04-29 13:48:46 +00:00
|
|
|
md5 '3a74739c1eb277c23b40302cc5a149bc'
|
2010-04-21 08:45:34 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
(var+"lib/cassandra").mkpath
|
|
|
|
(var+"log/cassandra").mkpath
|
|
|
|
(etc+"cassandra").mkpath
|
|
|
|
|
2011-01-28 15:24:54 +00:00
|
|
|
inreplace "conf/cassandra.yaml", "/var/lib/cassandra", "#{var}/lib/cassandra"
|
|
|
|
inreplace "conf/log4j-server.properties", "/var/log/cassandra", "#{var}/log/cassandra"
|
2010-04-21 08:45:34 +00:00
|
|
|
|
|
|
|
inreplace "bin/cassandra.in.sh" do |s|
|
2011-01-28 15:24:54 +00:00
|
|
|
s.gsub! "CASSANDRA_HOME=`dirname $0`/..", "CASSANDRA_HOME=#{prefix}"
|
2010-04-21 08:45:34 +00:00
|
|
|
# Store configs in etc, outside of keg
|
2011-01-28 15:24:54 +00:00
|
|
|
s.gsub! "CASSANDRA_CONF=$CASSANDRA_HOME/conf", "CASSANDRA_CONF=#{etc}/cassandra"
|
2010-04-21 08:45:34 +00:00
|
|
|
# Jars installed to prefix, no longer in a lib folder
|
2011-01-28 15:24:54 +00:00
|
|
|
s.gsub! "$CASSANDRA_HOME/lib/*.jar", "$CASSANDRA_HOME/*.jar"
|
2010-04-21 08:45:34 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
rm Dir["bin/*.bat"]
|
|
|
|
|
|
|
|
(etc+"cassandra").install Dir["conf/*"]
|
|
|
|
prefix.install Dir["*.txt"] + Dir["{bin,interface,javadoc}"]
|
|
|
|
prefix.install Dir["lib/*.jar"]
|
|
|
|
end
|
2010-08-29 13:49:21 +00:00
|
|
|
end
|