homebrew-core/Formula/arangodb.rb
2017-03-21 13:06:18 +01:00

92 lines
2.5 KiB
Ruby

class Arangodb < Formula
desc "The Multi-Model NoSQL Database."
homepage "https://www.arangodb.com/"
url "https://www.arangodb.com/repositories/Source/ArangoDB-3.1.15.tar.gz"
sha256 "eede020ef14d88e86743e93851cc1c7fdec64f54a01cf0644150149d9603b4ef"
head "https://github.com/arangodb/arangodb.git", :branch => "unstable"
bottle do
sha256 "ddb1956f1a02a3dc9e4c4051e42ed5f1d640996be7d7a21d15e8f3ccf3f6908e" => :sierra
sha256 "0de4a470b1ce301c6619a0e50a6de9d36d8c467215057974e18602bafbdbb8d9" => :el_capitan
sha256 "78186fb58dbcd3b0419455707b4c33e7557dc4cd93a747c71a1f925a58405825" => :yosemite
end
depends_on :macos => :yosemite
depends_on "cmake" => :build
depends_on "go" => :build
depends_on "openssl"
needs :cxx11
fails_with :clang do
build 600
cause "Fails with compile errors"
end
def install
ENV.cxx11
mkdir "build" do
args = std_cmake_args + %W[
-DHOMEBREW=ON
-DUSE_OPTIMIZE_FOR_ARCHITECTURE=OFF
-DASM_OPTIMIZATIONS=OFF
-DCMAKE_INSTALL_DATADIR=#{share}
-DCMAKE_INSTALL_DATAROOTDIR=#{share}
-DCMAKE_INSTALL_SYSCONFDIR=#{etc}
-DCMAKE_INSTALL_LOCALSTATEDIR=#{var}
]
if ENV.compiler == "gcc-6"
ENV.append "V8_CXXFLAGS", "-O3 -g -fno-delete-null-pointer-checks"
end
system "cmake", "..", *args
system "make", "install"
%w[arangod arango-dfdb arangosh foxx-manager].each do |f|
inreplace etc/"arangodb3/#{f}.conf", pkgshare, opt_pkgshare
end
end
end
def post_install
(var/"lib/arangodb3").mkpath
(var/"log/arangodb3").mkpath
end
def caveats
s = <<-EOS.undent
An empty password has been set. Please change it by executing
#{opt_sbin}/arango-secure-installation
EOS
s
end
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/arangodb/sbin/arangod"
def plist; <<-EOS.undent
<?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>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>Program</key>
<string>#{opt_sbin}/arangod</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
testcase = "require('@arangodb').print('it works!')"
output = shell_output("#{bin}/arangosh --server.password \"\" --javascript.execute-string \"#{testcase}\"")
assert_equal "it works!", output.chomp
end
end