From 084988d494891f16ddc03ede0e2133c6db5f21a7 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Sun, 27 Apr 2014 12:54:44 +0200 Subject: [PATCH] osx: update Homebrew formula to match what has been done in Homebrew --- osx/lldpd.rb | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) 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 -- 2.39.5