homebrew-core/Formula/ejabberd.rb

55 lines
1.4 KiB
Ruby
Raw Normal View History

require 'formula'
2011-03-10 05:11:03 +00:00
class Ejabberd < Formula
homepage 'http://www.ejabberd.im'
url "http://www.process-one.net/downloads/ejabberd/2.1.13/ejabberd-2.1.13.tgz"
sha1 '6343186be2e84824d2da32e36110b72d6673730e'
2013-07-10 02:30:15 +00:00
depends_on "openssl" if MacOS.version <= :leopard
depends_on "erlang"
2012-08-28 04:33:50 +00:00
option "32-bit"
option 'with-odbc', "Build with ODBC support"
def install
ENV['TARGET_DIR'] = ENV['DESTDIR'] = "#{lib}/ejabberd/erlang/lib/ejabberd-#{version}"
ENV['MAN_DIR'] = man
ENV['SBIN_DIR'] = sbin
2012-08-28 04:33:50 +00:00
if build.build_32_bit?
%w{ CFLAGS LDFLAGS }.each do |compiler_flag|
ENV.remove compiler_flag, "-arch #{Hardware::CPU.arch_64_bit}"
ENV.append compiler_flag, "-arch #{Hardware::CPU.arch_32_bit}"
end
end
cd "src" do
args = ["--prefix=#{prefix}",
"--sysconfdir=#{etc}",
"--localstatedir=#{var}"]
2013-07-10 02:30:15 +00:00
if MacOS.version <= :leopard
2014-02-25 05:23:24 +00:00
openssl = Formula['openssl']
args << "--with-openssl=#{openssl.prefix}"
end
args << "--enable-odbc" if build.with? "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