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"
|
2014-04-09 10:25:10 +00:00
|
|
|
revision 1
|
2009-12-30 10:40:35 +00:00
|
|
|
|
2014-04-02 01:35:12 +00:00
|
|
|
bottle do
|
2014-04-09 11:00:24 +00:00
|
|
|
sha1 "0951237f1710e8c3de1c8c68501f53532036d726" => :mavericks
|
|
|
|
sha1 "7f1ffe76d100b3a2d00d1578e38db8f5f944859a" => :mountain_lion
|
|
|
|
sha1 "582da64c98ce8be147cfd17f2d464e5806d849e3" => :lion
|
2014-04-02 01:35:12 +00:00
|
|
|
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
|