<commit_before>require 'formula'

class Antiword < Formula
  url 'http://www.winfield.demon.nl/linux/antiword-0.37.tar.gz'
  homepage 'http://www.winfield.demon.nl/'
  md5 'f868e2a269edcbc06bf77e89a55898d1'

  skip_clean 'share/antiword'

  def install
    inreplace "Makefile" do |s|
      s.change_make_var! "GLOBAL_INSTALL_DIR", bin
      s.change_make_var! "GLOBAL_RESOURCES_DIR", share+'antiword'
    end

    system 'make'
    bin.install 'antiword'
    man1.install 'Docs/antiword.1'
    (share+'antiword').mkpath
  end

  def caveats; <<-EOS.undent
    You can install mapping files globally to:
      #{HOMEBREW_PREFIX}/share/antiword
    or locally to:
      ~/.antiword
    EOS
  end
end
<commit_msg>antiword: use Homebrew's compiler setting<commit_after>require 'formula'

class Antiword < Formula
  url 'http://www.winfield.demon.nl/linux/antiword-0.37.tar.gz'
  homepage 'http://www.winfield.demon.nl/'
  md5 'f868e2a269edcbc06bf77e89a55898d1'

  skip_clean 'share/antiword'

  def install
    inreplace "Makefile" do |s|
      s.change_make_var! "GLOBAL_INSTALL_DIR", bin
      s.change_make_var! "GLOBAL_RESOURCES_DIR", share+'antiword'
    end

    inreplace 'antiword.h', '/usr/share/antiword', share+'antiword'

    system "make CC=#{ENV.cc} LD=#{ENV.cc}"
    bin.install 'antiword'
    man1.install 'Docs/antiword.1'
    (share+'antiword').mkpath
  end

  def caveats; <<-EOS.undent
    You can install mapping files globally to:
      #{HOMEBREW_PREFIX}/share/antiword
    or locally to:
      ~/.antiword
    EOS
  end
end

{'fraction_non_alphanumeric': 0.12233009708737864, 'fraction_numerical': 0.032362459546925564, 'mean_word_length': 3.3920454545454546, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '5730043', 'n_tokens_mistral': 616, 'n_tokens_neox': 585, 'n_words': 114}