Skip to content

Commit

Permalink
Install plists by default
Browse files Browse the repository at this point in the history
  • Loading branch information
adamv committed Sep 9, 2012
1 parent e250bfb commit ac59720
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Library/Homebrew/build.rb
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/formula.rb
Expand Up @@ -140,6 +140,8 @@ def etc; HOMEBREW_PREFIX+'etc' end
# 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
Expand Down

0 comments on commit ac59720

Please sign in to comment.