73 lines
1.9 KiB
Ruby
73 lines
1.9 KiB
Ruby
class Metabase < Formula
|
|
desc "Business intelligence report server"
|
|
homepage "https://www.metabase.com/"
|
|
url "https://downloads.metabase.com/v0.39.2/metabase.jar"
|
|
sha256 "51b4d1d45a9e3929ff96e9dec4c2b55663e5d08c5de25dbb5ed16f9dd2e4faff"
|
|
license "AGPL-3.0-only"
|
|
|
|
livecheck do
|
|
url "https://www.metabase.com/start/oss/jar.html"
|
|
regex(%r{href=.*?/v?(\d+(?:\.\d+)+)/metabase\.jar}i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "2c2b9c0b594447b6fea1b115faf422c991ad093d1fdc560aa10f0322249a4a26"
|
|
end
|
|
|
|
head do
|
|
url "https://github.com/metabase/metabase.git"
|
|
|
|
depends_on "leiningen" => :build
|
|
depends_on "node" => :build
|
|
depends_on "yarn" => :build
|
|
end
|
|
|
|
# metabase uses jdk.nashorn.api.scripting.JSObject
|
|
# which is removed in Java 15
|
|
depends_on "openjdk@11"
|
|
|
|
def install
|
|
if build.head?
|
|
system "./bin/build"
|
|
libexec.install "target/uberjar/metabase.jar"
|
|
else
|
|
libexec.install "metabase.jar"
|
|
end
|
|
|
|
bin.write_jar_script libexec/"metabase.jar", "metabase", java_version: "11"
|
|
end
|
|
|
|
plist_options startup: true, manual: "metabase"
|
|
|
|
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>KeepAlive</key>
|
|
<true/>
|
|
<key>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_bin}/metabase</string>
|
|
</array>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>WorkingDirectory</key>
|
|
<string>#{var}/metabase</string>
|
|
<key>StandardOutPath</key>
|
|
<string>#{var}/metabase/server.log</string>
|
|
<key>StandardErrorPath</key>
|
|
<string>/dev/null</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system bin/"metabase", "migrate", "up"
|
|
end
|
|
end
|