-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathreindexer.rb
77 lines (68 loc) · 2.31 KB
/
reindexer.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
70
71
72
73
74
75
76
77
class Reindexer < Formula
env :std
desc "is a fast document-oriented in-memory database."
homepage "https://github.com/restream/reindexer"
url "https://github.com/Restream/reindexer/archive/v3.31.0.zip"
version "3.31.0"
sha256 "571f5741574df37cd3d89e822f891119cb795060d34e457fffd2cb14a98a2d45"
head "https://github.com/restream/reindexer.git"
depends_on "cmake" => :build
depends_on "leveldb"
service do
name macos: "#{plist_name}"
end
def install
mkdir "build"
cd "build" do
system "cmake", "-DCMAKE_INSTALL_PREFIX=#{prefix}", ".."
system "make", "-j8", "reindexer_server", "reindexer_tool", "install"
end
mkdir "#{var}/reindexer"
mkdir "#{var}/log/reindexer"
inreplace "#{buildpath}/build/cpp_src/cmd/reindexer_server/contrib/config.yml" do |s|
s.gsub! "/var/lib/reindexer", "#{var}/reindexer"
s.gsub! "/var/log/reindexer", "#{var}/log/reindexer"
s.gsub! "user:", "# user:"
end
# Copy configuration files
etc.install "#{buildpath}/build/cpp_src/cmd/reindexer_server/contrib/config.yml" => "reindexer.conf"
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}/reindexer_server</string>
<string>--config</string>
<string>#{etc}/reindexer.conf</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/reindexer/reindexer.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/reindexer/reindexer.log</string>
</dict>
</plist>
EOS
end
#bottle do
#root_url "http://repo.reindexer.org/brew-bottles"
#sha256 cellar: :any, mojave: "bf2988d1c728640b77e48d05c8187a733ce311c9571703254f5bd4ed46fb3158"
#end
def caveats; <<-EOS
The configuration file is available at:
#{etc}/reindexer.conf
The database itself will store data at:
#{var}/reindexer/
EOS
end
end