<commit_before>require 'formula'

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

class Gnupg < Formula
  homepage 'http://www.gnupg.org/'
  url 'ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.12.tar.bz2'
  sha1 '9b78e20328d35525af7b8a9c1cf081396910e937'

  option 'idea', 'Build with the patented IDEA cipher'
  option '8192', 'Build with support for private keys of up to 8192 bits'

  def install
    if ENV.compiler == :clang
      ENV.append 'CFLAGS', '-std=gnu89'
      ENV.append 'CFLAGS', '-fheinous-gnu-extensions'
    end

    if build.include? 'idea'
      GnupgIdea.new.brew { (buildpath/'cipher').install Dir['*'] }
      system 'gunzip', 'cipher/idea.c.gz'
    end

    inreplace 'g10/keygen.c', 'max=4096', 'max=8192' if build.include? '8192'

    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<commit_msg>gnupg: superenv fix<commit_after>require 'formula'

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

class Gnupg < Formula
  homepage 'http://www.gnupg.org/'
  url 'ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-1.4.12.tar.bz2'
  sha1 '9b78e20328d35525af7b8a9c1cf081396910e937'

  option 'idea', 'Build with the patented IDEA cipher'
  option '8192', 'Build with support for private keys of up to 8192 bits'

  def cflags
    cflags = ENV.cflags.to_s
    cflags += ' -std=gnu89 -fheinous-gnu-extensions' if ENV.compiler == :clang
    cflags
  end

  def install
    if build.include? 'idea'
      GnupgIdea.new.brew { (buildpath/'cipher').install Dir['*'] }
      system 'gunzip', 'cipher/idea.c.gz'
    end

    inreplace 'g10/keygen.c', 'max=4096', 'max=8192' if build.include? '8192'

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

    # we need to create these directories because the install target has the
    # dependency order wrong
{'fraction_non_alphanumeric': 0.13386824324324326, 'fraction_numerical': 0.07516891891891891, 'mean_word_length': 2.9286898839137647, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7523087', 'n_tokens_mistral': 983, 'n_tokens_neox': 852, 'n_words': 196}