--- /dev/null
+Disable installation of the provided plist file for launchd.
+
+This file is installed at a fixed location outside of the prefix. This
+makes Homebrew fails. In the future, a configure option will be
+provided to avoid the installation of such a file.
+
+This patch is targeted at lldpd-0.7.6 only.
+
+diff -Naur lldpd-0.7.6.orig/osx/Makefile.am lldpd-0.7.6/osx/Makefile.am
+--- lldpd-0.7.6.orig/osx/Makefile.am 2013-06-26 08:47:50.000000000 +0200
++++ lldpd-0.7.6/osx/Makefile.am 2013-07-13 17:36:09.259797663 +0200
+@@ -58,10 +58,7 @@
+
+ # Install launchd plist
+ install-data-local:
+- install -m 0755 -d $(DESTDIR)/Library/LaunchDaemons
+- install -m 0644 im.bernat.lldpd.plist $(DESTDIR)/Library/LaunchDaemons
+ uninstall-local:
+- rm -rf $(DESTDIR)/Library/LaunchDaemons
+ clean-local:
+ rm -rf $(ARCHS)
+ rm -rf $(PKG_DIR)
+diff -Naur lldpd-0.7.6.orig/osx/Makefile.in lldpd-0.7.6/osx/Makefile.in
+--- lldpd-0.7.6.orig/osx/Makefile.in 2013-07-12 10:09:06.000000000 +0200
++++ lldpd-0.7.6/osx/Makefile.in 2013-07-13 17:35:43.195283824 +0200
+@@ -541,10 +541,7 @@
+
+ # Install launchd plist
+ @HOST_OS_OSX_TRUE@install-data-local:
+-@HOST_OS_OSX_TRUE@ install -m 0755 -d $(DESTDIR)/Library/LaunchDaemons
+-@HOST_OS_OSX_TRUE@ install -m 0644 im.bernat.lldpd.plist $(DESTDIR)/Library/LaunchDaemons
+ @HOST_OS_OSX_TRUE@uninstall-local:
+-@HOST_OS_OSX_TRUE@ rm -rf $(DESTDIR)/Library/LaunchDaemons
+ @HOST_OS_OSX_TRUE@clean-local:
+ @HOST_OS_OSX_TRUE@ rm -rf $(ARCHS)
+ @HOST_OS_OSX_TRUE@ rm -rf $(PKG_DIR)
require 'formula'
class Lldpd < Formula
- homepage 'http://vincentbernat.github.com/lldpd/'
+ homepage 'http://vincentbernat.github.io/lldpd/'
url 'http://media.luffy.cx/files/lldpd/lldpd-0.7.6.tar.gz'
sha1 'be3d3937b22d14259553f637694f744ed3b8ba79'
depends_on 'net-snmp' if build.include? 'with-snmp'
depends_on 'jansson' if build.include? 'with-json'
+ def patches
+ # Don't try to install provided launchd plist (outside of prefix)
+ "https://raw.github.com/vincentbernat/lldpd/master/osx/dont-install-launchd-plist.patch"
+
def install
readline = Formula.factory 'readline'
args = [ "--prefix=#{prefix}",