<commit_before>class Hbase < Formula
  desc "Hadoop database: a distributed, scalable, big data store"
  homepage "https://hbase.apache.org"
  url "https://www.apache.org/dyn/closer.lua?path=hbase/2.4.5/hbase-2.4.5-bin.tar.gz"
  mirror "https://archive.apache.org/dist/hbase/2.4.5/hbase-2.4.5-bin.tar.gz"
  sha256 "7fb61e0ab05ec8b6aaeaa24e2037ea8e5753ce7e9a36c99796f102a263bf7ffa"
  license "Apache-2.0"

  bottle do
    sha256 arm64_big_sur: "7a0178466daa5ac2956269e16b2ef14b47b8ef6acae03f9926ae78697cd562ec"
    sha256 big_sur:       "88c89d28ecdecf7787a1f89450a54d9446cd412fc58d8a8459cc554ccda5893b"
    sha256 catalina:      "a292c7c6a3cdaea1f58a721c6dbc6dff80fc9cb0b9882dc7136da028c80aa3d1"
    sha256 mojave:        "619e320c7a40c49bdd24f5b319d8dae72c7afffbfca0841872bb12f123865d0e"
  end

  depends_on "ant" => :build
  depends_on "lzo"
  depends_on "openjdk@11"

  resource "hadoop-lzo" do
    url "https://github.com/cloudera/hadoop-lzo/archive/0.4.14.tar.gz"
    sha256 "aa8ddbb8b3f9e1c4b8cc3523486acdb7841cd97c002a9f2959c5b320c7bb0e6c"

    patch do
      url "https://raw.githubusercontent.com/Homebrew/formula-patches/b89da3afad84bbf69deed0611e5dddaaa5d39325/hbase/build.xml.patch"
      sha256 "d1d65330a4367db3e17ee4f4045641b335ed42449d9e6e42cc687e2a2e3fa5bc"
    end
  end

  def install
    java_home = Formula["openjdk@11"].opt_prefix
    rm_f Dir["bin/*.cmd", "conf/*.cmd"]
    libexec.install %w[bin conf lib hbase-webapps]

    # Some binaries have really generic names (like `test`) and most seem to be
    # too special-purpose to be permanently available via PATH.
    %w[hbase start-hbase.sh stop-hbase.sh].each do |script|
      (bin/script).write_env_script "#{libexec}/bin/#{script}", JAVA_HOME: "${JAVA_HOME:-#{java_home}}"
    end

    resource("hadoop-lzo").stage do
      # Fixed upstream: https://github.com/cloudera/hadoop-lzo/blob/HEAD/build.xml#L235
      ENV["CLASSPATH"] = Dir["#{libexec}/lib/hadoop-common-*.jar"].first
      ENV["CFLAGS"] = "-m64"<commit_msg>hbase: update 2.4.5 bottle.<commit_after>class Hbase < Formula
  desc "Hadoop database: a distributed, scalable, big data store"
  homepage "https://hbase.apache.org"
  url "https://www.apache.org/dyn/closer.lua?path=hbase/2.4.5/hbase-2.4.5-bin.tar.gz"
  mirror "https://archive.apache.org/dist/hbase/2.4.5/hbase-2.4.5-bin.tar.gz"
  sha256 "7fb61e0ab05ec8b6aaeaa24e2037ea8e5753ce7e9a36c99796f102a263bf7ffa"
  license "Apache-2.0"

  bottle do
    rebuild 1
    sha256 arm64_big_sur: "81780e60d8e593165365fd5113d5602a0438482db4983da90c37aabd473e403e"
    sha256 big_sur:       "b794e8d9c358441726196a905f0ece2136f8a91ee3c9e91f1a1c31e8a5a63aed"
    sha256 catalina:      "316f0a2cfd4cbfd04e78a7dae813e386651082e9437ef957946b9d1cafd72de7"
    sha256 mojave:        "ee24a9af687b09c40138cf6b11007616681b19ed5f1279edd2325465285e7d08"
  end

  depends_on "ant" => :build
  depends_on "lzo"
  depends_on "openjdk@11"

  resource "hadoop-lzo" do
    url "https://github.com/cloudera/hadoop-lzo/archive/0.4.14.tar.gz"
    sha256 "aa8ddbb8b3f9e1c4b8cc3523486acdb7841cd97c002a9f2959c5b320c7bb0e6c"

    patch do
      url "https://raw.githubusercontent.com/Homebrew/formula-patches/b89da3afad84bbf69deed0611e5dddaaa5d39325/hbase/build.xml.patch"
      sha256 "d1d65330a4367db3e17ee4f4045641b335ed42449d9e6e42cc687e2a2e3fa5bc"
    end
  end

  def install
    java_home = Formula["openjdk@11"].opt_prefix
    rm_f Dir["bin/*.cmd", "conf/*.cmd"]
    libexec.install %w[bin conf lib hbase-webapps]

    # Some binaries have really generic names (like `test`) and most seem to be
    # too special-purpose to be permanently available via PATH.
    %w[hbase start-hbase.sh stop-hbase.sh].each do |script|
      (bin/script).write_env_script "#{libexec}/bin/#{script}", JAVA_HOME: "${JAVA_HOME:-#{java_home}}"
    end

    resource("hadoop-lzo").stage do
      # Fixed upstream: https://github.com/cloudera/hadoop-lzo/blob/HEAD/build.xml#L235
      ENV["CLASSPATH"] = Dir["#{libexec}/lib/hadoop-common-*.jar"].first
      ENV["CFLAGS"] = "-m64"
{'fraction_non_alphanumeric': 0.11922503725782414, 'fraction_numerical': 0.16815697963238946, 'mean_word_length': 4.30566534914361, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 12, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '2526713', 'n_tokens_mistral': 2077, 'n_tokens_neox': 1752, 'n_words': 226}