<commit_before>require 'brewkit'

class ModWsgi <Formula
  @url='http://modwsgi.googlecode.com/files/mod_wsgi-2.5.tar.gz'
  @sha1='a2ed3fd60b390c3a790aca1c859093ab7a7c2d9d'
  @homepage='http://code.google.com/p/modwsgi/'

  def caveats
    " * You must manually edit /etc/apache2/httpd.conf to load mod_wsgi.so\n"+
    " * On 10.5, you must run Apache in 32-bit mode:\n"+
    "   http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX"
  end

  def install
    FileUtils.mv 'LICENCE', 'LICENSE'
    system "./configure --prefix='#{prefix}' --disable-debug --disable-dependency-tracking"

    # Just build 32-bit Intel
    # The arch flags should match your Python's arch flags.
    inreplace 'Makefile', "-Wc,'-arch ppc7400' -Wc,'-arch ppc64' -Wc,'-arch i386' -Wc,'-arch x86_64'", "-Wc,'-arch i386'"
    inreplace 'Makefile', "-arch ppc7400 -arch ppc64 -arch i386 -arch x86_64", "-arch i386"
    
    # --libexecdir parameter to ./configure isn't changing this, so cram it in
    inreplace 'Makefile', "LIBEXECDIR = /usr/libexec/apache2", "LIBEXECDIR = #{libexec}"

    system "make install"
  end
end
<commit_msg>Build mod_wsgi with the same arch's as Python.<commit_after>require 'brewkit'

class ModWsgi <Formula
  @url='http://modwsgi.googlecode.com/files/mod_wsgi-2.5.tar.gz'
  @sha1='a2ed3fd60b390c3a790aca1c859093ab7a7c2d9d'
  @homepage='http://code.google.com/p/modwsgi/'

  def caveats
    " * You must manually edit /etc/apache2/httpd.conf to load mod_wsgi.so\n"+
    " * On 10.5, you must run Apache in 32-bit mode:\n"+
    "   http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX"
  end

  def install
    FileUtils.mv 'LICENCE', 'LICENSE'
    system "./configure --prefix='#{prefix}' --disable-debug --disable-dependency-tracking"

    # The arch flags should match your Python's arch flags.
    archs = arch_for_command "`which python`"
    
    comp_flags = ''
    link_flags = ''
    archs.each do |a|
      comp_flags += " -Wc,'-arch #{a}'"
      link_flags += " -arch #{a}"
    end
    
    inreplace 'Makefile',
      "-Wc,'-arch ppc7400' -Wc,'-arch ppc64' -Wc,'-arch i386' -Wc,'-arch x86_64'",
      "#{comp_flags}"
 
    inreplace 'Makefile',
      "-arch ppc7400 -arch ppc64 -arch i386 -arch x86_64",
      "#{link_flags}"
    
    # --libexecdir parameter to ./configure isn't changing this, so cram it in
    inreplace 'Makefile', "LIBEXECDIR = /usr/libexec/apache2", "LIBEXECDIR = #{libexec}"

    system "make install"
  end
end

{'fraction_non_alphanumeric': 0.15010141987829614, 'fraction_numerical': 0.05030425963488844, 'mean_word_length': 3.1445378151260504, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4696039', 'n_tokens_mistral': 1003, 'n_tokens_neox': 923, 'n_words': 213}