aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/passenger.rb27
1 files changed, 17 insertions, 10 deletions
diff --git a/Library/Formula/passenger.rb b/Library/Formula/passenger.rb
index 650bdb108..af79b8abb 100644
--- a/Library/Formula/passenger.rb
+++ b/Library/Formula/passenger.rb
@@ -20,24 +20,30 @@ class Passenger < Formula
libexec.mkpath
cp_r necessary_files, libexec, :preserve => true
- # The various scripts in bin cannot correctly locate their root directory
- # when invoked as symlinks in /usr/local/bin. We create wrapper scripts
- # to solve this problem.
+ # Allow Homebrew to create symlinks for the Phusion Passenger commands.
bin.mkpath
Dir[libexec/"bin/*"].each do |orig_script|
name = File.basename(orig_script)
- (bin/name).write <<-EOS.undent
- #!/bin/sh
- exec #{orig_script} "$@"
- EOS
+ ln_s orig_script, bin/name
end
+
+ # Ensure that the Phusion Passenger commands can always find their library
+ # files.
+ locations_ini = `/usr/bin/ruby ./bin/passenger-config --make-locations-ini`
+ locations_ini.gsub!(/=#{Regexp.compile Dir.pwd}\//, "=#{libexec}/")
+ (libexec/"lib/phusion_passenger/locations.ini").write(locations_ini)
+ system "/usr/bin/ruby", "./dev/install_scripts_bootstrap_code.rb",
+ "--ruby", libexec/"lib", *Dir[libexec/"bin/*"]
+ system "/usr/bin/ruby", "./dev/install_scripts_bootstrap_code.rb",
+ "--nginx-module-config", libexec/"bin", libexec/"ext/nginx/config"
+
mv libexec/'man', share
end
def caveats; <<-EOS.undent
To activate Phusion Passenger for Apache, create /etc/apache2/other/passenger.conf:
LoadModule passenger_module #{opt_prefix}/libexec/buildout/apache2/mod_passenger.so
- PassengerRoot #{opt_prefix}/libexec
+ PassengerRoot #{opt_prefix}/libexec/lib/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/ruby
To activate Phusion Passenger for Nginx, run:
@@ -46,8 +52,9 @@ class Passenger < Formula
end
test do
- if `#{HOMEBREW_PREFIX}/bin/passenger-config --root`.strip != libexec.to_s
- raise "Invalid root path"
+ ruby_libdir = `#{HOMEBREW_PREFIX}/bin/passenger-config --ruby-libdir`.strip
+ if ruby_libdir != (libexec/"lib").to_s
+ raise "Invalid installation"
end
end
end