<commit_before>require 'formula'

class Zookeeper <Formula
  url 'http://mirror.switch.ch/mirror/apache/dist/hadoop/zookeeper/zookeeper-3.3.2/zookeeper-3.3.2.tar.gz'
  head 'http://svn.apache.org/repos/asf/zookeeper/trunk'
  homepage 'http://hadoop.apache.org/zookeeper/'
  md5 '346cdc18bf2bc1ce2549ae320ccf1f94'

  def options
    [
      ["--perl", "Build Perl bindings."],
      ["--python", "Build Python bindings."],
    ]
  end

  def shim_script target
    <<-EOS.undent
      #!/usr/bin/env bash
      . "#{etc}/zookeeper/defaults"
      cd #{libexec}/bin
      ./#{target} $*
    EOS
  end

  def default_zk_env
    <<-EOS.undent
      export ZOOCFGDIR="#{etc}/zookeeper"
    EOS
  end

  def default_log4j_properties
    <<-EOS.undent
      log4j.rootCategory=WARN, zklog

      log4j.appender.zklog = org.apache.log4j.FileAppender
      log4j.appender.zklog.File = #{var}/log/zookeeper/zookeeper.log
      log4j.appender.zklog.Append = true
      log4j.appender.zklog.layout = org.apache.log4j.PatternLayout
      log4j.appender.zklog.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
    EOS
  end

  def install
    # Prep work for svn compile.
    if ARGV.build_head?
      system "ant", "compile_jute"

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

    # Build & install C libraries.
    cd "src/c" do
      system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking", "--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 ARGV.include? "--python"

    # Install Perl bindings
    cd "src/contrib/zkperl" do
      system "perl", "Makefile.PL", "PREFIX=#{prefix}", "--zookeeper-include=#{prefix}/include/c-client-src", "--zookeeper-lib=#{prefix}/lib"
      system "make install"
    end if ARGV.include? "--perl"

    # Remove windows executables
    rm_f Dir["bin/*.cmd"]
<commit_msg>zookeeper - fix audit warnings<commit_after>require 'formula'

class Zookeeper <Formula
  url 'http://mirror.switch.ch/mirror/apache/dist/hadoop/zookeeper/zookeeper-3.3.2/zookeeper-3.3.2.tar.gz'
  head 'http://svn.apache.org/repos/asf/zookeeper/trunk'
  homepage 'http://hadoop.apache.org/zookeeper/'
  md5 '346cdc18bf2bc1ce2549ae320ccf1f94'

  def options
    [
      ["--perl", "Build Perl bindings."],
      ["--python", "Build Python bindings."],
    ]
  end

  def shim_script target
    <<-EOS.undent
      #!/usr/bin/env bash
      . "#{etc}/zookeeper/defaults"
      cd #{libexec}/bin
      ./#{target} $*
    EOS
  end

  def default_zk_env
    <<-EOS.undent
      export ZOOCFGDIR="#{etc}/zookeeper"
    EOS
  end

  def default_log4j_properties
    <<-EOS.undent
      log4j.rootCategory=WARN, zklog

      log4j.appender.zklog = org.apache.log4j.FileAppender
      log4j.appender.zklog.File = #{var}/log/zookeeper/zookeeper.log
      log4j.appender.zklog.Append = true
      log4j.appender.zklog.layout = org.apache.log4j.PatternLayout
      log4j.appender.zklog.layout.ConversionPattern = %d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n
    EOS
  end

  def install
    # Prep work for svn compile.
    if ARGV.build_head?
      system "ant", "compile_jute"

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

    # Build & install C libraries.
    cd "src/c" do
      system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking", "--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 ARGV.include? "--python"

    # Install Perl bindings
    cd "src/contrib/zkperl" do
      system "perl", "Makefile.PL", "PREFIX=#{prefix}", "--zookeeper-include=#{include}/c-client-src", "--zookeeper-lib=#{lib}"
      system "make install"
    end if ARGV.include? "--perl"

    # Remove windows executables
    rm_f Dir["bin/*.cmd"]

{'fraction_non_alphanumeric': 0.15479352813330113, 'fraction_numerical': 0.016421154310553007, 'mean_word_length': 2.7114695340501793, 'pattern_counts': {'":': 0, '<': 17, '<?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': '7121523', 'n_tokens_mistral': 1569, 'n_tokens_neox': 1492, 'n_words': 289}