2009-12-30 10:40:35 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Ejabberd < Formula
|
2009-12-30 10:40:35 +00:00
|
|
|
homepage 'http://www.ejabberd.im'
|
2012-02-21 06:04:21 +00:00
|
|
|
url "http://www.process-one.net/downloads/ejabberd/2.1.10/ejabberd-2.1.10.tar.gz"
|
2012-01-01 04:17:28 +00:00
|
|
|
md5 '70f0e17983114c62893e43b6ef2e9d0c'
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2011-04-08 18:16:37 +00:00
|
|
|
depends_on "openssl" if MacOS.leopard?
|
2009-12-30 10:40:35 +00:00
|
|
|
depends_on "erlang"
|
|
|
|
|
2011-05-24 16:56:29 +00:00
|
|
|
def options
|
2012-01-01 04:17:28 +00:00
|
|
|
[
|
|
|
|
['--odbc', "Build with ODBC support."],
|
|
|
|
['--32-bit', "Build 32-bit only."]
|
|
|
|
]
|
2011-05-24 16:56:29 +00:00
|
|
|
end
|
|
|
|
|
2009-12-30 10:40:35 +00:00
|
|
|
def install
|
|
|
|
ENV['TARGET_DIR'] = ENV['DESTDIR'] = "#{lib}/ejabberd/erlang/lib/ejabberd-#{version}"
|
|
|
|
ENV['MAN_DIR'] = man
|
|
|
|
ENV['SBIN_DIR'] = sbin
|
|
|
|
|
2012-01-01 04:17:28 +00:00
|
|
|
if ARGV.build_32_bit?
|
|
|
|
%w{ CFLAGS LDFLAGS }.each do |compiler_flag|
|
|
|
|
ENV.remove compiler_flag, "-arch x86_64"
|
|
|
|
ENV.append compiler_flag, "-arch i386"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
cd "src" do
|
2011-02-24 15:31:01 +00:00
|
|
|
args = ["--prefix=#{prefix}",
|
|
|
|
"--sysconfdir=#{etc}",
|
|
|
|
"--localstatedir=#{var}"]
|
|
|
|
|
2011-04-08 18:16:37 +00:00
|
|
|
if MacOS.leopard?
|
2011-02-24 15:31:01 +00:00
|
|
|
openssl = Formula.factory('openssl')
|
|
|
|
args << "--with-openssl=#{openssl.prefix}"
|
|
|
|
end
|
|
|
|
|
2011-05-24 16:56:29 +00:00
|
|
|
args << "--enable-odbc" if ARGV.include? '--odbc'
|
|
|
|
|
2011-02-24 15:31:01 +00:00
|
|
|
system "./configure", *args
|
2009-12-30 10:40:35 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
|
|
|
|
(etc+"ejabberd").mkpath
|
|
|
|
(var+"lib/ejabberd").mkpath
|
|
|
|
(var+"spool/ejabberd").mkpath
|
|
|
|
end
|
|
|
|
|
2011-02-24 15:31:01 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
If you face nodedown problems, concat your machine name to:
|
|
|
|
/private/etc/hosts
|
|
|
|
after 'localhost'.
|
2009-12-30 10:40:35 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|