homebrew-core/Formula/kafka.rb
Mike Clarke 87b0b6ec02 kafka 0.8.2.0
Closes Homebrew/homebrew#36610.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-02-09 12:37:51 +00:00

47 lines
1.5 KiB
Ruby

require "formula"
class Kafka < Formula
homepage "http://kafka.apache.org"
head "http://git-wip-us.apache.org/repos/asf/kafka.git"
url "http://mirrors.ibiblio.org/apache/kafka/0.8.2.0/kafka-0.8.2.0-src.tgz"
mirror "http://mirror.sdunix.com/apache/kafka/0.8.2.0/kafka-0.8.2.0-src.tgz"
sha1 "d2c35b60a2f534fb552030dcc7855d13292b2414"
depends_on "gradle"
depends_on "zookeeper"
depends_on :java => "1.7+"
def install
system "gradle"
system "gradle", "jar"
logs = var/"log/kafka"
inreplace "config/log4j.properties", "kafka.logs.dir=logs", "kafka.logs.dir=#{logs}"
inreplace "config/test-log4j.properties", ".File=logs/", ".File=#{logs}/"
data = var/"lib"
inreplace "config/server.properties",
"log.dirs=/tmp/kafka-logs", "log.dirs=#{data}/kafka-logs"
inreplace "config/zookeeper.properties",
"dataDir=/tmp/zookeeper", "dataDir=#{data}/zookeeper"
# Workaround for conflicting slf4j-log4j12 jars (1.7.6 is preferred)
rm_f "core/build/dependant-libs-2.10.4/slf4j-log4j12-1.6.1.jar"
libexec.install %w(clients contrib core examples system_test)
prefix.install "bin"
bin.env_script_all_files(libexec/"bin", :JAVA_HOME => "`/usr/libexec/java_home`")
mv "config", "kafka"
etc.install "kafka"
libexec.install_symlink etc/"kafka" => "config"
end
def caveats; <<-EOS.undent
To start Kafka, ensure that ZooKeeper is running and then execute:
kafka-server-start.sh #{etc}/kafka/server.properties
EOS
end
end