<commit_before>require 'formula'

class Zookeeper < Formula
  homepage 'http://zookeeper.apache.org/'
  url 'http://www.apache.org/dyn/closer.cgi?path=zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz'
  sha1 'fd921575e02478909557034ea922de871926efc7'

  head 'http://svn.apache.org/repos/asf/zookeeper/trunk'

  version '3.4.5-boxen1'

  if build.head?
    depends_on :automake
    depends_on :libtool
  end

  option "c",      "Build C bindings."
  option "perl",   "Build Perl bindings."
  option "python", "Build Python bindings."

  def install
    # Don't try to build extensions for PPC
    if Hardware.is_32_bit?
      ENV['ARCHFLAGS'] = "-arch i386"
    else
      ENV['ARCHFLAGS'] = "-arch i386 -arch x86_64"
    end

    # Prep work for svn compile.
    if build.head?
      system "ant", "compile_jute"

      cd "src/c" do
        system "autoreconf", "-if"
      end
    end

    build_python = build.include? "python"
    build_perl = build.include? "perl"
    build_c = build_python || build_perl || build.include?("c")

    # Build & install C libraries.
    cd "src/c" do
      system "./configure", "--disable-dependency-tracking",
                            "--prefix=#{prefix}",
                            "--without-cppunit"
      system "make install"
    end if build_c

    # Install Python bindings
    cd "src/contrib/zkpython" do
      system "python", "src/python/setup.py", "build"
      system "python", "src/python/setup.py", "install", "--prefix=#{prefix}"
    end if build_python

    # Install Perl bindings<commit_msg>Build C bindings by default<commit_after>require 'formula'

class Zookeeper < Formula
  homepage 'http://zookeeper.apache.org/'
  url 'http://www.apache.org/dyn/closer.cgi?path=zookeeper/zookeeper-3.4.5/zookeeper-3.4.5.tar.gz'
  sha1 'fd921575e02478909557034ea922de871926efc7'

  head 'http://svn.apache.org/repos/asf/zookeeper/trunk'

  version '3.4.5-boxen1'

  if build.head?
    depends_on :automake
    depends_on :libtool
  end

  option "perl",   "Build Perl bindings."
  option "python", "Build Python bindings."

  def install
    # Don't try to build extensions for PPC
    if Hardware.is_32_bit?
      ENV['ARCHFLAGS'] = "-arch i386"
    else
      ENV['ARCHFLAGS'] = "-arch i386 -arch x86_64"
    end

    # Prep work for svn compile.
    if build.head?
      system "ant", "compile_jute"

      cd "src/c" do
        system "autoreconf", "-if"
      end
    end

    build_python = build.include? "python"
    build_perl = build.include? "perl"

    # Build & install C libraries.
    cd "src/c" do
      system "./configure", "--disable-dependency-tracking",
                            "--prefix=#{prefix}",
                            "--without-cppunit"
      system "make install"
    end

    # Install Python bindings
    cd "src/contrib/zkpython" do
      system "python", "src/python/setup.py", "build"
      system "python", "src/python/setup.py", "install", "--prefix=#{prefix}"
    end if build_python

    # Install Perl bindings
{'fraction_non_alphanumeric': 0.1318936877076412, 'fraction_numerical': 0.03521594684385382, 'mean_word_length': 2.476905311778291, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6310186', 'n_tokens_mistral': 1105, 'n_tokens_neox': 1001, 'n_words': 242}