aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/gnupg.rb
blob: 46739939d79e8748fa6968d312939e8184679770 (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
require 'formula'

class GnupgIdea <Formula
  head 'http://www.gnupg.dk/contrib-dk/idea.c.gz', :using  => NoUnzipCurlDownloadStrategy
  md5 '9dc3bc086824a8c7a331f35e09a3e57f'
end

class Gnupg <Formula
  url 'ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.11.tar.bz2'
  homepage 'http://www.gnupg.org/'
  sha1 '78e22f5cca88514ee71034aafff539c33f3c6676'

  def options
    [["--idea", "Build with (patented) IDEA cipher"]]
  end

  def install
    if ARGV.include? '--idea'
      opoo "You are building with support for the patented IDEA cipher."
      d=Pathname.getwd
      GnupgIdea.new.brew { (d+'cipher').install Dir['*'] }
      system 'gunzip', 'cipher/idea.c.gz'
    end

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--disable-asm"
    system "make"
    system "make check"

    # we need to create these directories because the install target has the
    # dependency order wrong
    bin.mkpath
    (libexec+'gnupg').mkpath
    system "make install"
  end

  def caveats
    if ARGV.include? '--idea'
      <<-EOS.undent
        Please read http://www.gnupg.org/faq/why-not-idea.en.html before doing so.
        You will then need to add the following line to your ~/.gnupg/gpg.conf or
        ~/.gnupg/options file:
          load-extension idea
      EOS
    end
  end
end