Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
kibana-4.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontedor committed Dec 2, 2015
1 parent 5171f2a commit 4497535
Showing 1 changed file with 20 additions and 36 deletions.
56 changes: 20 additions & 36 deletions Library/Formula/kibana.rb
Original file line number Diff line number Diff line change
@@ -1,48 +1,32 @@
class Kibana < Formula
desc "Visualization tool for elasticsearch"
desc "Analytics and search dashboard for Elasticsearch"
homepage "https://www.elastic.co/products/kibana"
url "https://github.com/elastic/kibana/archive/v4.1.1.tar.gz"
sha256 "3f91e99e20e82d4e84ec141007822fea8f9454c71595551f9348ea2609c98284"
url "https://download.elastic.co/kibana/kibana/kibana-4.3.0-darwin-x64.tar.gz"
sha256 "b9952879be618b179275a0a0fb6ef9121f4f6d8784f70fb9aa059a05e3991c9d"
version "4.3.0"
head "https://github.com/elastic/kibana.git"

bottle do
cellar :any_skip_relocation
sha256 "a63101c190529aa0798ff7dabe7e7ee3fe8a6a04a126d324eb58fa8343e3a67d" => :el_capitan
sha256 "f8768f21442e9ce85b3c9b3da58d8e73c176d7bf656b636d15ab582074f14991" => :yosemite
sha256 "0bcea2ae726c5a175660c6350f4d60ee07a364d1574c90a2bd691ee25123afbb" => :mavericks
sha256 "5d102f006b25dae70bd62c99d9787abe10111460bc2119e5e5ceb412d6335dae" => :mountain_lion
end

depends_on "node"
bottle :unneeded

def install
ENV.prepend_path "PATH", "#{Formula["node"].opt_libexec}/npm/bin"

system "npm", "install"
system "npm", "install", "grunt-cli"
system "npm", "install", "bower"
system "./node_modules/.bin/bower", "install"
system "./node_modules/.bin/grunt", "build", "--force"

dist_dir = buildpath/"build/dist/kibana"

rm_f dist_dir/"bin/*.bat"
rm_f Dir["bin/*.bat"]
prefix.install Dir["*"]

prefix.install dist_dir/"src"
(etc/"kibana").mkpath
(var/"lib/kibana/plugins").mkpath

(etc/"kibana").install dist_dir/"config/kibana.yml" unless (etc/"kibana/kibana.yml").exist?

# point to our node
inreplace dist_dir/"bin/kibana" do |s|
s.sub! /^NODE=.*$/, "NODE=#{Formula["node"].opt_bin}/node"
inreplace "#{prefix}/config/kibana.yml" do |s|
s.sub!(%r{/var/run/kibana.pid}, "/usr/local/var/run/kibana.pid")
end
(etc/"kibana").install Dir[prefix/"config/kibana.yml"] unless (etc/"kibana/kibana.yml").exist?
end

def post_install
ln_s etc/"kibana", prefix/"config"

bin.install dist_dir/"bin/kibana"
(var/"lib/kibana").mkpath
rm_f var/"lib/kibana/node_modules"
ln_s prefix/"node_modules", var/"lib/kibana/node_modules"

(prefix/"config").install_symlink etc/"kibana/kibana.yml"
prefix.install_symlink var/"lib/kibana/plugins"
(var/"lib/kibana/installedPlugins").mkpath
ln_s var/"lib/kibana/installedPlugins", prefix/"installedPlugins"
end

plist_options :manual => "kibana"
Expand All @@ -65,6 +49,6 @@ def plist; <<-EOS.undent
end

test do
assert_match /#{version}/, shell_output("#{bin}/kibana -V")
assert_match /#{version}/, shell_output("BABEL_CACHE_PATH=#{testpath}/.babelcache.json #{bin}/kibana -V")
end
end

0 comments on commit 4497535

Please sign in to comment.