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.1.tar.gz" sha256 "450b622aac7ae1758f1ef82f3b7b94ec47f2ff33abfb0e6ac82555b9ee55f151" revision 1 bottle do rebuild 1 sha256 "dcff67a2e7aa697e4f97687d4d7ac77368c016440f024546fa7463fbd761217b" => :mojave sha256 "11bd5a892abee1e927dae693a8d2fca41a3b9eb0ab0ceb4704f0deb8176b769a" => :high_sierra sha256 "fe49dbc4543693c4c3745b342f8874a3a4a63f562383c80cb5cacf30a57ee037" => :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