<commit_before>require 'formula'

class Pig < Formula
  homepage 'http://pig.apache.org/'
  url 'http://www.apache.org/dyn/closer.cgi?path=pig/pig-0.12.0/pig-0.12.0.tar.gz'
  sha1 'b641a932d45003d2e6350007558d63e69a1bf7c6'

  def patches
    DATA
  end

  def install
    bin.install 'bin/pig'
    prefix.install ["pig-#{version}.jar", "pig-#{version}-withouthadoop.jar"]
  end

  def caveats; <<-EOS.undent
    You may need to set JAVA_HOME:
      export JAVA_HOME="$(/usr/libexec/java_home)"
    EOS
  end
end

# There's something weird with Pig's launch script, it doesn't find the correct
# path. This patch finds PIG_HOME from the pig binary path's symlink.
__END__
diff -u a/bin/pig b/bin/pig
--- a/bin/pig 2011-09-30 08:55:58.000000000 +1000<commit_msg>pig: use patch DSL<commit_after>require 'formula'

class Pig < Formula
  homepage 'http://pig.apache.org/'
  url 'http://www.apache.org/dyn/closer.cgi?path=pig/pig-0.12.0/pig-0.12.0.tar.gz'
  sha1 'b641a932d45003d2e6350007558d63e69a1bf7c6'

  patch :DATA

  def install
    bin.install 'bin/pig'
    prefix.install ["pig-#{version}.jar", "pig-#{version}-withouthadoop.jar"]
  end

  def caveats; <<-EOS.undent
    You may need to set JAVA_HOME:
      export JAVA_HOME="$(/usr/libexec/java_home)"
    EOS
  end
end

# There's something weird with Pig's launch script, it doesn't find the correct
# path. This patch finds PIG_HOME from the pig binary path's symlink.
__END__
diff -u a/bin/pig b/bin/pig
--- a/bin/pig 2011-09-30 08:55:58.000000000 +1000
{'fraction_non_alphanumeric': 0.13509933774834437, 'fraction_numerical': 0.08609271523178808, 'mean_word_length': 3.470414201183432, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '7423141', 'n_tokens_mistral': 700, 'n_tokens_neox': 602, 'n_words': 138}