homebrew-core/Formula/ejabberd.rb

49 lines
1.1 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Ejabberd < Formula
url "http://www.process-one.net/downloads/ejabberd/2.1.8/ejabberd-2.1.8.tar.gz"
homepage 'http://www.ejabberd.im'
md5 'd7dae7e5a7986c5ad71beac2798cc406'
2011-04-08 18:16:37 +00:00
depends_on "openssl" if MacOS.leopard?
depends_on "erlang"
def options
[['--odbc', "Build with ODBC support."]]
end
def install
ENV['TARGET_DIR'] = ENV['DESTDIR'] = "#{lib}/ejabberd/erlang/lib/ejabberd-#{version}"
ENV['MAN_DIR'] = man
ENV['SBIN_DIR'] = sbin
Dir.chdir "src" do
args = ["--prefix=#{prefix}",
"--sysconfdir=#{etc}",
"--localstatedir=#{var}"]
2011-04-08 18:16:37 +00:00
if MacOS.leopard?
openssl = Formula.factory('openssl')
args << "--with-openssl=#{openssl.prefix}"
end
args << "--enable-odbc" if ARGV.include? '--odbc'
system "./configure", *args
system "make"
system "make install"
end
(etc+"ejabberd").mkpath
(var+"lib/ejabberd").mkpath
(var+"spool/ejabberd").mkpath
end
def caveats; <<-EOS.undent
If you face nodedown problems, concat your machine name to:
/private/etc/hosts
after 'localhost'.
EOS
end
end