aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorBaptiste Fontaine2014-12-16 00:04:21 +0100
committerJack Nagel2014-12-17 20:50:27 -0500
commit258ba978a8a28e3f8c710115b083634d7cdb03bf (patch)
tree2fd0a6d2772e1dffd8b3052bd306cd200560c688 /Library/Formula
parent88e577b9549f724fdd459ac190079a5384d50e62 (diff)
downloadhomebrew-258ba978a8a28e3f8c710115b083634d7cdb03bf.tar.bz2
couchdb-lucene 1.0.2
Closes #35017. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/couchdb-lucene.rb35
1 files changed, 26 insertions, 9 deletions
diff --git a/Library/Formula/couchdb-lucene.rb b/Library/Formula/couchdb-lucene.rb
index f9ea6470a..33ed63b7d 100644
--- a/Library/Formula/couchdb-lucene.rb
+++ b/Library/Formula/couchdb-lucene.rb
@@ -1,16 +1,13 @@
-require 'formula'
-
class CouchdbLucene < Formula
homepage 'https://github.com/rnewson/couchdb-lucene'
- url 'https://github.com/rnewson/couchdb-lucene/archive/v0.9.0.tar.gz'
- sha1 '99b8f8f1e644e6840896ee6c9b19c402042c1896'
-
- conflicts_with 'clusterit', :because => 'both install a `run` binary'
+ url 'https://github.com/rnewson/couchdb-lucene/archive/v1.0.2.tar.gz'
+ sha1 '75e0c55a87f47903c6cd122286ea3e4568809f7e'
depends_on 'couchdb'
depends_on 'maven'
def install
+ ENV["JAVA_HOME"] = `/usr/libexec/java_home`.chomp
system "mvn"
system "tar", "-xzf", "target/couchdb-lucene-#{version}-dist.tar.gz", "--strip", "1"
@@ -20,7 +17,9 @@ class CouchdbLucene < Formula
Dir.glob("#{libexec}/bin/*") do |path|
bin_name = File.basename(path)
- (bin+bin_name).write shim_script(bin_name)
+ cmd = "cl_#{bin_name}"
+ (bin/cmd).write shim_script(bin_name)
+ (libexec/"clbin").install_symlink bin/cmd => bin_name
end
ini_path.write(ini_file) unless ini_path.exist?
@@ -43,7 +42,7 @@ class CouchdbLucene < Formula
EOS
end
- plist_options :manual => "#{HOMEBREW_PREFIX}/opt/couchdb-lucene/bin/run"
+ plist_options :manual => "#{HOMEBREW_PREFIX}/opt/couchdb-lucene/bin/cl_run"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
@@ -60,7 +59,7 @@ class CouchdbLucene < Formula
</dict>
<key>ProgramArguments</key>
<array>
- <string>#{opt_bin}/run</string>
+ <string>#{opt_bin}/cl_run</string>
</array>
<key>StandardOutPath</key>
<string>/dev/null</string>
@@ -74,4 +73,22 @@ class CouchdbLucene < Formula
</plist>
EOS
end
+
+ def caveats; <<-EOS.undent
+ All commands have been installed with the prefix 'cl_'.
+
+ If you really need to use these commands with their normal names, you
+ can add a "clbin" directory to your PATH from your bashrc like:
+
+ PATH="#{opt_libexec}/clbin:$PATH"
+ EOS
+ end
+
+ test do
+ io = IO.popen("#{bin}/cl_run")
+ sleep 2
+ Process.kill("SIGINT", io.pid)
+ Process.wait(io.pid)
+ io.read !~ /Exception/
+ end
end