From: Vincent Bernat Date: Sun, 13 Jan 2013 12:23:32 +0000 (+0100) Subject: osx: update Homebrew formula with JSON and SNMP support X-Git-Tag: 0.7.2~55 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=593630190cdd086321b7d35fced961050676dad3;p=thirdparty%2Flldpd.git osx: update Homebrew formula with JSON and SNMP support --- diff --git a/osx/lldpd.rb b/osx/lldpd.rb index a77e5aee..bcf136ab 100644 --- a/osx/lldpd.rb +++ b/osx/lldpd.rb @@ -8,24 +8,33 @@ class Lldpd < Formula # Included copy of libevent does not like automake 1.13 # head 'git://github.com/vincentbernat/lldpd.git' + option 'with-snmp', "Build SNMP subagent support" + option 'with-json', "Build JSON support for lldpcli" + depends_on 'readline' depends_on 'libevent' depends_on 'pkg-config' + depends_on 'net-snmp' if build.include? 'with-snmp' + depends_on 'jansson' if build.include? 'with-json' depends_on 'autoconf' if build.head? depends_on 'automake' if build.head? - depends_on 'libtool' if build.head? + depends_on 'libtool' if build.head? def install readline = Formula.factory 'readline' if build.head? system "env LIBTOOLIZE=glibtoolize ./autogen.sh" end - system "./configure", "--prefix=#{prefix}", - "--with-xml", - "--with-readline", - "--with-privsep-chroot=/var/empty", - "CPPFLAGS=-I#{readline.include}", - "LDFLAGS=-L#{readline.lib}" + args = [ "--prefix=#{prefix}", + "--with-xml", + "--with-readline", + "--with-privsep-chroot=/var/empty", + "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 @@ -69,7 +78,12 @@ class Lldpd < Formula end plist_options :startup => true - def plist; <<-EOS.undent + def plist + additional_args = "" + if build.include? 'with-snmp' + additional_args += "-x" + end + return <<-EOS.undent @@ -79,6 +93,7 @@ class Lldpd < Formula ProgramArguments #{opt_prefix}/sbin/lldpd + #{additional_args} RunAtLoad KeepAlive