Last active
December 20, 2015 15:38
-
-
Save lleirborras/6155470 to your computer and use it in GitHub Desktop.
CouchDB Lucene Build Brew Formula
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class CouchdbLuceneBuild < Formula | |
homepage 'https://github.com/ifad/couchdb-lucene-build' | |
url 'https://github.com/ifad/couchdb-lucene-build/archive/master.tar.gz' | |
version '0.0.1' | |
depends_on 'couchdb' | |
depends_on 'maven' | |
def install | |
system "mvn" | |
system "tar", "-xzf", "target/master.tar.gz" | |
prefix.install Dir["couchdb-lucene-master/*"] | |
(etc + "couchdb/local.d/couchdb-lucene.ini").write ini_file | |
end | |
def ini_file; <<-EOS.undent | |
[httpd_global_handlers] | |
_fti = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5985">>} | |
EOS | |
end | |
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/couchdb-lucene/bin/run" | |
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>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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment