diff options
| author | Joshua Griffith | 2014-03-04 16:54:29 -0600 |
|---|---|---|
| committer | Mike McQuaid | 2014-03-19 14:52:42 +0000 |
| commit | 6aeee3ef702224d4fe1e2513a68ccd523247e47c (patch) | |
| tree | 6b569ec2aa1a2d789398960c011a28289104d7a9 /Library/Formula | |
| parent | 22be6bec5d6203d79aad975312e2a5c6de8fd335 (diff) | |
| download | homebrew-6aeee3ef702224d4fe1e2513a68ccd523247e47c.tar.bz2 | |
kafka 0.8.1 (new formula)
Closes #27511.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/kafka.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Library/Formula/kafka.rb b/Library/Formula/kafka.rb new file mode 100644 index 000000000..943387d29 --- /dev/null +++ b/Library/Formula/kafka.rb @@ -0,0 +1,44 @@ +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.1/kafka-0.8.1-src.tgz" + mirror "http://mirror.sdunix.com/apache/kafka/0.8.1/kafka-0.8.1-src.tgz" + sha1 "af88a986ef711f5fd30063a9cb3395e63884bf0b" + + depends_on "zookeeper" + + def install + system "./gradlew", "jar" + + # Use 1 partition by default so individual consumers receive all topic messages + inreplace "config/server.properties", "num.partitions=2", "num.partitions=1" + + 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" + + libexec.install %w(contrib core examples lib perf 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 |
