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