diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/nginx.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Formula/nginx.rb b/Library/Formula/nginx.rb index f8a59dde8..b218e4cf0 100644 --- a/Library/Formula/nginx.rb +++ b/Library/Formula/nginx.rb @@ -74,6 +74,9 @@ class Nginx < Formula man8.install "objs/nginx.8" (var/'run/nginx').mkpath + # nginx’s docroot is #{prefix}/html, this isn't useful, so we symlink it + # to #{HOMEBREW_PREFIX}/var/www. The reason we symlink instead of patching + # is so the user can redirect it easily to something else if they choose. prefix.cd do dst = HOMEBREW_PREFIX/"var/www" if not dst.exist? @@ -85,6 +88,17 @@ class Nginx < Formula end Pathname.new("#{prefix}/html").make_relative_symlink(dst) end + + # for most of this formula’s life the binary has been placed in sbin + # and Homebrew used to suggest the user copy the plist for nginx to their + # ~/Library/LaunchAgents directory. So we need to have a symlink there + # for such cases + if (HOMEBREW_CELLAR/'nginx').subdirs.any?{|d| (d/:sbin).directory? } + sbin.mkpath + sbin.cd do + (sbin/'nginx').make_relative_symlink(bin/'nginx') + end + end end def caveats; <<-EOS.undent |
