diff options
| author | Baptiste Fontaine | 2015-01-30 10:26:03 +0100 | 
|---|---|---|
| committer | Mike McQuaid | 2015-02-01 09:31:01 +0100 | 
| commit | 98b1bb9d1e4932b530fc26dacfb4553b97d09b32 (patch) | |
| tree | 2a39bbc93a46d75e15d8f7d91e8067ce93cd5022 | |
| parent | a97288bf4cf6bbd97471265aa043b797bfe12c72 (diff) | |
| download | homebrew-98b1bb9d1e4932b530fc26dacfb4553b97d09b32.tar.bz2 | |
elasticsearch: modernize, use new Java requirement style
| -rw-r--r-- | Library/Formula/elasticsearch.rb | 26 | 
1 files changed, 13 insertions, 13 deletions
| diff --git a/Library/Formula/elasticsearch.rb b/Library/Formula/elasticsearch.rb index 4441e4d52..d8fe7034a 100644 --- a/Library/Formula/elasticsearch.rb +++ b/Library/Formula/elasticsearch.rb @@ -3,7 +3,7 @@ class Elasticsearch < Formula    url "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.2.tar.gz"    sha1 "ae381615ec7f657e2a08f1d91758714f13d11693" -  depends_on :java => "1.7" +  depends_on :java => "1.7+"    head do      url "https://github.com/elasticsearch/elasticsearch.git" @@ -11,15 +11,15 @@ class Elasticsearch < Formula    end    def cluster_name -    "elasticsearch_#{ENV['USER']}" +    "elasticsearch_#{ENV["USER"]}"    end    def install      if build.head?        # Build the package from source -      system "mvn clean package -DskipTests" +      system "mvn", "clean", "package", "-DskipTests"        # Extract the package to the current directory -      system "tar --strip 1 -xzf target/releases/elasticsearch-*.tar.gz" +      system "tar", "--strip", "1", "-xzf", "target/releases/elasticsearch-*.tar.gz"      end      # Remove Windows files @@ -44,29 +44,29 @@ class Elasticsearch < Formula      # Set up Elasticsearch for local development:      inreplace "#{prefix}/config/elasticsearch.yml" do |s|        # 1. Give the cluster a unique name -      s.gsub! /#\s*cluster\.name\: elasticsearch/, "cluster.name: #{cluster_name}" +      s.gsub!(/#\s*cluster\.name\: elasticsearch/, "cluster.name: #{cluster_name}")        # 2. Configure paths -      s.sub! /#\s*path\.data: \/path\/to.+$/, "path.data: #{var}/elasticsearch/" -      s.sub! /#\s*path\.logs: \/path\/to.+$/, "path.logs: #{var}/log/elasticsearch/" -      s.sub! /#\s*path\.plugins: \/path\/to.+$/, "path.plugins: #{var}/lib/elasticsearch/plugins" +      s.sub!(%r{#\s*path\.data: /path/to.+$}, "path.data: #{var}/elasticsearch/") +      s.sub!(%r{#\s*path\.logs: /path/to.+$}, "path.logs: #{var}/log/elasticsearch/") +      s.sub!(%r{#\s*path\.plugins: /path/to.+$}, "path.plugins: #{var}/lib/elasticsearch/plugins")        # 3. Bind to loopback IP for laptops roaming different networks -      s.gsub! /#\s*network\.host\: [^\n]+/, "network.host: 127.0.0.1" +      s.gsub!(/#\s*network\.host\: [^\n]+/, "network.host: 127.0.0.1")      end      inreplace "#{bin}/elasticsearch.in.sh" do |s|        # Configure ES_HOME -      s.sub!  /#\!\/bin\/sh\n/, "#!/bin/sh\n\nES_HOME=#{prefix}" +      s.sub!(%r{#\!/bin/sh\n}, "#!/bin/sh\n\nES_HOME=#{prefix}")        # Configure ES_CLASSPATH paths to use libexec instead of lib -      s.gsub! /ES_HOME\/lib\//, "ES_HOME/libexec/" +      s.gsub!(%r{ES_HOME/lib/}, "ES_HOME/libexec/")      end      inreplace "#{bin}/plugin" do |s|        # Add the proper ES_CLASSPATH configuration -      s.sub!  /SCRIPT="\$0"/, %Q|SCRIPT="$0"\nES_CLASSPATH=#{libexec}| +      s.sub!(/SCRIPT="\$0"/, %(SCRIPT="$0"\nES_CLASSPATH=#{libexec}))        # Replace paths to use libexec instead of lib -      s.gsub! /\$ES_HOME\/lib\//, "$ES_CLASSPATH/" +      s.gsub!(%r{\$ES_HOME/lib/}, "$ES_CLASSPATH/")      end    end | 
