passenger: install whitelisted files to libexec.

Closes #22514.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Hongli Lai (Phusion) authored and Mike McQuaid committed 2013-09-14 08:43:51 +01:00
1 parent f2f5e1701e
commit ddbdacf07e
1 file changed
+12 -7
+12 -7
View File
@@ -12,26 +12,31 @@ class Passenger < Formula
def install
rake "apache2"
rake "nginx"
cp_r Dir["*"], prefix, :preserve => true
necessary_files = Dir["configure", "Rakefile", "README.md", "CONTRIBUTORS",
"CONTRIBUTING.md", "LICENSE", "INSTALL.md", "NEWS", "passenger.gemspec",
"build", "lib", "bin", "doc", "man", "helper-scripts", "ext",
"resources", "buildout"]
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.
mv bin, libexec
mkdir bin
Dir[libexec/"*"].each do |orig_script|
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
end
mv prefix/'man', share
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}/buildout/apache2/mod_passenger.so
LoadModule passenger_module #{opt_prefix}/libexec/buildout/apache2/mod_passenger.so
PassengerRoot #{opt_prefix}
PassengerDefaultRuby /usr/bin/ruby
@@ -41,7 +46,7 @@ class Passenger < Formula
end
test do
if `#{HOMEBREW_PREFIX}/bin/passenger-config --root`.strip != prefix.to_s
if `#{HOMEBREW_PREFIX}/bin/passenger-config --root`.strip != libexec.to_s
raise "Invalid root path"
end
end