Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added elasticsearch HEAD

Allow to install Elasticsearch from the source:

    $ brew install elasticsearch --HEAD

(You need a working Maven installation -- `brew install maven` to install it with Homebrew.)

Closes #16844.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
commit 6f0ff64e33cbb4f5c86de4c3a797a02807b25a4f 1 parent 9d587a3
@karmi karmi authored klausmeyer committed
Showing with 18 additions and 0 deletions.
  1. +18 −0 Library/Formula/elasticsearch.rb
View
18 Library/Formula/elasticsearch.rb
@@ -4,12 +4,22 @@ class Elasticsearch < Formula
homepage 'http://www.elasticsearch.org'
url 'http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz'
sha1 '9bedb3638e4fc5a53e264aab3c5ff1a345f22bab'
+ head 'https://github.com/elasticsearch/elasticsearch.git'
+
+ depends_on 'maven' if build.head?
def cluster_name
"elasticsearch_#{ENV['USER']}"
end
def install
+ if build.head?
+ # Build the package from source
+ system "mvn clean package -DskipTests"
+ # Extract the package to the current directory
+ system "tar --strip 1 -xzf target/releases/elasticsearch-*.tar.gz"
+ end
+
# Remove Windows files
rm_f Dir["bin/*.bat"]
@@ -20,6 +30,14 @@ def install
# Install everything else into package directory
prefix.install Dir['*']
+ # Remove unnecessary files
+ rm_f Dir["#{prefix}/lib/sigar/*"]
+ if build.head?
+ rm_rf "#{prefix}/pom.xml"
+ rm_rf "#{prefix}/src/"
+ rm_rf "#{prefix}/target/"
+ end
+
# Set up ElasticSearch for local development:
inreplace "#{prefix}/config/elasticsearch.yml" do |s|
# 1. Give the cluster a unique name
Please sign in to comment.
Something went wrong with that request. Please try again.