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
|
2012-05-04 03:37:57 +00:00
|
|
|
head 'http://www.gnupg.dk/contrib-dk/idea.c.gz', :using => :nounzip
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '9b78e20328d35525af7b8a9c1cf081396910e937'
|
2010-07-01 05:02:09 +00:00
|
|
|
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
|
|
|
|
2012-08-13 00:02:34 +00:00
|
|
|
option 'idea', 'Build with the patented IDEA cipher'
|
|
|
|
option '8192', 'Build with support for private keys of up to 8192 bits'
|
2009-09-01 00:33:33 +00:00
|
|
|
|
2012-10-23 21:32:53 +00:00
|
|
|
def cflags
|
|
|
|
cflags = ENV.cflags.to_s
|
|
|
|
cflags += ' -std=gnu89 -fheinous-gnu-extensions' if ENV.compiler == :clang
|
|
|
|
cflags
|
|
|
|
end
|
2012-02-19 07:05:25 +00:00
|
|
|
|
2012-10-23 21:32:53 +00:00
|
|
|
def install
|
2012-08-13 00:02:34 +00:00
|
|
|
if build.include? 'idea'
|
2012-05-08 05:09:03 +00:00
|
|
|
GnupgIdea.new.brew { (buildpath/'cipher').install Dir['*'] }
|
2010-07-01 05:02:09 +00:00
|
|
|
system 'gunzip', 'cipher/idea.c.gz'
|
|
|
|
end
|
2009-09-01 00:33:33 +00:00
|
|
|
|
2012-08-13 00:02:34 +00:00
|
|
|
inreplace 'g10/keygen.c', 'max=4096', 'max=8192' if build.include? '8192'
|
2011-02-10 19:11:09 +00:00
|
|
|
|
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"
|
2012-10-23 21:32:53 +00:00
|
|
|
system "make", "CFLAGS=#{cflags}"
|
2009-09-01 00:33:33 +00:00
|
|
|
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
|
2012-08-13 00:02:34 +00:00
|
|
|
if build.include? 'idea' then <<-EOS.undent
|
2012-05-08 05:09:03 +00:00
|
|
|
This build of GnuPG contains support for the patented IDEA cipher.
|
|
|
|
Please read http://www.gnupg.org/faq/why-not-idea.en.html before using
|
|
|
|
this software.
|
|
|
|
|
|
|
|
You will then need to add the following line to your ~/.gnupg/gpg.conf or
|
2010-07-01 05:02:09 +00:00
|
|
|
~/.gnupg/options file:
|
|
|
|
load-extension idea
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
2009-09-01 00:33:33 +00:00
|
|
|
end
|