aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorHongli Lai (Phusion)2014-01-04 00:50:42 +0100
committerMike McQuaid2014-01-04 13:41:35 +0000
commit647bc623eeead6aa65e363f9eb217f2d22dd1954 (patch)
tree0b17be153ab7d9234ad19d79f70117330b9bb0ff /Library
parent59316ccf6a7596cef7246cd49d120dea97cf440b (diff)
downloadhomebrew-647bc623eeead6aa65e363f9eb217f2d22dd1954.tar.bz2
passenger: remove wrapper scripts because they cause problems.
Instead, create a locations.ini so that Passenger can always find its own libraries. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
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