aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mcabber.rb
blob: a7750d9d9b2b2fd7f005a767a2a6cc0ed2e32253 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
require 'formula'

class Mcabber < Formula
  homepage 'http://mcabber.com/'
  url 'http://mcabber.com/files/mcabber-0.10.2.tar.bz2'
  sha1 '7bff70dcf09e8a8a4cc7219e03b48bad382a6bda'
  revision 1

  head do
    url 'http://mcabber.com/hg/', :using => :hg

    depends_on :autoconf
    depends_on :automake
    depends_on :libtool
  end

  option 'enable-enchant', 'Enable spell checking support via enchant'
  option 'enable-aspell', 'Enable spell checking support via aspell'

  depends_on 'pkg-config' => :build
  depends_on 'glib'
  depends_on 'loudmouth'
  depends_on 'gpgme'
  depends_on 'libgcrypt'
  depends_on 'libotr'
  depends_on 'libidn'
  depends_on 'aspell' if build.include? 'enable-aspell'
  depends_on 'enchant' if build.include? 'enable-enchant'

  def install
    if build.head?
      ENV['LIBTOOLIZE'] = 'glibtoolize'
      ENV['ACLOCAL'] = "aclocal -I #{HOMEBREW_PREFIX}/share/aclocal"
      cd 'mcabber' # Not using block form on purpose
      inreplace 'autogen.sh', 'libtoolize', '$LIBTOOLIZE'
      inreplace 'autogen.sh', 'aclocal', '$ACLOCAL'
      system "./autogen.sh"
    end

    args = ["--disable-debug", "--disable-dependency-tracking",
            "--prefix=#{prefix}",
            "--enable-otr"]

    args << "--enable-aspell" if build.include? 'enable-aspell'
    args << "--enable-enchant" if build.include? 'enable-enchant'

    system "./configure", *args
    system "make install"

    (share+'mcabber').install %w[mcabberrc.example contrib]
  end

  def caveats; <<-EOS.undent
    A configuration file is necessary to start mcabber.  The template is here:
      #{share}/mcabber/mcabberrc.example
    And there is a Getting Started Guide you will need to setup Mcabber:
      http://wiki.mcabber.com/index.php/Getting_started
    EOS
  end
end