homebrew-core/Formula/nut.rb
2019-10-17 17:01:39 +02:00

59 lines
2 KiB
Ruby

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",
"--without-dev",
"--without-doc",
"--without-ipmi",
"--without-libltdl",
"--without-neon",
"--without-nss",
"--without-powerman",
"--without-snmp",
"--without-wrap"
system "make", "install"
end
test do
system "#{bin}/dummy-ups", "-L"
end
end