2014-04-02 01:27:36 +00:00
|
|
|
require "formula"
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Ejabberd < Formula
|
2014-04-02 01:27:36 +00:00
|
|
|
homepage "http://www.ejabberd.im"
|
|
|
|
url "http://www.process-one.net/downloads/ejabberd/13.12/ejabberd-13.12.tgz"
|
|
|
|
sha1 "3aedb5012fab49181961ff24bad3af581f4b30ee"
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2014-04-02 01:35:12 +00:00
|
|
|
bottle do
|
|
|
|
sha1 "6483132bdf79af21c0d4e7fc84ec25b4698d0ec7" => :mavericks
|
|
|
|
sha1 "55f409c6d9a10a2b1c687050ff80d6247b8db06b" => :mountain_lion
|
|
|
|
sha1 "572ed4bc18a5ca6d316e71af3c8b138fc7ffdc8c" => :lion
|
|
|
|
end
|
|
|
|
|
2014-04-02 01:27:36 +00:00
|
|
|
depends_on "openssl"
|
2009-12-30 10:40:35 +00:00
|
|
|
depends_on "erlang"
|
2014-04-02 01:27:36 +00:00
|
|
|
depends_on "libyaml"
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2012-08-28 04:33:50 +00:00
|
|
|
option "32-bit"
|
2014-04-02 01:27:36 +00:00
|
|
|
option "with-odbc", "Build with ODBC support"
|
|
|
|
option "with-pgsql", "Build with PostgreSQL support"
|
|
|
|
option "with-mysql", "Build with MySQL support"
|
2011-05-24 16:56:29 +00:00
|
|
|
|
2009-12-30 10:40:35 +00:00
|
|
|
def install
|
2014-04-02 01:27:36 +00:00
|
|
|
ENV["TARGET_DIR"] = ENV["DESTDIR"] = "#{lib}/ejabberd/erlang/lib/ejabberd-#{version}"
|
|
|
|
ENV["MAN_DIR"] = man
|
|
|
|
ENV["SBIN_DIR"] = sbin
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2012-08-28 04:33:50 +00:00
|
|
|
if build.build_32_bit?
|
2012-01-01 04:17:28 +00:00
|
|
|
%w{ CFLAGS LDFLAGS }.each do |compiler_flag|
|
2013-08-02 03:40:42 +00:00
|
|
|
ENV.remove compiler_flag, "-arch #{Hardware::CPU.arch_64_bit}"
|
|
|
|
ENV.append compiler_flag, "-arch #{Hardware::CPU.arch_32_bit}"
|
2012-01-01 04:17:28 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-04-02 01:27:36 +00:00
|
|
|
args = ["--prefix=#{prefix}",
|
|
|
|
"--sysconfdir=#{etc}",
|
|
|
|
"--localstatedir=#{var}"]
|
2011-02-24 15:31:01 +00:00
|
|
|
|
2014-04-02 01:27:36 +00:00
|
|
|
args << "--enable-odbc" if build.with? "odbc"
|
|
|
|
args << "--enable-pgsql" if build.with? "pgsql"
|
|
|
|
args << "--enable-mysql" if build.with? "mysql"
|
2011-05-24 16:56:29 +00:00
|
|
|
|
2014-04-02 01:27:36 +00:00
|
|
|
system "./configure", *args
|
|
|
|
system "make"
|
|
|
|
system "make", "install"
|
2009-12-30 10:40:35 +00:00
|
|
|
|
|
|
|
(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
|