-
Notifications
You must be signed in to change notification settings - Fork 164
/
Copy pathmongodb-enterprise@6.0.rb
80 lines (67 loc) · 2.14 KB
/
mongodb-enterprise@6.0.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
78
79
80
class MongodbEnterpriseAT60 < Formula
desc "High-performance, schema-free, document-oriented database (Enterprise)"
homepage "https://www.mongodb.com/"
# frozen_string_literal: true
#
if Hardware::CPU.intel?
url "https://downloads.mongodb.com/osx/mongodb-macos-x86_64-enterprise-6.0.20.tgz"
sha256 "5180bf89b10fe09728b69f1eec166f40b29ee87933bb4ceb1e792e008ea5592d"
else
url "https://downloads.mongodb.com/osx/mongodb-macos-arm64-enterprise-6.0.20.tgz"
sha256 "32117ac7a55a52e04b5cdf9d490800ceec43ab149fc77aaa0496116389dc9916"
end
license "MongoDB Customer Agreement"
def caveats
<<~EOS
MongoDB Enterprise is licensed under the MongoDB Customer Agreement (https://www.mongodb.com/customer-agreement). Except for evaluation purposes, you may not use MongoDB Enterprise without a commercial license from MongoDB.
EOS
end
option "with-enable-test-commands", "Configures MongoDB to allow test commands such as failpoints"
depends_on "mongodb-database-tools" => :recommended
depends_on "mongosh" => :recommended
conflicts_with "mongodb-community"
def install
inreplace "macos_mongodb.plist" do |s|
s.gsub!("\#{plist_name}", "#{plist_name}")
s.gsub!("\#{opt_bin}", "#{opt_bin}")
s.gsub!("\#{etc}", "#{etc}")
s.gsub!("\#{HOMEBREW_PREFIX}", "#{HOMEBREW_PREFIX}")
s.gsub!("\#{var}", "#{var}")
end
prefix.install_symlink "macos_mongodb.plist" => "#{plist_name}.plist"
prefix.install Dir["*"]
end
service do
name macos: "#{plist_name}"
end
def post_install
(var/"mongodb").mkpath
(var/"log/mongodb").mkpath
if !(File.exist?((etc/"mongod.conf"))) then
(etc/"mongod.conf").write mongodb_conf
end
end
def mongodb_conf
cfg = <<~EOS
systemLog:
destination: file
path: #{var}/log/mongodb/mongo.log
logAppend: true
storage:
dbPath: #{var}/mongodb
net:
bindIp: 127.0.0.1, ::1
ipv6: true
EOS
if build.with? "enable-test-commands"
cfg += <<~EOS
setParameter:
enableTestCommands: 1
EOS
end
cfg
end
test do
system "#{bin}/mongod", "--sysinfo"
end
end