homebrew-core/Formula/lldpd.rb
2019-03-22 17:36:23 +01:00

63 lines
1.7 KiB
Ruby

class Lldpd < Formula
desc "Implementation of IEEE 802.1ab (LLDP)"
homepage "https://vincentbernat.github.io/lldpd/"
url "https://media.luffy.cx/files/lldpd/lldpd-1.0.3.tar.gz"
sha256 "39fced395168015416bfe78b95414facf066f841f349024433aa20ab54e4c360"
bottle do
sha256 "1e72e4618d45de3304c07a9675cfd0ef39668bdff4a327fd40a0f88fba6d42f9" => :mojave
sha256 "6835530d05dfc54cb55c50336421d033b270f167e8439b5e15b706e4ba4044af" => :high_sierra
sha256 "c193e5f0e92b1bbfc02e64c762bf2e111e587b50acb6def5bd71480c14ffd5a2" => :sierra
end
depends_on "pkg-config" => :build
depends_on "libevent"
depends_on "readline"
def install
readline = Formula["readline"]
args = %W[
--prefix=#{prefix}
--sysconfdir=#{etc}
--localstatedir=#{var}
--with-launchddaemonsdir=no
--with-privsep-chroot=/var/empty
--with-privsep-group=nogroup
--with-privsep-user=nobody
--with-readline
--with-xml
--without-snmp
CPPFLAGS=-I#{readline.include}\ -DRONLY=1
LDFLAGS=-L#{readline.lib}
]
system "./configure", *args
system "make"
system "make", "install"
end
def post_install
(var/"run").mkpath
end
plist_options :startup => true
def plist
<<~EOS
<?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_sbin}/lldpd</string>
</array>
<key>RunAtLoad</key><true/>
<key>KeepAlive</key><true/>
</dict>
</plist>
EOS
end
end