[rubygem-passenger] initial commit for passenger 3.0.14

Brett Lentz wakko666 at fedoraproject.org
Thu Sep 6 18:44:51 UTC 2012


commit 8d15f25751c2aa21e48632521717f8a8ccd7548f
Author: Brett Lentz <blentz at redhat.com>
Date:   Thu Sep 6 14:44:38 2012 -0400

    initial commit for passenger 3.0.14

 .gitignore                                         |    1 +
 apache-passenger.conf.in                           |   19 +
 passenger.logrotate                                |    7 +
 passenger_apache_fix_autofoo.patch                 |   14 +
 passenger_boost_xtime.patch                        |  190 +++++++++
 passenger_dynamic_thread_group.patch               |   16 +
 passenger_fixdeps.patch                            |   36 ++
 passenger_rspec2_helper.patch                      |  103 +++++
 rubygem-passenger-3.0.12-asciidoc-skip-html5.patch |   12 +
 rubygem-passenger-3.0.12-force-native.patch        |   81 ++++
 ...-passenger-3.0.12-gcc47-include-sys_types.patch |   55 +++
 rubygem-passenger-3.0.12-spawn-ip.patch            |  272 ++++++++++++
 rubygem-passenger-3.0.12-spoof-nginx-install.patch |   51 +++
 ...-passenger-3.0.14-gcc47-include-sys_types.patch |   44 ++
 rubygem-passenger.spec                             |  432 ++++++++++++++++++++
 rubygem-passenger.tmpfiles                         |    1 +
 sources                                            |    1 +
 17 files changed, 1335 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..e78a2a2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/passenger-3.0.14.tar.gz
