homebrew-core/Formula/cassandra.rb
rick d35b51011f cassandra 0.7.5
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
2011-04-29 06:52:52 -07:00

30 lines
1.1 KiB
Ruby

require 'formula'
class Cassandra < Formula
url 'http://www.mirrorservice.org/sites/ftp.apache.org//cassandra/0.7.5/apache-cassandra-0.7.5-bin.tar.gz'
homepage 'http://cassandra.apache.org'
md5 '3a74739c1eb277c23b40302cc5a149bc'
def install
(var+"lib/cassandra").mkpath
(var+"log/cassandra").mkpath
(etc+"cassandra").mkpath
inreplace "conf/cassandra.yaml", "/var/lib/cassandra", "#{var}/lib/cassandra"
inreplace "conf/log4j-server.properties", "/var/log/cassandra", "#{var}/log/cassandra"
inreplace "bin/cassandra.in.sh" do |s|
s.gsub! "CASSANDRA_HOME=`dirname $0`/..", "CASSANDRA_HOME=#{prefix}"
# Store configs in etc, outside of keg
s.gsub! "CASSANDRA_CONF=$CASSANDRA_HOME/conf", "CASSANDRA_CONF=#{etc}/cassandra"
# Jars installed to prefix, no longer in a lib folder
s.gsub! "$CASSANDRA_HOME/lib/*.jar", "$CASSANDRA_HOME/*.jar"
end
rm Dir["bin/*.bat"]
(etc+"cassandra").install Dir["conf/*"]
prefix.install Dir["*.txt"] + Dir["{bin,interface,javadoc}"]
prefix.install Dir["lib/*.jar"]
end
end