<commit_before>class Nut < Formula
  desc "Network UPS Tools: Support for various power devices"
  homepage "https://networkupstools.org/"
  url "https://networkupstools.org/source/2.7/nut-2.7.4.tar.gz"
  sha256 "980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7"

  bottle do
    rebuild 1
    sha256 "42ea76f3d90654074d555b92a26af06586086658dd9fe32917b3fe91f611e370" => :catalina
    sha256 "521801a19b4cc0af4a7b1257c7cab01b8857ea54b1d93873f511abceaf8639f7" => :mojave
    sha256 "402d11c8de791487a264320826d4e71d27458f09adaaa275f00a620732c36137" => :high_sierra
    sha256 "f25e46baa1c36f3ffb09b4b1c9253b4bcc1ddd301c176af278a5f81a89f56859" => :sierra
  end

  head do
    url "https://github.com/networkupstools/nut.git"
    depends_on "asciidoc" => :build
    depends_on "autoconf" => :build
    depends_on "automake" => :build
    depends_on "libtool" => :build
  end

  depends_on "pkg-config" => :build
  depends_on "libusb-compat"
  depends_on "openssl" # no OpenSSL 1.1 support

  conflicts_with "rhino", :because => "both install `rhino` binaries"

  def install
    if build.head?
      ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
      system "./autogen.sh"
    end

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--localstatedir=#{var}",
                          "--with-macosx_ups",
                          "--with-openssl",
                          "--with-serial",
                          "--with-usb",
                          "--without-avahi",
                          "--without-cgi",<commit_msg>nut: move to OpenSSL 1.1<commit_after>class Nut < Formula
  desc "Network UPS Tools: Support for various power devices"
  homepage "https://networkupstools.org/"
  revision 1

  stable do
    url "https://networkupstools.org/source/2.7/nut-2.7.4.tar.gz"
    sha256 "980e82918c52d364605c0703a5dcf01f74ad2ef06e3d365949e43b7d406d25a7"

    # Upstream fix for OpenSSL 1.1 compatibility
    # https://github.com/networkupstools/nut/pull/504
    patch do
      url "https://github.com/networkupstools/nut/commit/612c05ef.diff?full_index=1"
      sha256 "9d21e425eba72fbefba3c3d74465d239726798f95063c3b90b2e4b9a12414e12"
    end
  end

  bottle do
    rebuild 1
    sha256 "42ea76f3d90654074d555b92a26af06586086658dd9fe32917b3fe91f611e370" => :catalina
    sha256 "521801a19b4cc0af4a7b1257c7cab01b8857ea54b1d93873f511abceaf8639f7" => :mojave
    sha256 "402d11c8de791487a264320826d4e71d27458f09adaaa275f00a620732c36137" => :high_sierra
    sha256 "f25e46baa1c36f3ffb09b4b1c9253b4bcc1ddd301c176af278a5f81a89f56859" => :sierra
  end

  head do
    url "https://github.com/networkupstools/nut.git"
    depends_on "asciidoc" => :build
  end

  depends_on "autoconf" => :build
  depends_on "automake" => :build
  depends_on "libtool" => :build
  depends_on "pkg-config" => :build
  depends_on "libusb-compat"
  depends_on "openssl@1.1"

  conflicts_with "rhino", :because => "both install `rhino` binaries"

  def install
    if build.head?
      ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
      system "./autogen.sh"
    else
      # Regenerate configure, due to patch applied
      system "autoreconf", "-i"
    end

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--localstatedir=#{var}",
                          "--with-macosx_ups",
                          "--with-openssl",
                          "--with-serial",
                          "--with-usb",
                          "--without-avahi",
                          "--without-cgi",
{'fraction_non_alphanumeric': 0.11250682687056253, 'fraction_numerical': 0.145002730748225, 'mean_word_length': 2.5563106796116504, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '6763041', 'n_tokens_mistral': 1642, 'n_tokens_neox': 1362, 'n_words': 208}