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.4.tar.gz" sha256 "5319bc032fabf1008d5d91e280276aa7f1bbfbb70129d8526cd4526d7c22724f" bottle do sha256 "d8e42b79e54bbb3dcbaaa8b911a3602600f423d93d583d65fb97c13dea74c3a2" => :mojave sha256 "8399691d38ee82fb6a5bfecc1f64af375b3f5d3e58c9d9f3477a7cb0913e56f3" => :high_sierra sha256 "f2c15e6050362a427bf8dbcec0f830bc84677afbf97dd48f46c04befa8353c16" => :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 Label #{plist_name} ProgramArguments #{opt_sbin}/lldpd RunAtLoad KeepAlive EOS end end