aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorTrevor Turk2010-04-19 15:43:50 -0500
committerAdam Vandenberg2010-05-02 18:05:37 -0700
commit8f41351ed1ed6f3e088dcfc731057c626e3ec07d (patch)
treeecbfdd4edd0e0a1228a8ed6851b6092233084fdb /Library/Formula
parentb7ae3fe183da304fcbb6c212cc66e7db755b7996 (diff)
downloadhomebrew-8f41351ed1ed6f3e088dcfc731057c626e3ec07d.tar.bz2
update couchdb-lucene to 0.5.0
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/couchdb-lucene.rb85
1 files changed, 64 insertions, 21 deletions
diff --git a/Library/Formula/couchdb-lucene.rb b/Library/Formula/couchdb-lucene.rb
index 93e4ed509..63cf7346a 100644
--- a/Library/Formula/couchdb-lucene.rb
+++ b/Library/Formula/couchdb-lucene.rb
@@ -1,42 +1,85 @@
require 'formula'
class CouchdbLucene <Formula
- version '0.4'
+ version '0.5.0'
url 'http://github.com/rnewson/couchdb-lucene/tarball/v' + version
homepage 'http://github.com/rnewson/couchdb-lucene'
- md5 'b0f3c7c942a0eb80e3f9bff061a0677a'
-
+ md5 '85de8220ad8dd038775c59d222644675'
+
depends_on 'couchdb'
depends_on 'maven'
-
+
def install
# Skipping tests because the integration test assumes that couchdb-lucene
# has been integrated with a local couchdb instance. Not sure if there's a
# way to only disable the integration test.
system "mvn", "-DskipTests=true"
- lib_path = lib + "couchdb-lucene"
- index_path = var + "lib/couchdb-lucene"
- log_path = var + "log/couchdb-lucene"
- couchdb_cfg_path = etc + "couchdb/local.d"
- jar_name = "couchdb-lucene-#{version}-jar-with-dependencies.jar"
-
- [lib_path, index_path, log_path, couchdb_cfg_path].each {|p| p.mkpath}
-
- lib_path.install "target/#{jar_name}"
-
- (couchdb_cfg_path + "couchdb-lucene.ini").write <<-EOS
+ system "tar -xzf target/couchdb-lucene-#{version}-dist.tar.gz"
+ system "mv couchdb-lucene-#{version}/* #{prefix}"
+
+ (etc + "couchdb/local.d/couchdb-lucene.ini").write ini_file
+
+ (prefix + "couchdb-lucene.plist").write plist_file
+ end
+
+ def caveats; <<-EOS
+You can enable couchdb-lucene to automatically load on login with:
+
+ sudo cp #{prefix + "couchdb-lucene.plist"} /Library/LaunchDaemons/
+ sudo launchctl load -w /Library/LaunchDaemons/couchdb-lucene.plist
+
+Or start it manually with:
+
+ #{prefix}/bin/run
+EOS
+ end
+
+ def ini_file
+ return <<-EOS
[couchdb]
os_process_timeout=60000 ; increase the timeout from 5 seconds.
[external]
-fti=/usr/bin/java -Dcouchdb.lucene.dir=#{index_path} -Dcouchdb.log.dir=#{log_path} -server -jar #{lib_path + jar_name} -search
-
-[update_notification]
-indexer=/usr/bin/java -Dcouchdb.lucene.dir=#{index_path} -Dcouchdb.log.dir=#{log_path} -server -jar #{lib_path + jar_name} -index
+fti=#{`which python`.chomp} #{prefix}/tools/couchdb-external-hook.py
[httpd_db_handlers]
_fti = {couch_httpd_external, handle_external_req, <<"fti">>}
- EOS
+EOS
+ end
+
+ def plist_file
+ return <<-EOS
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
+ "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>Label</key>
+ <string>couchdb-lucene</string>
+ <key>EnvironmentVariables</key>
+ <dict>
+ <key>HOME</key>
+ <string>~</string>
+ <key>DYLD_LIBRARY_PATH</key>
+ <string>/opt/local/lib:$DYLD_LIBRARY_PATH</string>
+ </dict>
+ <key>ProgramArguments</key>
+ <array>
+ <string>#{prefix}/bin/run</string>
+ </array>
+ <key>UserName</key>
+ <string>#{`whoami`.chomp}</string>
+ <key>StandardOutPath</key>
+ <string>/dev/null</string>
+ <key>StandardErrorPath</key>
+ <string>/dev/null</string>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>KeepAlive</key>
+ <true/>
+ </dict>
+</plist>
+EOS
end
-end
+end \ No newline at end of file