Cassandra 2.1

Closes Homebrew/homebrew#32245.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
Alexander Pakulov 2014-09-16 13:48:38 -07:00 committed by Adam Vandenberg
parent f9b1f72df1
commit 8ad9a2800b

View file

@ -2,8 +2,8 @@ require 'formula'
class Cassandra < Formula
homepage 'http://cassandra.apache.org'
url 'http://www.apache.org/dyn/closer.cgi?path=/cassandra/2.0.9/apache-cassandra-2.0.9-bin.tar.gz'
sha1 '49eeb4c1dd518bd9440280a758ad4b129769a78d'
url 'http://www.apache.org/dyn/closer.cgi?path=/cassandra/2.1.0/apache-cassandra-2.1.0-bin.tar.gz'
sha1 '11f0357277526bbf2eb532490cfadb14c1085f9e'
def install
(var+"lib/cassandra").mkpath
@ -11,9 +11,9 @@ class Cassandra < Formula
(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 "conf/cassandra-env.sh", "/lib/", "/"
inreplace "bin/cassandra", "-Dcassandra.logdir\=$CASSANDRA_HOME/logs", "-Dcassandra.logdir\=#{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
@ -22,20 +22,20 @@ class Cassandra < Formula
s.gsub! "\"$CASSANDRA_HOME\"/lib/*.jar", "\"$CASSANDRA_HOME\"/*.jar"
# The jammm Java agent is not in a lib/ subdir either:
s.gsub! "JAVA_AGENT=\"$JAVA_AGENT -javaagent:$CASSANDRA_HOME/lib/jamm-", "JAVA_AGENT=\"$JAVA_AGENT -javaagent:$CASSANDRA_HOME/jamm-"
# Storage path
s.gsub! "cassandra_storagedir\=\"$CASSANDRA_HOME/data\"", "cassandra_storagedir\=\"#{var}/lib/cassandra\""
end
rm Dir["bin/*.bat"]
rm Dir["bin/*.bat", "bin/*.ps1"]
(etc+"cassandra").install Dir["conf/*"]
prefix.install Dir["*.txt", "{bin,interface,javadoc,pylib,lib/licenses}"]
prefix.install Dir["lib/*.jar"]
share.install [bin+'cassandra.in.sh', bin+'stop-server']
inreplace Dir["#{bin}/cassandra*", "#{bin}/debug-cql",
"#{bin}/json2sstable", "#{bin}/nodetool",
"#{bin}/sstable*"],
/`dirname "?\$0"?`\/cassandra.in.sh/,
"#{share}/cassandra.in.sh"
inreplace Dir["#{bin}/cassandra*", "#{bin}/debug-cql", "#{bin}/nodetool", "#{bin}/sstable*"],
/`dirname "?\$0"?`\/cassandra.in.sh/,
"#{share}/cassandra.in.sh"
end
def caveats; <<-EOS.undent