2009-12-20 02:51:22 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class CouchdbLucene < Formula
|
2012-01-09 21:22:30 +00:00
|
|
|
url 'https://github.com/rnewson/couchdb-lucene/tarball/v0.8.0'
|
2010-11-10 18:16:28 +00:00
|
|
|
homepage 'https://github.com/rnewson/couchdb-lucene'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '63c835499bed8fc3213ca5eaac59f362f42f21c6'
|
2010-04-19 20:43:50 +00:00
|
|
|
|
2009-12-20 02:51:22 +00:00
|
|
|
depends_on 'couchdb'
|
|
|
|
depends_on 'maven'
|
2010-04-19 20:43:50 +00:00
|
|
|
|
2009-12-20 02:51:22 +00:00
|
|
|
def install
|
2012-01-09 21:22:30 +00:00
|
|
|
system "mvn"
|
2009-12-20 02:51:22 +00:00
|
|
|
|
2012-05-15 18:31:21 +00:00
|
|
|
system "tar", "-xzf", "target/couchdb-lucene-#{version}-dist.tar.gz"
|
|
|
|
prefix.install Dir["couchdb-lucene-#{version}/*"]
|
2010-04-19 20:43:50 +00:00
|
|
|
|
|
|
|
(etc + "couchdb/local.d/couchdb-lucene.ini").write ini_file
|
|
|
|
end
|
|
|
|
|
2011-09-02 21:41:57 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
You can enable couchdb-lucene to automatically load on login with:
|
2010-04-19 20:43:50 +00:00
|
|
|
|
2011-09-02 21:41:57 +00:00
|
|
|
mkdir -p ~/Library/LaunchAgents
|
2011-12-31 05:56:52 +00:00
|
|
|
cp "#{plist_path}" ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
|
2010-04-19 20:43:50 +00:00
|
|
|
|
2011-09-02 21:41:57 +00:00
|
|
|
Or start it manually with:
|
|
|
|
#{bin}/run
|
|
|
|
EOS
|
2010-04-19 20:43:50 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def ini_file
|
|
|
|
return <<-EOS
|
2009-12-20 02:51:22 +00:00
|
|
|
[couchdb]
|
|
|
|
os_process_timeout=60000 ; increase the timeout from 5 seconds.
|
|
|
|
|
|
|
|
[external]
|
2012-05-08 01:54:56 +00:00
|
|
|
fti=#{which 'python'} #{prefix}/tools/couchdb-external-hook.py
|
2009-12-20 02:51:22 +00:00
|
|
|
|
|
|
|
[httpd_db_handlers]
|
|
|
|
_fti = {couch_httpd_external, handle_external_req, <<"fti">>}
|
2010-04-19 20:43:50 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2011-12-31 05:56:52 +00:00
|
|
|
def startup_plist
|
2010-04-19 20:43:50 +00:00
|
|
|
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>
|
2011-12-31 05:56:52 +00:00
|
|
|
<string>#{plist_name}</string>
|
2010-04-19 20:43:50 +00:00
|
|
|
<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>
|
2011-12-31 22:13:31 +00:00
|
|
|
<string>#{HOMEBREW_PREFIX}/bin/run</string>
|
2010-04-19 20:43:50 +00:00
|
|
|
</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
|
2009-12-20 02:51:22 +00:00
|
|
|
end
|
2010-09-01 15:12:56 +00:00
|
|
|
end
|