From ad2d040c9efe26362725994f8d68cbb7c66abd04 Mon Sep 17 00:00:00 2001 From: Karel Minarik Date: Tue, 1 Jan 2013 19:33:06 +0100 Subject: 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 --- Library/Formula/elasticsearch.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Library/Formula') 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 -- cgit v1.2.3