2014-10-17 12:04:53 +00:00
|
|
|
class Nut < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Network UPS Tools: Support for various power devices"
|
2014-10-17 12:04:53 +00:00
|
|
|
homepage "http://www.networkupstools.org"
|
2015-05-02 21:17:21 +00:00
|
|
|
url "http://www.networkupstools.org/source/2.7/nut-2.7.3.tar.gz"
|
|
|
|
sha256 "ff44d95d06a51559a0a018eef7f8d17911c1002b6352a7d7580ff75acb12126b"
|
2014-10-17 12:04:53 +00:00
|
|
|
|
2014-10-17 13:16:51 +00:00
|
|
|
bottle do
|
2015-10-04 09:13:27 +00:00
|
|
|
revision 1
|
|
|
|
sha256 "b78afeef0043a9a22fe57d673c0c4f4ff14fcf77cfcdb7ea8d8b9b9092ba00d2" => :el_capitan
|
|
|
|
sha256 "8d2e76b8ee440afde4ea901484b73d60d587fa0f06000f5397b2686e526d09ed" => :yosemite
|
|
|
|
sha256 "d2f0ffcf035b9a7313732d3581f4ff57b9af2006e5f77286b403b2973024d9ed" => :mavericks
|
2014-10-17 13:16:51 +00:00
|
|
|
end
|
|
|
|
|
2014-10-17 12:04:53 +00:00
|
|
|
head do
|
|
|
|
url "https://github.com/networkupstools/nut.git"
|
2015-05-02 21:17:21 +00:00
|
|
|
depends_on "asciidoc" => :build
|
2014-10-17 12:04:53 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
end
|
|
|
|
|
|
|
|
option "without-serial", "Omits serial drivers"
|
|
|
|
option "without-libusb-compat", "Omits USB drivers"
|
|
|
|
option "with-dev", "Includes dev headers"
|
|
|
|
option "with-net-snmp", "Builds SNMP support"
|
|
|
|
option "with-neon", "Builds XML-HTTP support"
|
|
|
|
option "with-powerman", "Builds powerman PDU support"
|
|
|
|
option "with-freeipmi", "Builds IPMI PSU support"
|
|
|
|
option "with-cgi", "Builds CGI wrappers"
|
|
|
|
option "with-libltdl", "Adds dynamic loading support of plugins using libltdl"
|
|
|
|
|
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "libusb-compat" => :recommended
|
|
|
|
depends_on "net-snmp" => :optional
|
|
|
|
depends_on "neon" => :optional
|
|
|
|
depends_on "powerman" => :optional
|
|
|
|
depends_on "freeipmi" => :optional
|
|
|
|
depends_on "openssl"
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
depends_on "gd" if build.with? "cgi"
|
|
|
|
|
2015-11-01 22:13:10 +00:00
|
|
|
conflicts_with "rhino", :because => "both install `rhino` binaries"
|
|
|
|
|
2014-10-17 12:04:53 +00:00
|
|
|
def install
|
2015-05-02 21:17:21 +00:00
|
|
|
if build.head?
|
2015-05-11 00:54:34 +00:00
|
|
|
ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog"
|
2015-05-02 21:17:21 +00:00
|
|
|
system "./autogen.sh"
|
|
|
|
end
|
|
|
|
|
2014-10-17 12:04:53 +00:00
|
|
|
args = ["--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
2014-12-12 03:46:00 +00:00
|
|
|
"--localstatedir=#{var}",
|
2014-10-17 12:04:53 +00:00
|
|
|
"--without-doc",
|
|
|
|
"--without-avahi",
|
|
|
|
"--with-macosx_ups",
|
|
|
|
"--with-openssl",
|
|
|
|
"--without-nss",
|
2015-08-03 12:55:31 +00:00
|
|
|
"--without-wrap"
|
|
|
|
]
|
2014-10-17 12:04:53 +00:00
|
|
|
args << (build.with?("serial") ? "--with-serial" : "--without-serial")
|
2015-10-04 09:05:32 +00:00
|
|
|
args << (build.with?("libusb-compat") ? "--with-usb" : "--without-usb")
|
2014-10-17 12:04:53 +00:00
|
|
|
args << (build.with?("dev") ? "--with-dev" : "--without-dev")
|
2014-12-12 03:46:00 +00:00
|
|
|
args << (build.with?("net-snmp") ? "--with-snmp" : "--without-snmp")
|
2014-10-17 12:04:53 +00:00
|
|
|
args << (build.with?("neon") ? "--with-neon" : "--without-neon")
|
|
|
|
args << (build.with?("powerman") ? "--with-powerman" : "--without-powerman")
|
|
|
|
args << (build.with?("ipmi") ? "--with-ipmi" : "--without-ipmi")
|
|
|
|
args << "--with-freeipmi" if build.with? "ipmi"
|
|
|
|
args << (build.with?("libltdl") ? "--with-libltdl" : "--without-libltdl")
|
|
|
|
args << (build.with?("cgi") ? "--with-cgi" : "--without-cgi")
|
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
system "make", "install"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/dummy-ups", "-L"
|
|
|
|
end
|
|
|
|
end
|