From: Vincent Bernat Date: Sun, 27 Apr 2014 10:54:44 +0000 (+0200) Subject: osx: update Homebrew formula to match what has been done in Homebrew X-Git-Tag: 0.7.9~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=084988d494891f16ddc03ede0e2133c6db5f21a7;p=thirdparty%2Flldpd.git osx: update Homebrew formula to match what has been done in Homebrew --- diff --git a/osx/lldpd.rb b/osx/lldpd.rb index 91520054..545f2bc9 100644 --- a/osx/lldpd.rb +++ b/osx/lldpd.rb @@ -11,20 +11,22 @@ class Lldpd < Formula depends_on 'pkg-config' => :build depends_on 'readline' depends_on 'libevent' - depends_on 'net-snmp' if build.include? 'with-snmp' - depends_on 'jansson' if build.include? 'with-json' + depends_on 'net-snmp' if build.with? "snmp" + depends_on 'jansson' if build.with? "json" def install - readline = Formula.factory 'readline' - args = [ "--prefix=#{prefix}", - "--with-xml", - "--with-readline", - "--with-privsep-chroot=/var/empty", - "--with-launchddaemonsdir=no", - "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' + readline = Formula["readline"] + args = ["--prefix=#{prefix}", + "--with-xml", + "--with-readline", + "--with-privsep-chroot=/var/empty", + "--with-privsep-user=nobody", + "--with-privsep-group=nogroup", + "--with-launchddaemonsdir=no", + "CPPFLAGS=-I#{readline.include} -DRONLY=1", + "LDFLAGS=-L#{readline.lib}"] + args << "--with-snmp" if build.with? "snmp" + args << "--with-json" if build.with? "json" system "./configure", *args system "make" @@ -73,7 +75,7 @@ class Lldpd < Formula def plist additional_args = "" - if build.include? 'with-snmp' + if build.with? "snmp" additional_args += "-x" end return <<-EOS.undent @@ -85,7 +87,7 @@ class Lldpd < Formula #{plist_name} ProgramArguments - #{opt_prefix}/sbin/lldpd + #{opt_sbin}/lldpd #{additional_args} RunAtLoad