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.5.tar.gz" sha256 "2dd3b212f4dbabfcbb2794c0010b245f9f8e74b387984e757be6243a74c6cb99" bottle do sha256 "f37abc384f5435813515146bfa157d53d07611bce4b1b177ddc3d3410416b0b5" => :catalina sha256 "578f07789b6d8f8d0ab98d64707ec14a1879005a06bfe88f9d0447d474e7f2cf" => :mojave sha256 "4f04dc494f01c2ce011ea48c1e85efb3c985e98fe5b31ce768019d3746acd5ea" => :high_sierra end depends_on "pkg-config" => :build depends_on "libevent" depends_on "readline" uses_from_macos "libxml2" 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 Label #{plist_name} ProgramArguments #{opt_sbin}/lldpd RunAtLoad KeepAlive EOS end end