From 22685cb89d24d190960dce9d80932d8d6836fc29 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Sat, 8 Sep 2012 12:18:52 -0700 Subject: [PATCH] Install plists by default --- Library/Homebrew/build.rb | 10 ++++++++++ Library/Homebrew/formula.rb | 2 ++ 2 files changed, 12 insertions(+) diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 98924f648c..f13a84ddec 100755 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -141,6 +141,16 @@ def install f else f.prefix.mkpath f.install + + # Install a plist if one is defined + unless f.startup_plist.nil? + unless f.plist_path.exist? + f.plist_path.write f.startup_plist + f.plist_path.chmod 0644 + end + end + + # Find and link metafiles FORMULA_META_FILES.each do |filename| next if File.directory? filename target_file = filename diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 7ce9bcc15d..2fbfbe2018 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -140,6 +140,8 @@ class Formula # generally we don't want var stuff inside the keg def var; HOMEBREW_PREFIX+'var' end + # override this to provide a plist + def startup_plist; nil; end # plist name, i.e. the name of the launchd service def plist_name; 'homebrew.mxcl.'+name end def plist_path; prefix+(plist_name+'.plist') end