forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kafka080.rb
46 lines (34 loc) · 1.43 KB
/
kafka080.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require "formula"
class Kafka080 < Formula
homepage 'http://kafka.apache.org'
url 'https://archive.apache.org/dist/kafka/0.8.0/kafka-0.8.0-src.tgz'
sha1 '051e72b9ed9c3342c4e1210ffa9a9f4364171f26'
depends_on 'zookeeper'
conflicts_with 'kafka',
:because => 'kafka080 and kafka install the same binaries.'
def install
system "./sbt", "update"
system "./sbt", "package"
system "./sbt", "assembly-package-dependency"
# 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", ".File=logs/", ".File=#{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`")
(etc+"kafka").install Dir["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