]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
osx: update Homebrew formula to match what has been done in Homebrew
authorVincent Bernat <vincent@bernat.im>
Sun, 27 Apr 2014 10:54:44 +0000 (12:54 +0200)
committerVincent Bernat <vincent@bernat.im>
Sun, 27 Apr 2014 10:54:44 +0000 (12:54 +0200)
osx/lldpd.rb

index 91520054110e5d0012088c7e81f6ec6964c7e327..545f2bc9d92057795afdc1ea86df0e139fc7cf16 100644 (file)
@@ -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 += "<string>-x</string>"
     end
     return <<-EOS.undent
@@ -85,7 +87,7 @@ class Lldpd < Formula
       <string>#{plist_name}</string>
       <key>ProgramArguments</key>
       <array>
-        <string>#{opt_prefix}/sbin/lldpd</string>
+        <string>#{opt_sbin}/lldpd</string>
         #{additional_args}
       </array>
       <key>RunAtLoad</key><true/>