2009-12-20 02:51:22 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class CouchdbLucene < Formula
|
2010-11-10 18:16:28 +00:00
|
|
|
homepage 'https://github.com/rnewson/couchdb-lucene'
|
2013-01-27 02:26:01 +00:00
|
|
|
url 'https://github.com/rnewson/couchdb-lucene/tarball/v0.9.0'
|
2013-01-01 14:57:13 +00:00
|
|
|
sha1 'f5c29f5d76c70ef25ed240b0a04658ec6120a0fd'
|
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
|
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
def ini_file; <<-EOS.undent
|
2013-01-31 17:17:29 +00:00
|
|
|
[httpd_global_handlers]
|
|
|
|
_fti = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5985">>}
|
2011-09-02 21:41:57 +00:00
|
|
|
EOS
|
2010-04-19 20:43:50 +00:00
|
|
|
end
|
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/couchdb-lucene/bin/run"
|
2009-12-20 02:51:22 +00:00
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?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>#{plist_name}</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>#{opt_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
|
2009-12-20 02:51:22 +00:00
|
|
|
end
|
2010-09-01 15:12:56 +00:00
|
|
|
end
|