diff options
| author | Vincent Bernat | 2013-01-13 13:24:44 +0100 |
|---|---|---|
| committer | Adam Vandenberg | 2013-04-20 09:38:08 -0700 |
| commit | 5df111c3911a8f41f9e74ef5278414aa2d17030f (patch) | |
| tree | 249827990d52e7f4579137b490d6a2dd244f99d7 /Library | |
| parent | f0575f5c0fc4be2b5ebd1fe08b90d6410bbd025e (diff) | |
| download | homebrew-5df111c3911a8f41f9e74ef5278414aa2d17030f.tar.bz2 | |
lldpd 0.7.1
lldpd is a 802.1AB implementation (LLDP). It discovers L2 neighbors
along with some information like hostname, port name, VLAN, etc.
Formula comes with support for launchd, creation of privilege
separation user and group and optional SNMP support.
Closes #17052.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/lldpd.rb | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Library/Formula/lldpd.rb b/Library/Formula/lldpd.rb new file mode 100644 index 000000000..d9f5e47f0 --- /dev/null +++ b/Library/Formula/lldpd.rb @@ -0,0 +1,61 @@ +require 'formula' + +class Lldpd < Formula + homepage 'http://vincentbernat.github.io/lldpd/' + url 'http://media.luffy.cx/files/lldpd/lldpd-0.7.1.tar.gz' + sha1 '8eb804ee6b93d12486ee0527828b752dc43158f9' + + 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.include? 'with-snmp' + depends_on 'jansson' if build.include? 'with-json' + + def install + readline = Formula.factory 'readline' + args = [ "--prefix=#{prefix}", + "--with-xml", + "--with-readline", + "--with-privsep-chroot=/var/empty", + "--with-privsep-user=nobody", + "--with-privsep-group=nogroup", + "CPPFLAGS=-I#{readline.include} -DRONLY=1", + "LDFLAGS=-L#{readline.lib}" ] + args << "--with-snmp" if build.include? 'with-snmp' + args << "--with-json" if build.include? 'with-json' + + system "./configure", *args + system "make" + system "make install" + end + + plist_options :startup => true + + def plist + additional_args = "" + if build.include? 'with-snmp' + additional_args += "<string>-x</string>" + end + return <<-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"> + <dict> + <key>Label</key> + <string>#{plist_name}</string> + <key>ProgramArguments</key> + <array> + <string>#{opt_prefix}/sbin/lldpd</string> + #{additional_args} + </array> + <key>RunAtLoad</key><true/> + <key>KeepAlive</key><true/> + </dict> + </plist> + EOS + end + +end |
