-
Notifications
You must be signed in to change notification settings - Fork 0
/
clickhouse.rb
69 lines (60 loc) · 2.2 KB
/
clickhouse.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
class Clickhouse < Formula
desc "ClickHouse is a free analytic DBMS for big data."
homepage "https://clickhouse.yandex"
url "https://github.com/yandex/ClickHouse.git", :tag => "v18.14.18-stable"
version "18.14.18"
head "https://github.com/yandex/ClickHouse.git"
depends_on "gcc"
depends_on "cmake" => :build
def install
args = %W[
-DCMAKE_CXX_COMPILER=`which g++-8`
-DCMAKE_C_COMPILER=`which gcc-8`
]
mkdir "build" do
system "cmake", "..", *std_cmake_args, *args
system "make"
end
bin.install "#{buildpath}/build/dbms/programs/clickhouse"
bin.install_symlink "clickhouse" => "clickhouse-client"
bin.install_symlink "clickhouse" => "clickhouse-server"
bin.install_symlink "clickhouse" => "clickhouse-local"
bin.install_symlink "clickhouse" => "clickhouse-compressor"
bin.install_symlink "clickhouse" => "clickhouse-copier"
bin.install_symlink "clickhouse" => "clickhouse-format"
bin.install_symlink "clickhouse" => "clickhouse-lld"
bin.install_symlink "clickhouse" => "clickhouse-obfuscator"
bin.install_symlink "clickhouse" => "clickhouse-clang"
mkdir "#{etc}/clickhouse-client/"
(etc/"clickhouse-client").install "#{buildpath}/dbms/programs/client/clickhouse-client.xml"
mkdir "#{etc}/clickhouse-server/"
(etc/"clickhouse-server").install "#{buildpath}/dbms/programs/server/config.xml"
(etc/"clickhouse-server").install "#{buildpath}/dbms/programs/server/users.xml"
end
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>#{opt_bin}/clickhouse-server</string>
<string>--config-file</string>
<string>#{etc}/clickhouse-server/config.xml</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
test do
system "#{bin}/clickhouse-client", "--version"
end
end