require 'formula' class CouchdbLucene < Formula homepage 'https://github.com/rnewson/couchdb-lucene' url 'https://github.com/rnewson/couchdb-lucene/tarball/v0.9.0' sha1 'f5c29f5d76c70ef25ed240b0a04658ec6120a0fd' depends_on 'couchdb' depends_on 'maven' def install system "mvn" system "tar", "-xzf", "target/couchdb-lucene-#{version}-dist.tar.gz" prefix.install Dir["couchdb-lucene-#{version}/*"] (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 Label #{plist_name} EnvironmentVariables HOME ~ DYLD_LIBRARY_PATH /opt/local/lib:$DYLD_LIBRARY_PATH ProgramArguments #{opt_prefix}/bin/run UserName #{`whoami`.chomp} StandardOutPath /dev/null StandardErrorPath /dev/null RunAtLoad KeepAlive EOS end end