<commit_before>class Opendbx < Formula
  desc "Lightweight but extensible database access library in C"
  homepage "https://linuxnetworks.de/doc/index.php/OpenDBX"
  url "https://linuxnetworks.de/opendbx/download/opendbx-1.4.6.tar.gz"
  sha256 "2246a03812c7d90f10194ad01c2213a7646e383000a800277c6fb8d2bf81497c"
  revision 1

  bottle do
    sha256 "dbc54ada8f2b9b7fed3ee18a4d6d1c7d88b2885a45ffbf06adf31f312d78bdad" => :el_capitan
    sha256 "d107e7392614948e26b5720072bddb06b07c9f9e07a3804ccdd9c91beecfcc77" => :yosemite
    sha256 "8d08b6f6a5164c357cfb61fe288f2d129e7452c1e7f58efb0ef228e6ba747887" => :mavericks
    sha256 "2ea5595a73cc1317ab7d760e75cb428d3c5440c490a0ba4b001b8a6e84ce785c" => :mountain_lion
  end

  depends_on "readline"
  depends_on "sqlite"

  def install
    # Reported upstream: http://bugs.linuxnetworks.de/index.php?do=details&id=40
    inreplace "utils/Makefile.in", "$(LIBSUFFIX)", ".dylib"

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--with-backends=sqlite3"
    system "make"
    system "make", "install"
  end

  test do
    testfile = testpath/"test.sql"
    testfile.write <<-EOS.undent<commit_msg>opendbx: update 1.4.6_1 bottle.<commit_after>class Opendbx < Formula
  desc "Lightweight but extensible database access library in C"
  homepage "https://linuxnetworks.de/doc/index.php/OpenDBX"
  url "https://linuxnetworks.de/opendbx/download/opendbx-1.4.6.tar.gz"
  sha256 "2246a03812c7d90f10194ad01c2213a7646e383000a800277c6fb8d2bf81497c"
  revision 1

  bottle do
    sha256 "275e19f854b29f8d1d0560a4cca55395854312d678c5c64ad3c2597df7569aef" => :sierra
    sha256 "84a0f694107dd4d15b949dd68474e5a270da583058b7eff29688370ef3a8e18f" => :el_capitan
    sha256 "874a8b0ef941eec827bd85e59b7773269bb6b3632e38b9d192a003c4134b3227" => :yosemite
  end

  depends_on "readline"
  depends_on "sqlite"

  def install
    # Reported upstream: http://bugs.linuxnetworks.de/index.php?do=details&id=40
    inreplace "utils/Makefile.in", "$(LIBSUFFIX)", ".dylib"

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--with-backends=sqlite3"
    system "make"
    system "make", "install"
  end

  test do
    testfile = testpath/"test.sql"
    testfile.write <<-EOS.undent
{'fraction_non_alphanumeric': 0.10715798390512495, 'fraction_numerical': 0.17704362558238035, 'mean_word_length': 3.951781970649895, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1257831', 'n_tokens_mistral': 1183, 'n_tokens_neox': 963, 'n_words': 129}