aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorKarel Minarik2013-01-01 19:33:06 +0100
committerAdam Vandenberg2013-01-04 08:58:58 -0800
commitad2d040c9efe26362725994f8d68cbb7c66abd04 (patch)
tree7fa48d29343fe3b0dadb5865ba50a4f41359fbe5 /Library
parent743ea94ff8da07ec246705456f002294ffe5d614 (diff)
downloadhomebrew-ad2d040c9efe26362725994f8d68cbb7c66abd04.tar.bz2
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>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/elasticsearch.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/Library/Formula/elasticsearch.rb b/Library/Formula/elasticsearch.rb
index 580fd016f..625ca0ff0 100644
--- a/Library/Formula/elasticsearch.rb
+++ b/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 @@ class Elasticsearch < Formula
# 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