-require 'formula'
-
class Lldpd < Formula
- homepage 'http://vincentbernat.github.io/lldpd/'
- url 'http://media.luffy.cx/files/lldpd/lldpd-0.7.8.tar.gz'
- sha1 '78cd2848a2d5822ebae5a78a922d69596d3222e0'
+ desc "Implementation of IEEE 802.1ab (LLDP)"
+ homepage "https://vincentbernat.github.io/lldpd/"
+ url "https://media.luffy.cx/files/lldpd/lldpd-0.9.6.tar.gz"
+ sha256 "e74e2dd7e2a233ca1ff385c925ddae2a916d302819d1433741407d2f8fb0ddd8"
- option 'with-snmp', "Build SNMP subagent support"
- option 'with-json', "Build JSON support for lldpcli"
+ option "with-snmp", "Build SNMP subagent support"
+ option "with-json", "Build JSON support for lldpcli"
- depends_on 'pkg-config' => :build
- depends_on 'readline'
- depends_on 'libevent'
- depends_on 'net-snmp' if build.with? "snmp"
- depends_on 'jansson' if build.with? "json"
+ depends_on "pkg-config" => :build
+ depends_on "readline"
+ depends_on "libevent"
+ depends_on "net-snmp" if build.with? "snmp"
+ depends_on "jansson" if build.with? "json"
def install
readline = Formula["readline"]
- args = ["--prefix=#{prefix}",
- "--sysconfdir=#{etc}",
- "--localstatedir=#{var}",
- "--with-xml",
- "--with-readline",
- "--with-privsep-chroot=/var/empty",
- "--with-privsep-user=nobody",
- "--with-privsep-group=nogroup",
- "--with-launchddaemonsdir=no",
- "CPPFLAGS=-I#{readline.include} -DRONLY=1",
- "LDFLAGS=-L#{readline.lib}"]
- args << "--with-snmp" if build.with? "snmp"
- args << "--with-json" if build.with? "json"
+ args = [
+ "--prefix=#{prefix}",
+ "--sysconfdir=#{etc}",
+ "--localstatedir=#{var}",
+ "--with-xml",
+ "--with-readline",
+ "--with-privsep-chroot=/var/empty",
+ "--with-launchddaemonsdir=no",
+ "CPPFLAGS=-I#{readline.include} -DRONLY=1",
+ "LDFLAGS=-L#{readline.lib}",
+ ]
+ args << (build.with?("snmp") ? "--with-snmp" : "--without-snmp")
+ args << (build.with?("json") ? "--with-json" : "--without-json")
system "./configure", *args
system "make"
- system "make install"
+ system "make", "install"
+ end
+
+ def post_install
+ (var/"run").mkpath
end
def dscl(*args)
if build.with? "snmp"
additional_args += "<string>-x</string>"
end
- return <<-EOS.undent
+ <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
</plist>
EOS
end
-
end