2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-01 00:33:33 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class GnupgIdea < Formula
|
2010-07-01 05:02:09 +00:00
|
|
|
head 'http://www.gnupg.dk/contrib-dk/idea.c.gz', :using => NoUnzipCurlDownloadStrategy
|
|
|
|
md5 '9dc3bc086824a8c7a331f35e09a3e57f'
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Gnupg < Formula
|
2010-07-01 05:02:09 +00:00
|
|
|
homepage 'http://www.gnupg.org/'
|
2012-02-19 22:09:07 +00:00
|
|
|
url 'ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.12.tar.bz2'
|
|
|
|
sha1 '9b78e20328d35525af7b8a9c1cf081396910e937'
|
2010-11-01 18:26:00 +00:00
|
|
|
|
2010-07-01 05:02:09 +00:00
|
|
|
def options
|
2011-02-10 19:11:09 +00:00
|
|
|
[
|
|
|
|
["--idea", "Build with (patented) IDEA cipher"],
|
|
|
|
["--8192", "Build with support for private keys up to 8192 bits"],
|
|
|
|
]
|
2010-07-01 05:02:09 +00:00
|
|
|
end
|
2009-09-01 00:33:33 +00:00
|
|
|
|
|
|
|
def install
|
2012-02-19 22:09:07 +00:00
|
|
|
if ENV.compiler == :clang
|
|
|
|
ENV.append 'CFLAGS', '-std=gnu89'
|
|
|
|
ENV.append 'CFLAGS', '-fheinous-gnu-extensions'
|
|
|
|
end
|
2012-02-19 07:05:25 +00:00
|
|
|
|
2010-07-01 05:02:09 +00:00
|
|
|
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
|
2009-09-01 00:33:33 +00:00
|
|
|
|
2011-02-10 19:11:09 +00:00
|
|
|
inreplace 'g10/keygen.c', 'max=4096', 'max=8192' if ARGV.include? '--8192'
|
|
|
|
|
2010-10-18 17:40:01 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
2010-07-01 05:02:09 +00:00
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--disable-asm"
|
2009-09-01 00:33:33 +00:00
|
|
|
system "make"
|
|
|
|
system "make check"
|
|
|
|
|
2010-07-01 05:02:09 +00:00
|
|
|
# we need to create these directories because the install target has the
|
2009-09-09 14:11:58 +00:00
|
|
|
# dependency order wrong
|
2009-09-01 00:33:33 +00:00
|
|
|
bin.mkpath
|
|
|
|
(libexec+'gnupg').mkpath
|
|
|
|
system "make install"
|
|
|
|
end
|
2010-07-01 05:02:09 +00:00
|
|
|
|
|
|
|
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
|
2009-09-01 00:33:33 +00:00
|
|
|
end
|