diff --git a/apache-passenger.conf.in b/apache-passenger.conf.in
new file mode 100644
index 0000000..9eaea1a
--- /dev/null
+++ b/apache-passenger.conf.in
@@ -0,0 +1,19 @@
+LoadModule passenger_module modules/mod_passenger.so
+<IfModule mod_passenger.c>
+   PassengerRoot @PASSENGERROOT@
+   PassengerRuby /usr/bin/ruby
+</IfModule>
+
+# Deploying a Ruby on Rails application: an example
+
+# Suppose you have a Rails application in /somewhere. Add a virtual host to
+# your Apache configuration file and set its DocumentRoot to /somewhere/public:
+#
+#    <VirtualHost *:80>
+#       ServerName www.yourhost.com
+#       DocumentRoot /somewhere/public    # <-- be sure to point to 'public'!
+#       <Directory /somewhere/public>
+#          AllowOverride all              # <-- relax Apache security settings
+#          Options -MultiViews            # <-- MultiViews must be turned off
+#       </Directory>
+#    </VirtualHost>
diff --git a/passenger.logrotate b/passenger.logrotate
new file mode 100644
index 0000000..a6cc52b
--- /dev/null
+++ b/passenger.logrotate
@@ -0,0 +1,7 @@
+/var/log/passenger-analytics/*.log {
+    missingok
+    notifempty
+    sharedscripts
+    compress
+    delaycompress
+}
diff --git a/passenger_apache_fix_autofoo.patch b/passenger_apache_fix_autofoo.patch
new file mode 100644
index 0000000..e244e8f
--- /dev/null
+++ b/passenger_apache_fix_autofoo.patch
@@ -0,0 +1,14 @@
+--- build/config.rb.orig	2012-08-14 16:40:28.375910357 -0400
++++ build/config.rb	2012-08-14 16:41:29.850088472 -0400
+@@ -26,9 +26,9 @@
+ CXX      = string_option("CXX", "g++")
+ # TODO: consider -fcommon
+ if OPTIMIZE
+-	OPTIMIZATION_FLAGS = "#{PlatformInfo.debugging_cflags} -O2 -DBOOST_DISABLE_ASSERTS".strip
++	OPTIMIZATION_FLAGS = "#{ENV['CXXFLAGS']} #{PlatformInfo.debugging_cflags} -O2 -DBOOST_DISABLE_ASSERTS".strip
+ else
+-	OPTIMIZATION_FLAGS = "#{PlatformInfo.debugging_cflags} -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS".strip
++	OPTIMIZATION_FLAGS = "#{ENV['CXXFLAGS']} #{PlatformInfo.debugging_cflags} -DPASSENGER_DEBUG -DBOOST_DISABLE_ASSERTS".strip
+ end
+ 
+ # Extra compiler flags that should always be passed to the C/C++ compiler.
diff --git a/passenger_boost_xtime.patch b/passenger_boost_xtime.patch
new file mode 100644
index 0000000..50f6eb6
--- /dev/null
+++ b/passenger_boost_xtime.patch
@@ -0,0 +1,190 @@
+diff --git a/ext/boost/config/suffix.hpp b/ext/boost/config/suffix.hpp
+index 3408d22..f7ab900 100644
+--- a/ext/boost/config/suffix.hpp
++++ b/ext/boost/config/suffix.hpp
+@@ -103,6 +103,19 @@
+ #endif
+ 
+ //
++// constexpr workarounds
++// 
++#if defined(BOOST_NO_CONSTEXPR)
++#define BOOST_CONSTEXPR
++#define BOOST_CONSTEXPR_OR_CONST const
++#else
++#define BOOST_CONSTEXPR constexpr
++#define BOOST_CONSTEXPR_OR_CONST constexpr
++#endif
++
++#define BOOST_STATIC_CONSTEXPR  static BOOST_CONSTEXPR_OR_CONST
++
++//
+ // if there is no __int64 then there is no specialisation
+ // for numeric_limits<__int64> either:
+ //
+diff --git a/ext/boost/src/pthread/thread.cpp b/ext/boost/src/pthread/thread.cpp
+index b5a0572..f06d3b9 100644
+--- a/ext/boost/src/pthread/thread.cpp
++++ b/ext/boost/src/pthread/thread.cpp
+@@ -24,7 +24,7 @@
+ #endif
+ #include <cassert>
+ 
+-#include "timeconv.inl"
++#include <boost/src/pthread/timeconv.inl>
+ 
+ namespace boost
+ {
+@@ -365,7 +365,7 @@ namespace boost
+                     cond.timed_wait(lock, xt);
+ #   endif
+                     xtime cur;
+-                    xtime_get(&cur, TIME_UTC);
++                    xtime_get(&cur, TIME_UTC_);
+                     if (xtime_cmp(xt, cur) <= 0)
+                         return;
+                 }
+@@ -380,7 +380,7 @@ namespace boost
+             BOOST_VERIFY(!pthread_yield());
+ #   else
+             xtime xt;
+-            xtime_get(&xt, TIME_UTC);
++            xtime_get(&xt, TIME_UTC_);
+             sleep(xt);
+ #   endif
+         }
+diff --git a/ext/boost/src/pthread/timeconv.inl b/ext/boost/src/pthread/timeconv.inl
+index b75a135..7c07802 100644
+--- a/ext/boost/src/pthread/timeconv.inl
++++ b/ext/boost/src/pthread/timeconv.inl
+@@ -20,8 +20,8 @@ const int NANOSECONDS_PER_MICROSECOND = 1000;
+ inline void to_time(int milliseconds, boost::xtime& xt)
+ {
+     int res = 0;
+-    res = boost::xtime_get(&xt, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC);
++    res = boost::xtime_get(&xt, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_);
+ 
+     xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+     xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+@@ -57,8 +57,8 @@ inline void to_timespec_duration(const boost::xtime& xt, timespec& ts)
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+     {
+@@ -88,8 +88,8 @@ inline void to_duration(boost::xtime xt, int& milliseconds)
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         milliseconds = 0;
+@@ -110,8 +110,8 @@ inline void to_microduration(boost::xtime xt, int& microseconds)
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         microseconds = 0;
+diff --git a/ext/boost/thread/detail/config.hpp b/ext/boost/thread/detail/config.hpp
+index 4015a6c..7b5f82c 100644
+--- a/ext/boost/thread/detail/config.hpp
++++ b/ext/boost/thread/detail/config.hpp
+@@ -17,7 +17,7 @@
+ #  pragma warn -8066 // Unreachable code
+ #endif
+ 
+-#include "platform.hpp"
++#include <boost/thread/detail/platform.hpp>
+ 
+ // provided for backwards compatibility, since this
+ // macro was used for several releases by mistake.
+diff --git a/ext/boost/thread/locks.hpp b/ext/boost/thread/locks.hpp
+index dd66a67..d77b145 100644
+--- a/ext/boost/thread/locks.hpp
++++ b/ext/boost/thread/locks.hpp
+@@ -164,9 +164,9 @@ namespace boost
+     struct adopt_lock_t
+     {};
+     
+-    const defer_lock_t defer_lock={};
+-    const try_to_lock_t try_to_lock={};
+-    const adopt_lock_t adopt_lock={};
++    BOOST_CONSTEXPR_OR_CONST defer_lock_t defer_lock={};
++    BOOST_CONSTEXPR_OR_CONST try_to_lock_t try_to_lock={};
++    BOOST_CONSTEXPR_OR_CONST adopt_lock_t adopt_lock={};
+ 
+     template<typename Mutex>
+     class shared_lock;
+diff --git a/ext/boost/thread/xtime.hpp b/ext/boost/thread/xtime.hpp
+index 7cc6272..1ca996f 100644
+--- a/ext/boost/thread/xtime.hpp
++++ b/ext/boost/thread/xtime.hpp
+@@ -2,7 +2,7 @@
+ // William E. Kempf
+ // Copyright (C) 2007-8 Anthony Williams
+ //
+-//  Distributed under the Boost Software License, Version 1.0. (See accompanying 
++//  Distributed under the Boost Software License, Version 1.0. (See accompanying
+ //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ 
+ #ifndef BOOST_XTIME_WEK070601_HPP
+@@ -20,7 +20,7 @@ namespace boost {
+ 
+ enum xtime_clock_types
+ {
+-    TIME_UTC=1
++    TIME_UTC_=1
+ //    TIME_TAI,
+ //    TIME_MONOTONIC,
+ //    TIME_PROCESS,
+@@ -53,14 +53,14 @@ struct xtime
+         boost::posix_time::microseconds((nsec+500)/1000);
+ #endif
+     }
+-    
++
+ };
+ 
+ inline xtime get_xtime(boost::system_time const& abs_time)
+ {
+     xtime res;
+     boost::posix_time::time_duration const time_since_epoch=abs_time-boost::posix_time::from_time_t(0);
+-            
++
+     res.sec=static_cast<xtime::xtime_sec_t>(time_since_epoch.total_seconds());
+     res.nsec=static_cast<xtime::xtime_nsec_t>(time_since_epoch.fractional_seconds()*(1000000000/time_since_epoch.ticks_per_second()));
+     return res;
+@@ -68,7 +68,7 @@ inline xtime get_xtime(boost::system_time const& abs_time)
+ 
+ inline int xtime_get(struct xtime* xtp, int clock_type)
+ {
+-    if (clock_type == TIME_UTC)
++    if (clock_type == TIME_UTC_)
+     {
+         *xtp=get_xtime(get_system_time());
+         return clock_type;
+@@ -81,7 +81,7 @@ inline int xtime_cmp(const xtime& xt1, const xtime& xt2)
+ {
+     if (xt1.sec == xt2.sec)
+         return (int)(xt1.nsec - xt2.nsec);
+-    else 
++    else
+         return (xt1.sec > xt2.sec) ? 1 : -1;
+ }
+ 
diff --git a/passenger_dynamic_thread_group.patch b/passenger_dynamic_thread_group.patch
new file mode 100644
index 0000000..134a304
--- /dev/null
+++ b/passenger_dynamic_thread_group.patch
@@ -0,0 +1,16 @@
+diff --git a/test/oxt/dynamic_thread_group_test.cpp b/test/oxt/dynamic_thread_group_test.cpp
+index 003b7ef..5a90463 100644
+--- a/test/oxt/dynamic_thread_group_test.cpp
++++ b/test/oxt/dynamic_thread_group_test.cpp
+@@ -103,9 +103,9 @@ namespace tut {
+ 	}
+ 	
+ 	static void create_threads(dynamic_thread_group *group) {
+-		for (int i = 1000; i >= 0; i--) {
++		for (int i = 100; i >= 0; i--) {
+ 			boost::function<void ()> f(boost::bind(do_nothing, i * 1000));
+-			group->create_thread(f, "", 256 * 1024);
++			group->create_thread(f, "", 8 * 1024);
+ 		}
+ 	}
+ 	
diff --git a/passenger_fixdeps.patch b/passenger_fixdeps.patch
new file mode 100644
index 0000000..b0fdddb
--- /dev/null
+++ b/passenger_fixdeps.patch
@@ -0,0 +1,36 @@
+diff --git a/build/packaging.rb b/build/packaging.rb
+index aa63b56..25c934a 100644
+--- a/build/packaging.rb
++++ b/build/packaging.rb
+@@ -41,8 +41,7 @@ spec = Gem::Specification.new do |s|
+ 	s.email = "info at phusion.nl"
+ 	s.require_paths = ["lib"]
+ 	s.add_dependency 'rake', '>= 0.8.1'
+-	s.add_dependency 'fastthread', '>= 1.0.1'
+-	s.add_dependency 'daemon_controller', '>= 1.0.0'
++	s.add_dependency 'daemon_controller', '>= 0.2.5'
+ 	s.add_dependency 'rack'
+ 	s.files = FileList[*Packaging::GLOB] - FileList[*Packaging::EXCLUDE_GLOB]
+ 	s.executables = Packaging::USER_EXECUTABLES + Packaging::SUPER_USER_EXECUTABLES
+diff --git a/lib/phusion_passenger/dependencies.rb b/lib/phusion_passenger/dependencies.rb
+index e37a212..f39e8ff 100644
+--- a/lib/phusion_passenger/dependencies.rb
++++ b/lib/phusion_passenger/dependencies.rb
+@@ -578,7 +578,7 @@ module Dependencies # :nodoc: all
+ 	end
+ 	
+ 	Daemon_Controller = Dependency.new do |dep|
+-		dep.name = "daemon_controller >= 1.0.0"
++		dep.name = "daemon_controller >= 0.2.5"
+ 		dep.install_instructions = "Please install RubyGems first, then run " <<
+ 			"<b>#{PlatformInfo.gem_command || "gem"} install daemon_controller</b>"
+ 		dep.define_checker do |result|
+@@ -590,7 +590,7 @@ module Dependencies # :nodoc: all
+ 				require 'daemon_controller'
+ 				begin
+ 					require 'daemon_controller/version'
+-					too_old = DaemonController::VERSION_STRING < '1.0.0'
++					too_old = DaemonController::VERSION_STRING < '0.2.5'
+ 				rescue LoadError
+ 					too_old = true
+ 				end
diff --git a/passenger_rspec2_helper.patch b/passenger_rspec2_helper.patch
new file mode 100644
index 0000000..6863dd3
--- /dev/null
+++ b/passenger_rspec2_helper.patch
@@ -0,0 +1,103 @@
+diff --git a/test/ruby/classic_rails/application_spawner_spec.rb b/test/ruby/classic_rails/application_spawner_spec.rb
+index 20355b1..415456d 100644
+--- a/test/ruby/classic_rails/application_spawner_spec.rb
++++ b/test/ruby/classic_rails/application_spawner_spec.rb
+@@ -37,8 +37,8 @@ describe ClassicRails::ApplicationSpawner do
+ 			it_should_behave_like "a spawner"
+ 			it_should_behave_like "a spawner that does not preload app code"
+ 			it_should_behave_like "a Rails spawner"
+-			include_shared_example_group "a Rails app that lacks RAILS_GEM_VERSION"
+-			include_shared_example_group "analytics logging extensions for Rails"
++			it_should_behave_like "a Rails app that lacks RAILS_GEM_VERSION"
++			it_should_behave_like "analytics logging extensions for Rails"
+ 		end
+ 	end
+ 	
+@@ -80,8 +80,8 @@ describe ClassicRails::ApplicationSpawner do
+ 			it_should_behave_like "a spawner"
+ 			it_should_behave_like "a spawner that preloads app code"
+ 			it_should_behave_like "a Rails spawner"
+-			include_shared_example_group "a Rails app that lacks RAILS_GEM_VERSION"
+-			include_shared_example_group "analytics logging extensions for Rails"
++			it_should_behave_like "a Rails app that lacks RAILS_GEM_VERSION"
++			it_should_behave_like "analytics logging extensions for Rails"
+ 		end
+ 	end
+ end
+diff --git a/test/ruby/rack/application_spawner_spec.rb b/test/ruby/rack/application_spawner_spec.rb
+index 7da120a..a8040ab 100644
+--- a/test/ruby/rack/application_spawner_spec.rb
++++ b/test/ruby/rack/application_spawner_spec.rb
+@@ -48,7 +48,7 @@ describe Rack::ApplicationSpawner do
+ 				return register_app(app)
+ 			end
+ 			
+-			include_shared_example_group "analytics logging extensions for Rails"
++			it_should_behave_like "analytics logging extensions for Rails"
+ 		end
+ 	end
+ 	
+@@ -108,7 +108,7 @@ describe Rack::ApplicationSpawner do
+ 				return register_app(app)
+ 			end
+ 			
+-			include_shared_example_group "analytics logging extensions for Rails"
++			it_should_behave_like "analytics logging extensions for Rails"
+ 		end
+ 	end
+ end
+diff --git a/test/ruby/spawn_manager_spec.rb b/test/ruby/spawn_manager_spec.rb
+index 6140fc3..987a020 100644
+--- a/test/ruby/spawn_manager_spec.rb
++++ b/test/ruby/spawn_manager_spec.rb
+@@ -69,7 +69,7 @@ describe SpawnManager do
+ 			it_should_behave_like "a Rails spawner"
+ 			it_should_behave_like "a Rails spawner that supports #reload(app_group_name)"
+ 			it_should_behave_like "a Rails spawner that supports #reload()"
+-			include_shared_example_group "a Rails app that lacks RAILS_GEM_VERSION"
++			it_should_behave_like "a Rails app that lacks RAILS_GEM_VERSION"
+ 		end
+ 		
+ 		describe "smart-lv2 spawning" do
+@@ -81,7 +81,7 @@ describe SpawnManager do
+ 			it_should_behave_like "a Rails spawner"
+ 			it_should_behave_like "a Rails spawner that supports #reload(app_group_name)"
+ 			it_should_behave_like "a Rails spawner that supports #reload()"
+-			include_shared_example_group "a Rails app that lacks RAILS_GEM_VERSION"
++			it_should_behave_like "a Rails app that lacks RAILS_GEM_VERSION"
+ 		end
+ 		
+ 		describe "conservative spawning" do
+@@ -92,7 +92,7 @@ describe SpawnManager do
+ 			it_should_behave_like "a spawner"
+ 			it_should_behave_like "a Rails spawner"
+ 			it_should_behave_like "a Rails spawner that supports #reload()"
+-			include_shared_example_group "a Rails app that lacks RAILS_GEM_VERSION"
++			it_should_behave_like "a Rails app that lacks RAILS_GEM_VERSION"
+ 		end
+ 	end
+ 	
+diff --git a/test/ruby/spec_helper.rb b/test/ruby/spec_helper.rb
+index 563b921..376476c 100644
+--- a/test/ruby/spec_helper.rb
++++ b/test/ruby/spec_helper.rb
+@@ -36,8 +36,8 @@ trap "QUIT" do
+ 	puts caller
+ end
+ 
+-Spec::Runner.configure do |config|
+-	config.append_before do
++RSpec.configure do |config|
++	config.before do
+ 		# Suppress warning messages.
+ 		PhusionPassenger::DebugLogging.log_level = -1
+ 		PhusionPassenger::DebugLogging.log_file = nil
+@@ -47,7 +47,7 @@ Spec::Runner.configure do |config|
+ 		PhusionPassenger::Utils.passenger_tmpdir
+ 	end
+ 	
+-	config.append_after do
++	config.after do
+ 		tmpdir = PhusionPassenger::Utils.passenger_tmpdir(false)
+ 		if File.exist?(tmpdir)
+ 			remove_dir_tree(tmpdir)
diff --git a/rubygem-passenger-3.0.12-asciidoc-skip-html5.patch b/rubygem-passenger-3.0.12-asciidoc-skip-html5.patch
new file mode 100644
index 0000000..8d156ad
--- /dev/null
+++ b/rubygem-passenger-3.0.12-asciidoc-skip-html5.patch
@@ -0,0 +1,12 @@
+diff -ur passenger-3.0.12.orig/build/documentation.rb passenger-3.0.12/build/documentation.rb
+--- passenger-3.0.12.orig/build/documentation.rb	2012-02-03 22:25:41.000000000 +0000
++++ passenger-3.0.12/build/documentation.rb	2012-04-14 14:12:16.335454392 +0100
+@@ -21,7 +21,7 @@
+ #  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ #  THE SOFTWARE.
+ 
+-ASCIIDOC_FLAGS = "-b html5 -a toc -a theme=flask -a numbered -a toclevels=3 -a icons"
++ASCIIDOC_FLAGS = "-a toc -a theme=flask -a numbered -a toclevels=3 -a icons"
+ 
+ desc "Generate all documentation"
+ task :doc => Packaging::ASCII_DOCS
diff --git a/rubygem-passenger-3.0.12-force-native.patch b/rubygem-passenger-3.0.12-force-native.patch
new file mode 100644
index 0000000..9adf421
--- /dev/null
+++ b/rubygem-passenger-3.0.12-force-native.patch
@@ -0,0 +1,81 @@
+diff --git a/ext/common/ResourceLocator.h b/ext/common/ResourceLocator.h
+index ae75261..a445ad0 100644
+--- a/ext/common/ResourceLocator.h
++++ b/ext/common/ResourceLocator.h
+@@ -65,13 +65,13 @@ public:
+ 				!fileExists(root + "/DEVELOPERS.TXT");
+ 			
+ 			if (nativelyPackaged) {
+-				agentsDir           = "/usr/lib/phusion-passenger/agents";
+-				helperScriptsDir    = "/usr/share/phusion-passenger/helper-scripts";
+-				resourcesDir        = "/usr/share/phusion-passenger";
+-				docDir              = "/usr/share/doc/phusion-passenger";
++				agentsDir           = "%%AGENTS_DIR%%";
++				helperScriptsDir    = "%%GEM_INSTALL_DIR%%/helper-scripts";
++				resourcesDir        = "%%GEM_INSTALL_DIR%%";
++				docDir              = "%%GEM_INSTALL_DIR%%/doc";
+ 				rubyLibDir          = "";
+-				compilableSourceDir = "/usr/share/phusion-passenger/compilable-source";
+-				apache2Module       = "/usr/lib/apache2/modules/mod_passenger.so";
++				compilableSourceDir = "%%GEM_INSTALL_DIR%%";
++				apache2Module       = "%%APACHE_INSTALLED_MOD%%";
+ 			} else {
+ 				agentsDir           = root + "/agents";
+ 				helperScriptsDir    = root + "/helper-scripts";
+diff --git a/lib/phusion_passenger.rb b/lib/phusion_passenger.rb
+index 28265df..d9a3c40 100644
+--- a/lib/phusion_passenger.rb
++++ b/lib/phusion_passenger.rb
+@@ -39,11 +39,11 @@ module PhusionPassenger
+ 	# using the OS's native package management system, i.e. as opposed
+ 	# to being installed from source or with RubyGems.
+ 	def self.natively_packaged?
+-		if !defined?(@natively_packaged)
+-			@natively_packaged = !File.exist?("#{LIBDIR}/../Rakefile") ||
+-			                     !File.exist?("#{LIBDIR}/../DEVELOPERS.TXT")
+-		end
+-		return @natively_packaged
++               if !defined?(@natively_packaged)
++                       @natively_packaged = !File.exist?("#{LIBDIR}/../Rakefile") ||
++                                            !File.exist?("#{LIBDIR}/../DEVELOPERS.TXT")
++               end
++               return @natively_packaged
+ 	end
+ 	
+ 	NATIVELY_PACKAGED_SOURCE_ROOT        = "/usr/share/phusion-passenger/source"
+@@ -94,12 +94,13 @@ module PhusionPassenger
+ 		# Not available when natively packaged.
+ 		NATIVE_SUPPORT_DIR = File.join(SOURCE_ROOT, "ext", "ruby")
+ 	else
+-		SOURCE_ROOT        = NATIVELY_PACKAGED_SOURCE_ROOT
+-		DOCDIR             = NATIVELY_PACKAGED_DOCDIR
+-		RESOURCES_DIR      = NATIVELY_PACKAGED_RESOURCES_DIR
+-		AGENTS_DIR         = NATIVELY_PACKAGED_AGENTS_DIR
+-		HELPER_SCRIPTS_DIR = NATIVELY_PACKAGED_HELPER_SCRIPTS_DIR
+-		APACHE2_MODULE     = NATIVELY_PACKAGED_APACHE2_MODULE
++		SOURCE_ROOT        = '%%GEM_INSTALL_DIR%%'
++		DOCDIR             = "#{SOURCE_ROOT}/doc"
++		RESOURCES_DIR      = "#{SOURCE_ROOT}/resources"
++		AGENTS_DIR         = '%%AGENTS_DIR%%'
++		HELPER_SCRIPTS_DIR = "#{SOURCE_ROOT}/helper-scripts"
++		APACHE2_MODULE     = '%%APACHE_INSTALLED_MOD%%'
++		NATIVE_SUPPORT_DIR = "%%NATIVE_SUPPORT_DIR%%"
+ 	end
+ 	
+ 	
+diff --git a/lib/phusion_passenger/native_support.rb b/lib/phusion_passenger/native_support.rb
+index f1edf1c..4312d01 100644
+--- a/lib/phusion_passenger/native_support.rb
++++ b/lib/phusion_passenger/native_support.rb
+@@ -38,10 +38,7 @@ class NativeSupportLoader
+ 
+ private
+ 	def archdir
+-		@archdir ||= begin
+-			require 'phusion_passenger/platform_info/binary_compatibility'
+-			PlatformInfo.ruby_extension_binary_compatibility_ids.join("-")
+-		end
++		@archdir ||= 'native'
+ 	end
+ 	
+ 	def libext
diff --git a/rubygem-passenger-3.0.12-gcc47-include-sys_types.patch b/rubygem-passenger-3.0.12-gcc47-include-sys_types.patch
new file mode 100644
index 0000000..f559ee4
--- /dev/null
+++ b/rubygem-passenger-3.0.12-gcc47-include-sys_types.patch
@@ -0,0 +1,55 @@
+diff -ur passenger-3.0.12.orig/ext/common/EventedMessageServer.h passenger-3.0.12/ext/common/EventedMessageServer.h
+--- passenger-3.0.12.orig/ext/common/EventedMessageServer.h	2012-02-03 22:25:43.000000000 +0000
++++ passenger-3.0.12/ext/common/EventedMessageServer.h	2012-04-14 16:13:13.847359596 +0100
+@@ -27,6 +27,7 @@
+ 
+ #include <boost/shared_ptr.hpp>
+ #include <ev++.h>
++#include <sys/types.h>
+ #include <cstdarg>
+ #include <cstdlib>
+ #ifdef HAS_ALLOCA_H_
+diff -ur passenger-3.0.12.orig/ext/common/FileDescriptor.h passenger-3.0.12/ext/common/FileDescriptor.h
+--- passenger-3.0.12.orig/ext/common/FileDescriptor.h	2012-04-13 09:09:57.000000000 +0100
++++ passenger-3.0.12/ext/common/FileDescriptor.h	2012-04-14 16:13:29.610319317 +0100
+@@ -30,6 +30,7 @@
+ #include <oxt/system_calls.hpp>
+ 
+ #include <utility>
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <cerrno>
+ 
+diff -ur passenger-3.0.12.orig/ext/common/StaticString.h passenger-3.0.12/ext/common/StaticString.h
+--- passenger-3.0.12.orig/ext/common/StaticString.h	2012-04-13 09:09:57.000000000 +0100
++++ passenger-3.0.12/ext/common/StaticString.h	2012-04-14 16:12:22.824489975 +0100
+@@ -25,6 +25,7 @@
+ #ifndef _PASSENGER_STATIC_STRING_H_
+ #define _PASSENGER_STATIC_STRING_H_
+ 
++#include <sys/types.h>
+ #include <string>
+ #include <cstring>
+ #include <cstddef>
+diff -ur passenger-3.0.12.orig/ext/common/Utils/BufferedIO.h passenger-3.0.12/ext/common/Utils/BufferedIO.h
+--- passenger-3.0.12.orig/ext/common/Utils/BufferedIO.h	2012-02-03 22:25:44.000000000 +0000
++++ passenger-3.0.12/ext/common/Utils/BufferedIO.h	2012-04-14 16:13:45.767278031 +0100
+@@ -1,6 +1,7 @@
+ #ifndef _PASSENGER_BUFFERED_IO_H_
+ #define _PASSENGER_BUFFERED_IO_H_
+ 
++#include <sys/types.h>
+ #include <string>
+ #include <utility>
+ #include <algorithm>
+diff -ur passenger-3.0.12.orig/ext/common/Utils/StreamBoyerMooreHorspool.h passenger-3.0.12/ext/common/Utils/StreamBoyerMooreHorspool.h
+--- passenger-3.0.12.orig/ext/common/Utils/StreamBoyerMooreHorspool.h	2012-02-03 22:25:44.000000000 +0000
++++ passenger-3.0.12/ext/common/Utils/StreamBoyerMooreHorspool.h	2012-04-14 16:14:09.153218272 +0100
+@@ -190,6 +190,7 @@
+ #endif
+ 
+ 
++#include <sys/types.h>
+ #include <cstddef>
+ #include <cstring>
+ #include <cassert>
diff --git a/rubygem-passenger-3.0.12-spawn-ip.patch b/rubygem-passenger-3.0.12-spawn-ip.patch
new file mode 100644
index 0000000..5ae25d5
--- /dev/null
+++ b/rubygem-passenger-3.0.12-spawn-ip.patch
@@ -0,0 +1,272 @@
+diff -Npru passenger-orig/ext/apache2/Configuration.cpp passenger-wc/ext/apache2/Configuration.cpp
+--- passenger-orig/ext/apache2/Configuration.cpp	2012-03-05 17:33:31.162658085 -0800
++++ passenger-wc/ext/apache2/Configuration.cpp	2012-03-05 17:38:37.164628243 -0800
+@@ -272,6 +272,7 @@ passenger_config_merge_dir(apr_pool_t *p
+ 
+ DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_root, root)
+ DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_ruby, ruby)
++DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_spawn_ipaddress, spawnIPAddress)
+ DEFINE_SERVER_INT_CONFIG_SETTER(cmd_passenger_log_level, logLevel, unsigned int, 0)
+ DEFINE_SERVER_STR_CONFIG_SETTER(cmd_passenger_debug_log_file, debugLogFile)
+ DEFINE_SERVER_INT_CONFIG_SETTER(cmd_passenger_max_pool_size, maxPoolSize, unsigned int, 1)
+@@ -474,6 +475,11 @@ const command_rec passenger_commands[] =
+ 		NULL,
+ 		RSRC_CONF,
+ 		"The Ruby interpreter to use."),
++	AP_INIT_TAKE1("PassengerSpawnIPAddress",
++		(Take1Func) cmd_passenger_spawn_ipaddress,
++		NULL,
++		RSRC_CONF,
++		"The IP address to bind to."),
+ 	AP_INIT_TAKE1("PassengerLogLevel",
+ 		(Take1Func) cmd_passenger_log_level,
+ 		NULL,
+diff -Npru passenger-orig/ext/apache2/Configuration.hpp passenger-wc/ext/apache2/Configuration.hpp
+--- passenger-orig/ext/apache2/Configuration.hpp	2012-03-05 17:33:31.162658085 -0800
++++ passenger-wc/ext/apache2/Configuration.hpp	2012-03-05 17:38:37.165628242 -0800
+@@ -367,6 +367,9 @@ struct DirConfig {
+ struct ServerConfig {
+ 	/** The filename of the Ruby interpreter to use. */
+ 	const char *ruby;
++
++	/** The IP Address to bind to. */
++	const char *spawnIPAddress;
+ 	
+ 	/** The Passenger root folder. */
+ 	const char *root;
+@@ -416,6 +419,7 @@ struct ServerConfig {
+ 	
+ 	ServerConfig() {
+ 		ruby               = "ruby";
++		spawnIPAddress     = "127.0.0.1";
+ 		root               = NULL;
+ 		logLevel           = DEFAULT_LOG_LEVEL;
+ 		debugLogFile       = NULL;
+diff -Npru passenger-orig/ext/apache2/HelperAgent.cpp passenger-wc/ext/apache2/HelperAgent.cpp
+--- passenger-orig/ext/apache2/HelperAgent.cpp	2012-03-05 17:33:31.162658085 -0800
++++ passenger-wc/ext/apache2/HelperAgent.cpp	2012-03-05 17:38:37.165628242 -0800
+@@ -245,7 +245,8 @@ public:
+ 			accountsDatabase, rubyCommand,
+ 			analyticsLogger,
+ 			options.getInt("log_level"),
+-			options.get("debug_log_file", false)
++			options.get("debug_log_file", false),
++			options.get("spawn_ipaddress")
+ 		));
+ 		pool->setMax(maxPoolSize);
+ 		pool->setMaxPerApp(maxInstancesPerApp);
+diff -Npru passenger-orig/ext/apache2/Hooks.cpp passenger-wc/ext/apache2/Hooks.cpp
+--- passenger-orig/ext/apache2/Hooks.cpp	2012-03-05 17:33:31.162658085 -0800
++++ passenger-wc/ext/apache2/Hooks.cpp	2012-03-05 17:48:25.902486295 -0800
+@@ -1401,7 +1401,8 @@ public:
+ 			serverConfig.unionStationGatewayCert,
+ 			serverConfig.unionStationProxyAddress,
+ 			serverConfig.unionStationProxyType,
+-			serverConfig.prestartURLs);
++			serverConfig.prestartURLs,
++			serverConfig.spawnIPAddress);
+ 		
+ 		analyticsLogger = ptr(new AnalyticsLogger(agentsStarter.getLoggingSocketAddress(),
+ 			"logging", agentsStarter.getLoggingSocketPassword()));
+diff -Npru passenger-orig/ext/common/AgentsStarter.cpp passenger-wc/ext/common/AgentsStarter.cpp
+--- passenger-orig/ext/common/AgentsStarter.cpp	2012-03-05 17:33:31.192658083 -0800
++++ passenger-wc/ext/common/AgentsStarter.cpp	2012-03-05 17:38:37.168628242 -0800
+@@ -64,6 +64,7 @@ agents_starter_start(AgentsStarter *as,
+                      const char *unionStationProxyAddress,
+                      const char *unionStationProxyType,
+                      const char **prestartURLs, unsigned int prestartURLsCount,
++                     const char *spawnIPAddress,
+                      const AfterForkCallback afterFork,
+                      void *callbackArgument,
+                      char **errorMessage)
+@@ -96,6 +97,7 @@ agents_starter_start(AgentsStarter *as,
+ 			unionStationProxyAddress,
+ 			unionStationProxyType,
+ 			setOfprestartURLs,
++			spawnIPAddress,
+ 			afterForkFunctionObject);
+ 		return 1;
+ 	} catch (const Passenger::SystemException &e) {
+diff -Npru passenger-orig/ext/common/AgentsStarter.h passenger-wc/ext/common/AgentsStarter.h
+--- passenger-orig/ext/common/AgentsStarter.h	2012-03-05 17:33:31.189658083 -0800
++++ passenger-wc/ext/common/AgentsStarter.h	2012-03-05 17:38:37.168628242 -0800
+@@ -64,6 +64,7 @@ int  agents_starter_start(AgentsStarter
+                           const char *unionStationProxyAddress,
+                           const char *unionStationProxyType,
+                           const char **prestartURLs, unsigned int prestartURLsCount,
++                          const char *spawnIPAddress,
+                           const AfterForkCallback afterFork,
+                           void *callbackArgument,
+                           char **errorMessage);
+diff -Npru passenger-orig/ext/common/AgentsStarter.hpp passenger-wc/ext/common/AgentsStarter.hpp
+--- passenger-orig/ext/common/AgentsStarter.hpp	2012-03-05 17:33:31.190658083 -0800
++++ passenger-wc/ext/common/AgentsStarter.hpp	2012-03-05 17:38:37.169628242 -0800
+@@ -387,6 +387,7 @@ public:
+ 	           const string &unionStationProxyAddress,
+ 	           const string &unionStationProxyType,
+ 	           const set<string> &prestartURLs,
++	           const string &spawnIPAddress,
+ 	           const function<void ()> &afterFork = function<void ()>())
+ 	{
+ 		TRACE_POINT();
+@@ -416,6 +417,7 @@ public:
+ 			.setGid ("web_server_worker_gid", webServerWorkerGid)
+ 			.set    ("passenger_root",  passengerRoot)
+ 			.set    ("ruby",            rubyCommand)
++			.set    ("spawn_ipaddress",  spawnIPAddress)
+ 			.setInt ("max_pool_size",   maxPoolSize)
+ 			.setInt ("max_instances_per_app",     maxInstancesPerApp)
+ 			.setInt ("pool_idle_time",            poolIdleTime)
+diff -Npru passenger-orig/ext/common/ApplicationPool/Pool.h passenger-wc/ext/common/ApplicationPool/Pool.h
+--- passenger-orig/ext/common/ApplicationPool/Pool.h	2012-03-05 17:33:31.189658083 -0800
++++ passenger-wc/ext/common/ApplicationPool/Pool.h	2012-03-05 17:38:37.169628242 -0800
+@@ -1062,7 +1062,8 @@ public:
+ 	     const string &rubyCommand = "ruby",
+ 	     const AnalyticsLoggerPtr &analyticsLogger = AnalyticsLoggerPtr(),
+ 	     int logLevel = 0,
+-	     const string &debugLogFile = ""
++	     const string &debugLogFile = "",
++	     const string &spawnIPAddress = "127.0.0.1"
+ 	) : data(new SharedData()),
+ 		cstat(DEFAULT_MAX_POOL_SIZE),
+ 		lock(data->lock),
+@@ -1079,7 +1080,7 @@ public:
+ 		
+ 		this->spawnManager = ptr(new SpawnManager(spawnServerCommand, generation,
+ 			accountsDatabase, rubyCommand, analyticsLogger, logLevel,
+-			debugLogFile));
++			debugLogFile, spawnIPAddress));
+ 		initialize(analyticsLogger);
+ 	}
+ 	
+diff -Npru passenger-orig/ext/common/SpawnManager.h passenger-wc/ext/common/SpawnManager.h
+--- passenger-orig/ext/common/SpawnManager.h	2012-03-05 17:33:31.189658083 -0800
++++ passenger-wc/ext/common/SpawnManager.h	2012-03-05 17:38:37.170628241 -0800
+@@ -107,6 +107,7 @@ private:
+ 	ServerInstanceDir::GenerationPtr generation;
+ 	AccountsDatabasePtr accountsDatabase;
+ 	string rubyCommand;
++	string spawnIPAddress;
+ 	AnalyticsLoggerPtr analyticsLogger;
+ 	int logLevel;
+ 	string debugLogFile;
+@@ -267,6 +268,7 @@ private:
+ 			}
+ 			writeExact(ownerSocket, toString(logLevel) + "\n");
+ 			writeExact(ownerSocket, debugLogFile + "\n");
++			writeExact(ownerSocket, spawnIPAddress + "\n");
+ 			
+ 			this->ownerSocket    = ownerSocket;
+ 			this->socketFilename = socketFilename;
+@@ -547,13 +549,15 @@ public:
+ 	             const string &rubyCommand = "ruby",
+ 	             const AnalyticsLoggerPtr &analyticsLogger = AnalyticsLoggerPtr(),
+ 	             int logLevel = 0,
+-	             const string &debugLogFile = ""
++	             const string &debugLogFile = "",
++	             const string &spawnIPAddress = "127.0.0.1"
+ 	) {
+ 		TRACE_POINT();
+ 		this->spawnServerCommand = spawnServerCommand;
+ 		this->generation  = generation;
+ 		this->accountsDatabase = accountsDatabase;
+ 		this->rubyCommand = rubyCommand;
++		this->spawnIPAddress = spawnIPAddress;
+ 		this->analyticsLogger = analyticsLogger;
+ 		this->logLevel = logLevel;
+ 		this->debugLogFile = debugLogFile;
+diff -Npru passenger-orig/ext/common/Watchdog.cpp passenger-wc/ext/common/Watchdog.cpp
+--- passenger-orig/ext/common/Watchdog.cpp	2012-03-05 17:33:31.189658083 -0800
++++ passenger-wc/ext/common/Watchdog.cpp	2012-03-05 17:38:37.170628241 -0800
+@@ -75,6 +75,7 @@ static uid_t   webServerWorkerUid;
+ static gid_t   webServerWorkerGid;
+ static string  passengerRoot;
+ static string  rubyCommand;
++static string  spawnIPAddress;
+ static unsigned int maxPoolSize;
+ static unsigned int maxInstancesPerApp;
+ static unsigned int poolIdleTime;
+@@ -592,7 +593,8 @@ protected:
+ 		options.set("request_socket_password", Base64::encode(requestSocketPassword)).
+ 			set("message_socket_password", Base64::encode(messageSocketPassword)).
+ 			set("logging_agent_address", loggingAgentAddress).
+-			set("logging_agent_password", loggingAgentPassword);
++			set("logging_agent_password", loggingAgentPassword).
++			set("spawn_ipaddress", spawnIPAddress);
+ 		options.writeToFd(fd);
+ 	}
+ 	
+@@ -978,6 +980,7 @@ main(int argc, char *argv[]) {
+ 	webServerWorkerGid = agentsOptions.getGid("web_server_worker_gid");
+ 	passengerRoot = agentsOptions.get("passenger_root");
+ 	rubyCommand   = agentsOptions.get("ruby");
++	spawnIPAddress   = agentsOptions.get("spawn_ipaddress");
+ 	maxPoolSize        = agentsOptions.getInt("max_pool_size");
+ 	maxInstancesPerApp = agentsOptions.getInt("max_instances_per_app");
+ 	poolIdleTime       = agentsOptions.getInt("pool_idle_time");
+diff -Npru passenger-orig/ext/nginx/ngx_http_passenger_module.c passenger-wc/ext/nginx/ngx_http_passenger_module.c
+--- passenger-orig/ext/nginx/ngx_http_passenger_module.c	2012-03-05 17:33:31.188658083 -0800
++++ passenger-wc/ext/nginx/ngx_http_passenger_module.c	2012-03-05 17:38:37.171628240 -0800
+@@ -291,6 +291,7 @@ start_helper_server(ngx_cycle_t *cycle)
+         union_station_proxy_address,
+         union_station_proxy_type,
+         (const char **) prestart_uris_ary, passenger_main_conf.prestart_uris->nelts,
++        "127.0.0.1",
+         starting_helper_server_after_fork,
+         cycle,
+         &error_message);
+diff -Npru passenger-orig/helper-scripts/passenger-spawn-server passenger-wc/helper-scripts/passenger-spawn-server
+--- passenger-orig/helper-scripts/passenger-spawn-server	2012-03-05 17:33:31.193658083 -0800
++++ passenger-wc/helper-scripts/passenger-spawn-server	2012-03-05 17:38:37.171628240 -0800
+@@ -47,6 +47,7 @@ begin
+ 		node_name = owner_socket.readline.strip
+ 		log_level = owner_socket.readline.to_i
+ 		debug_log_file = owner_socket.readline.strip
++		spawn_ipaddress = owner_socket.readline.strip
+ 	rescue EOFError
+ 		exit
+ 	end
+@@ -93,6 +94,8 @@ begin
+ 			"node_name" => node_name
+ 		}
+ 	end
++
++	options["spawn_ipaddress"] = spawn_ipaddress
+ 	
+ 	require 'phusion_passenger/spawn_manager'
+ 	spawn_manager = PhusionPassenger::SpawnManager.new(options)
+diff -Npru passenger-orig/lib/phusion_passenger/abstract_request_handler.rb passenger-wc/lib/phusion_passenger/abstract_request_handler.rb
+--- passenger-orig/lib/phusion_passenger/abstract_request_handler.rb	2012-03-05 17:33:31.159658087 -0800
++++ passenger-wc/lib/phusion_passenger/abstract_request_handler.rb	2012-03-05 17:38:37.172628240 -0800
+@@ -174,11 +174,11 @@ class AbstractRequestHandler
+ 			@main_socket_address, @main_socket = create_unix_socket_on_filesystem
+ 			@server_sockets[:main] = [@main_socket_address, 'unix', @main_socket]
+ 		else
+-			@main_socket_address, @main_socket = create_tcp_socket
++			@main_socket_address, @main_socket = create_tcp_socket(options["spawn_ipaddress"])
+ 			@server_sockets[:main] = [@main_socket_address, 'tcp', @main_socket]
+ 		end
+ 		
+-		@http_socket_address, @http_socket = create_tcp_socket
++		@http_socket_address, @http_socket = create_tcp_socket(options["spawn_ipaddress"])
+ 		@server_sockets[:http] = [@http_socket_address, 'tcp', @http_socket]
+ 		
+ 		@owner_pipe = owner_pipe
+@@ -397,13 +397,14 @@ private
+ 		end
+ 	end
+ 	
+-	def create_tcp_socket
++	def create_tcp_socket(spawn_ipaddr = nil)
+ 		# We use "127.0.0.1" as address in order to force
+ 		# TCPv4 instead of TCPv6.
+-		socket = TCPServer.new('127.0.0.1', 0)
++		spawn_ipaddr ||= '127.0.0.1'
++		socket = TCPServer.new(spawn_ipaddr, 0)
+ 		socket.listen(BACKLOG_SIZE)
+ 		socket.close_on_exec!
+-		socket_address = "127.0.0.1:#{socket.addr[1]}"
++		socket_address = "#{spawn_ipaddr}:#{socket.addr[1]}"
+ 		return [socket_address, socket]
+ 	end
+ 
diff --git a/rubygem-passenger-3.0.12-spoof-nginx-install.patch b/rubygem-passenger-3.0.12-spoof-nginx-install.patch
new file mode 100644
index 0000000..ec45580
--- /dev/null
+++ b/rubygem-passenger-3.0.12-spoof-nginx-install.patch
@@ -0,0 +1,51 @@
+diff -ur passenger-3.0.12.orig/bin/passenger-install-nginx-module passenger-3.0.12/bin/passenger-install-nginx-module
+--- passenger-3.0.12.orig/bin/passenger-install-nginx-module	2012-04-13 09:09:57.000000000 +0100
++++ passenger-3.0.12/bin/passenger-install-nginx-module	2012-04-14 18:33:41.906096758 +0100
+@@ -87,7 +87,7 @@
+ 		else
+ 			nginx_source_dir = ask_for_nginx_source_dir
+ 			nginx_prefix = ask_for_nginx_install_prefix
+-			extra_nginx_configure_flags = ask_for_extra_nginx_configure_flags(nginx_prefix)
++            extra_nginx_configure_flags = ENV['NGINX_EXTRA_CONFIGURE_FLAGS}']
+ 		end
+ 		check_whether_we_can_write_to(nginx_prefix) || exit(1)
+ 		nginx_config_already_exists_before_installing = nginx_config_exists?(nginx_prefix)
+@@ -303,8 +303,6 @@
+ 	end
+ 	
+ 	def check_whether_we_can_write_to(dir)
+-		FileUtils.mkdir_p(dir)
+-		File.new("#{dir}/__test__.txt", "w").close
+ 		return true
+ 	rescue
+ 		new_screen
+@@ -327,8 +325,7 @@
+ 			new_screen
+ 			color_puts "<banner>Compiling and installing Nginx...</banner>"
+ 			if !sh(build_nginx_configure_command(prefix, extra_configure_flags)) ||
+-			   !sh("make") ||
+-			   !sh("make install")
++			   !sh("make")
+ 				return false
+ 			end
+ 		end
+@@ -390,16 +387,9 @@
+ 	end
+ 	
+ 	def build_nginx_configure_command(prefix, extra_configure_flags = nil)
+-		command = "sh ./configure --prefix='#{prefix}' "
+-		command << "--with-http_ssl_module "
+-		command << "--with-http_gzip_static_module "
+-		command << "--with-cc-opt='-Wno-error' "
+-		if @pcre_source_dir
+-			command << "--with-pcre='#{@pcre_source_dir}' "
+-		elsif !pcre_is_installed?
+-			command << "--without-http_rewrite_module "
+-		end
+-		command << "--add-module='#{SOURCE_ROOT}/ext/nginx' #{extra_configure_flags}"
++		command = "sh ./configure "
++		command << "--add-module='#{SOURCE_ROOT}/ext/nginx' "
++        command << ENV['NGINX_EXTRA_CONFIGURE_FLAGS']
+ 		command.strip!
+ 		return command
+ 	end
diff --git a/rubygem-passenger-3.0.14-gcc47-include-sys_types.patch b/rubygem-passenger-3.0.14-gcc47-include-sys_types.patch
new file mode 100644
index 0000000..cbe97ef
--- /dev/null
+++ b/rubygem-passenger-3.0.14-gcc47-include-sys_types.patch
@@ -0,0 +1,44 @@
+diff -ur passenger-3.0.14.orig/ext/common/EventedMessageServer.h passenger-3.0.14/ext/common/EventedMessageServer.h
+--- passenger-3.0.14.orig/ext/common/EventedMessageServer.h	2012-07-27 15:28:50.792000001 -0500
++++ passenger-3.0.14/ext/common/EventedMessageServer.h	2012-07-27 15:32:45.815991896 -0500
+@@ -27,6 +27,7 @@
+ 
+ #include <boost/shared_ptr.hpp>
+ #include <ev++.h>
++#include <sys/types.h>
+ #include <cstdarg>
+ #include <cstdlib>
+ #ifdef HAS_ALLOCA_H
+diff -ur passenger-3.0.14.orig/ext/common/FileDescriptor.h passenger-3.0.14/ext/common/FileDescriptor.h
+--- passenger-3.0.14.orig/ext/common/FileDescriptor.h	2012-07-27 15:28:50.800000001 -0500
++++ passenger-3.0.14/ext/common/FileDescriptor.h	2012-07-27 15:33:04.641000001 -0500
+@@ -30,6 +30,7 @@
+ #include <oxt/system_calls.hpp>
+ 
+ #include <utility>
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <cerrno>
+ 
+diff -ur passenger-3.0.14.orig/ext/common/Utils/BufferedIO.h passenger-3.0.14/ext/common/Utils/BufferedIO.h
+--- passenger-3.0.14.orig/ext/common/Utils/BufferedIO.h	2012-07-27 15:28:50.794000001 -0500
++++ passenger-3.0.14/ext/common/Utils/BufferedIO.h	2012-07-27 15:33:45.415997096 -0500
+@@ -1,6 +1,7 @@
+ #ifndef _PASSENGER_BUFFERED_IO_H_
+ #define _PASSENGER_BUFFERED_IO_H_
+ 
++#include <sys/types.h>
+ #include <string>
+ #include <utility>
+ #include <algorithm>
+diff -ur passenger-3.0.14.orig/ext/common/Utils/StreamBoyerMooreHorspool.h passenger-3.0.14/ext/common/Utils/StreamBoyerMooreHorspool.h
+--- passenger-3.0.14.orig/ext/common/Utils/StreamBoyerMooreHorspool.h	2012-07-27 15:28:50.794000001 -0500
++++ passenger-3.0.14/ext/common/Utils/StreamBoyerMooreHorspool.h	2012-07-27 15:34:07.360998880 -0500
+@@ -190,6 +190,7 @@
+ #endif
+ 
+ 
++#include <sys/types.h>
+ #include <cstddef>
+ #include <cstring>
+ #include <cassert>
diff --git a/rubygem-passenger.spec b/rubygem-passenger.spec
new file mode 100644
index 0000000..afca10f
--- /dev/null
+++ b/rubygem-passenger.spec
@@ -0,0 +1,432 @@
+%global gem_name passenger
+
+Summary: Passenger Ruby web application server
+Name: rubygem-%{gem_name}
+Version: 3.0.14
+Release: 15%{?dist}
+Group: System Environment/Daemons
+# Passenger code uses MIT license.
+# Bundled(Boost) uses Boost Software License
+# BCrypt and Blowfish files use BSD license.
+# Documentation is CC-BY-SA
+# See: https://bugzilla.redhat.com/show_bug.cgi?id=470696#c146
+License: Boost 1.0 and BSD and BSD with advertising and MIT and zlib
+
+URL: http://www.modrails.com
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+Source: http://rubyforge.org/frs/download.php/76329/%{gem_name}-%{version}.tar.gz
+Source1: passenger.logrotate
+Source2: rubygem-passenger.tmpfiles
+Source10: apache-passenger.conf.in
+#Source20: nginx-passenger.conf.in
+
+# Get passenger to recognize our path preferences
+Patch1:         rubygem-passenger-3.0.12-force-native.patch
+
+# Include sys/types.h for GCC 4.7
+Patch2:         rubygem-passenger-3.0.14-gcc47-include-sys_types.patch
+
+#Patch10:        rubygem-passenger-3.0.12-spoof-nginx-install.patch
+
+# Support spawnIpAddress option to allow binding to a particular IP.
+Patch20:        rubygem-passenger-3.0.12-spawn-ip.patch
+
+# Honor CXXFLAGS in the environment.
+Patch100:       passenger_apache_fix_autofoo.patch
+
+# Bug in bundled boost. Fixed in passenger 3.0.16
+Patch101:       passenger_boost_xtime.patch
+
+# Test tries to spawn 1000 threads with 256kb stacks. Default Linux settings
+# deny allocating so much, causing test to fail. Let's use 8kb stacks instead.
+Patch102:       passenger_dynamic_thread_group.patch
+
+# Use rspec2 conventions
+Patch103:       passenger_rspec2_helper.patch
+
+# Remove checking for fastthread on F17+
+Patch104:       passenger_fixdeps.patch
+
+# removes -Werror in upstream build scripts.  -Werror conflicts with
+# -D_FORTIFY_SOURCE=2 causing warnings to turn into errors.
+#Patch200:       nginx-auto-cc-gcc.patch
+
+Requires: rubygems
+# XXX: Needed to run passenger standalone
+# Requires: rubygem(daemon_controller) >= 1.0.0
+Requires: rubygem(file-tail)
+Requires: rubygem(rack)
+Requires: rubygem(rake)
+Requires: ruby(abi) = 1.9.1
+
+%if 0%{?rhel} >= 6 || 0%{?fedora} >= 15
+BuildRequires:  libcurl-devel
+%else
+BuildRequires:  curl-devel
+%endif
+
+%if 0%{?rhel} <= 6 && 0%{?fedora} <= 16
+Requires: rubygem(fastthread) >= 1.0.1
+BuildRequires:  rubygem(fastthread) >= 1.0.1
+%endif
+
+BuildRequires: asciidoc
+BuildRequires: doxygen
+BuildRequires: graphviz
+BuildRequires: httpd-devel
+BuildRequires: libev-devel
+BuildRequires: ruby
+BuildRequires: ruby-devel
+BuildRequires: rubygems
+BuildRequires: rubygems-devel
+BuildRequires: rubygem(rake) >= 0.8.1
+BuildRequires: rubygem(rack)
+BuildRequires: rubygem(rspec)
+BuildRequires: rubygem(mime-types)
+BuildRequires: source-highlight
+
+# XXX
+BuildRequires: zlib-devel
+
+Provides: rubygem(%{gem_name}) = %{version}-%{release}
+Provides: bundled(boost) =  1.44
+
+%description
+Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment
+of Ruby web applications, such as those built on the revolutionary
+Ruby on Rails web framework, a breeze. It follows the usual Ruby on
+Rails conventions, such as “Don’t-Repeat-Yourself”.
+
+%package -n mod_passenger
+Summary: Apache Module for Phusion Passenger
+Group: System Environment/Daemons
+BuildRequires:  httpd-devel
+Requires: httpd >= 2.2
+Requires: rubygem(%{gem_name}) = %{version}-%{release}
+Requires: %{name}-native%{?_isa} = %{version}-%{release}
+License: Boost 1.0 and BSD and BSD with advertising and MIT and zlib
+
+%description -n mod_passenger
+This package contains the pluggable Apache server module for Phusion Passenger™.
+
+%package devel
+Summary: Apache Module for Phusion Passenger
+Group: System Environment/Daemons
+Requires: rubygem(%{gem_name}) = %{version}-%{release}
+Provides: bundled(boost-devel) =  1.44
+License: Boost 1.0 and BSD and BSD with advertising and GPL+ and MIT and zlib
+
+%description devel
+This package contains development files for Phusion Passenger™.
+
+%package doc
+Summary: Apache Module for Phusion Passenger
+Group: System Environment/Daemons
+Requires: rubygem(%{gem_name}) = %{version}-%{release}
+BuildArch: noarch
+License: CC-BY-SA and MIT and (MIT or GPL+)
+
+%description doc
+This package contains documentation files for Phusion Passenger™.
+
+%package native
+Summary: Phusion Passenger native extensions
+Group: System Environment/Daemons
+Requires: rubygem(%{gem_name}) = %{version}-%{release}
+Requires: %{name}-native-libs%{?_isa} = %{version}-%{release}
+Requires: %{name}%{?_isa} = %{version}-%{release}
+License: Boost 1.0 and BSD and BSD with advertising and MIT and zlib
+%description native
+This package contains the native code extensions for Apache & Nginx
+Phusion Passenger™ bindings.
+
+%package native-libs
+Summary: Phusion Passenger native extensions
+Group: System Environment/Daemons
+Requires: %{name}%{?_isa} = %{version}-%{release}
+Requires: ruby
+License: Boost 1.0 and BSD and BSD with advertising and MIT and zlib
+%description native-libs
+This package contains the native shared library for Apache & Nginx
+Phusion Passenger™ bindings, built against ruby sources. It has been
+separated so that installing a new ruby interpreter only necessitates
+rebuilding this package.
+
+
+%prep
+%setup -q -n %{gem_name}-%{version}
+
+%patch1   -p1 -b .force-native
+%patch2   -p1 -b .include-sys-types
+%patch20  -p1 -b .spawnip
+%patch100 -p0 -b .autofoo
+%patch102 -p1 -b .threadtest
+%patch103 -p1 -b .rspec2
+
+%if 0%{?rhel} > 6 || 0%{?fedora} > 17
+pushd ext
+%patch101 -p2 -b .xtime
+popd
+%endif
+
+# remove fastthread checking
+%if 0%{?fedora} >= 17
+%patch104 -p1 -b .fastthread
+%endif
+
+# Don't use bundled libev
+%{__rm} -rf ext/libev
+
+# asciidoc 8.4.x doesn't have an html5 backend
+%{__sed} -i 's/-b html5/-b html4/' build/documentation.rb
+
+# fix up install paths
+%{__sed} -i \
+    -e 's|%%%%GEM_INSTALL_DIR%%%%|%{gem_instdir}|g' \
+    -e 's|%%%%APACHE_INSTALLED_MOD%%%%|%{_libdir}/httpd/modules/|g' \
+    -e 's|%%%%AGENTS_DIR%%%%|%{gem_extdir}/agents|g' \
+    -e 's|%%%%NATIVE_SUPPORT_DIR%%%%|%{gem_extdir}/lib|g' \
+    lib/phusion_passenger.rb \
+    lib/phusion_passenger/native_support.rb \
+    ext/common/ResourceLocator.h
+
+# Fix anything executable that does not have a hash-bang
+# Why are there executable header files? WTF.
+for script in `find . -type f -perm /a+x -name "*.rb" -o -perm /a+x -name "*.h"`; do
+    [ -z "`head -n 1 $script | grep \"^#!/\"`" ] && chmod -v 644 $script
+done
+
+# Find files with a hash-bang that do not have executable permissions
+for script in `find . -type f ! -perm /a+x -name "*.rb"`; do
+    [ ! -z "`head -n 1 $script | grep \"^#!/\"`" ] && chmod -v 755 $script
+done
+
+%build
+export USE_VENDORED_LIBEV=false
+CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ;
+CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ;
+FFLAGS="${FFLAGS:-%optflags}" ; export FFLAGS ;
+rake package
+rake apache2
+#rake nginx
+
+%install
+export USE_VENDORED_LIBEV=false
+
+# Install the gem.
+gem install -V \
+            --local \
+            --install-dir %{buildroot}%{gem_dir} \
+            --bindir %{buildroot}%{gem_instdir}/bin \
+            --force \
+            --rdoc \
+            pkg/%{gem_name}-%{version}.gem
+
+# Install Apache module.
+%{__mkdir_p} %{buildroot}/%{_libdir}/httpd/modules
+install -pm 0755 ext/apache2/mod_passenger.so %{buildroot}/%{_libdir}/httpd/modules
+
+# Install Apache config.
+%{__mkdir_p} %{buildroot}/%{_sysconfdir}/httpd/conf.d
+install -pm 0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/httpd/conf.d/passenger.conf
+%{__sed} -i -e 's|@PASSENGERROOT@|%{gem_instdir}|g' %{buildroot}/%{_sysconfdir}/httpd/conf.d/passenger.conf
+
+# Install man pages into the proper location.
+%{__mkdir_p} %{buildroot}%{_mandir}/man1
+%{__mkdir_p} %{buildroot}%{_mandir}/man8
+%{__mv} %{buildroot}%{gem_instdir}/man/*.1 %{buildroot}%{_mandir}/man1
+%{__mv} %{buildroot}%{gem_instdir}/man/*.8 %{buildroot}%{_mandir}/man8
+rmdir %{buildroot}%{gem_instdir}/man
+
+# The agents aren't in the gem for some reason...
+%{__chmod} -R 0755 agents/*
+%{__mkdir_p} %{buildroot}%{gem_extdir}
+%{__cp} -a agents %{buildroot}%{gem_extdir}
+
+# Make our ghost log and run directories...
+%{__mkdir_p} %{buildroot}%{_localstatedir}/log/passenger-analytics
+
+# logrotate
+%{__mkdir_p} %{buildroot}%{_sysconfdir}/logrotate.d
+install -pm 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/passenger
+
+# tmpfiles.d
+%if 0%{?fedora} > 15
+%{__mkdir_p} %{buildroot}/run
+%{__mkdir_p} %{buildroot}%{_prefix}/lib/tmpfiles.d
+install -m 0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/tmpfiles.d/%{name}.conf
+install -d -m 0755 %{buildroot}/run/%{name}
+%else
+%{__mkdir_p} %{buildroot}%{_localstatedir}/run/%{name}
+%endif
+
+# Fix wrong EOF encoding on the RI files...
+for file in `find %{buildroot}%{gem_docdir} -type f -name "*.ri"`; do
+    sed -i 's/\r//' $file
+done
+
+# Bring over just the native binaries
+%{__mkdir_p} %{buildroot}%{gem_extdir}/lib/native
+install -m 0755 ext/ruby/ruby*linux/passenger_native_support.so %{buildroot}%{gem_extdir}/lib/native
+
+# Remove zero-length files
+find %{buildroot}%{gem_instdir} -type f -size 0c -delete
+
+# Don't install the installation scripts. That's why we have packaging.
+%{__rm} %{buildroot}%{gem_instdir}/bin/%{gem_name}-install-apache2-module
+%{__rm} %{buildroot}%{gem_instdir}/bin/%{gem_name}-install-nginx-module
+%{__rm} %{buildroot}%{gem_instdir}/bin/%{gem_name}-make-enterprisey
+
+# XXX: removing everything in bin until daemon_controller >= 1.0.0
+%{__rm} -rf %{buildroot}%{gem_instdir}/bin
+
+%check
+export USE_VENDORED_LIBEV=false
+# Run the tests, capture the output, but don't fail the build if the tests fail
+#
+# This will make the test failure non-critical, but it should be examined
+# anyway.
+sed -i 's|sh "cd test && \./cxx/CxxTestMain"|& rescue true|' \
+    build/cxx_tests.rb
+
+# Fedora has RSpec 2 while the test suite seems to require RSpec 1.
+sed -i \
+    "s|return locate_ruby_tool('spec')|return locate_ruby_tool('rspec')|" \
+    lib/phusion_passenger/platform_info/ruby.rb
+
+%{__cp} test/config.yml.example test/config.yml
+
+rake test --trace ||:
+
+%files
+%doc %{gem_instdir}/README
+%doc %{gem_instdir}/DEVELOPERS.TXT
+%doc %{gem_instdir}/LICENSE
+%doc %{gem_instdir}/NEWS
+%{gem_cache}
+%{gem_spec}
+%dir %{gem_instdir}
+# XXX: removing everything in bin until daemon_controller >= 1.0.0
+#%{gem_instdir}/bin
+%{gem_instdir}/helper-scripts
+%{gem_instdir}/lib
+%{gem_instdir}/resources
+%{_mandir}/man1/%{gem_name}-*
+%{_mandir}/man8/%{gem_name}-*
+%if 0%{?fedora} > 15
+%{_prefix}/lib/tmpfiles.d/%{name}.conf
+%dir /run/rubygem-passenger
+%else
+%dir %{_localstatedir}/run/rubygem-passenger
+%endif
+%exclude %{gem_instdir}/configure
+%exclude %{gem_instdir}/debian/
+%exclude %{gem_instdir}/.yardoc
+%exclude %{gem_cache}
+
+%files doc
+%doc %{gem_docdir}
+%doc %{gem_instdir}/doc
+
+%files devel
+%doc %{gem_instdir}/INSTALL
+%doc %{gem_instdir}/PACKAGING.TXT
+%{gem_instdir}/Rakefile
+%{gem_instdir}/test
+%{gem_instdir}/build
+%{gem_instdir}/dev
+%{gem_instdir}/ext
+
+%files -n mod_passenger
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/passenger.conf
+%doc doc/Users\ guide\ Apache.html
+%doc doc/Users\ guide\ Apache.txt
+%{_libdir}/httpd/modules/mod_passenger.so
+
+%files native
+%{gem_extdir}/agents
+%dir %{_localstatedir}/log/passenger-analytics
+%{_sysconfdir}/logrotate.d/passenger
+
+%files native-libs
+%dir %{gem_extdir}
+%{gem_extdir}/lib
+
+%changelog
+* Wed Sep 5 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-15
+- add support for tmpfiles.d
+
+* Tue Sep 4 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-14
+- Fix License tag
+- Fix gem_extdir ownership issue
+
+* Wed Aug 29 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-13
+- fix pathing issues
+- fix ruby abi requires
+
+* Wed Aug 29 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-12
+- remove capability for running passenger standalone until daemon_controller is updated
+
+* Tue Aug 28 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-11
+- fix issues with fastthread
+
+* Mon Aug 27 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-10
+- get test suite sort of working
+- move agents to gem_extdir
+
+* Fri Aug 24 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-9
+- stop using _bindir
+- fix native libs path
+- fix ownership on extdir
+- improve test output
+
+* Wed Aug 22 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-8
+- removed policycoreutils requirement
+- moved native libs to gem_extdir
+
+* Wed Aug 22 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-7
+- remove selinux policy module. it's in the base policy now.
+
+* Fri Aug 17 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-6
+- put native-libs into ruby_vendorarchdir.
+
+* Thu Aug 16 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-5
+- clean up packaging and file placement.
+- add logrotate file for /var/log/passenger-analytics
+
+* Wed Aug 15 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-4
+- backported fix only needed on f18+
+
+* Wed Aug 15 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-3
+- backport fix from https://svn.boost.org/trac/boost/ticket/6940
+
+* Mon Aug 13 2012 Brett Lentz <blentz at redhat.com> - 3.0.14-2
+- remove F15 conditional. F15 is EOL.
+
+* Fri Jul 27 2012 Troy Dawson <tdawson at redhat.com> - 3.0.14-1
+- Updated to version 3.0.14
+
+* Fri Jul 27 2012 Troy Dawson <tdawson at redhat.com> - 3.0.12-6
+- Added patch20, spawn-ip
+- Changed selinux files to be more dynamic
+
+* Tue Jun 05 2012 Troy Dawson <tdawson at redhat.com> - 3.0.12-5
+- Add all the selinux files
+
+* Tue Jun 05 2012 Troy Dawson <tdawson at redhat.com> - 3.0.12-4
+- Added selinux configurations
+
+* Tue Jun 05 2012 Troy Dawson <tdawson at redhat.com> - 3.0.12-3
+- Added native and native-libs rpms.
+
+* Mon Apr 16 2012 Brett Lentz <blentz at redhat.com> - 3.0.12-2
+- Add dist to release.
+- Shuffle around deprecated buildrequires and requires.
+
+* Mon Apr 16 2012 Brett Lentz <blentz at redhat.com> - 3.0.12-1
+- Update to 3.0.12
+- Incorporate specfile changes from kanarip's version
+
+* Wed Apr 12 2012 Brett Lentz <blentz at redhat.com> - 3.0.11-1
+- Initial spec file
diff --git a/rubygem-passenger.tmpfiles b/rubygem-passenger.tmpfiles
new file mode 100644
index 0000000..6ba4472
--- /dev/null
+++ b/rubygem-passenger.tmpfiles
@@ -0,0 +1 @@
+d /run/passenger 0755 root root -
diff --git a/sources b/sources
index e69de29..67275c3 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+211c5da3cac012c4b9b6495f8d598762  passenger-3.0.14.tar.gz


More information about the scm-commits mailing list