-diff -ur apache-mod_rails-2.2.15-o/Rakefile apache-mod_rails-2.2.15/Rakefile
---- apache-mod_rails-2.2.15-o/Rakefile 2010-08-28 23:04:20.000000000 -0600
-+++ apache-mod_rails-2.2.15/Rakefile 2010-08-30 12:29:27.000000000 -0600
-@@ -18,10 +18,8 @@
+diff -ur apache-mod_rails-3.0.0-o//Rakefile apache-mod_rails-3.0.0/Rakefile
+--- apache-mod_rails-3.0.0-o//Rakefile 2010-10-18 14:08:19.000000000 +0200
++++ apache-mod_rails-3.0.0/Rakefile 2010-11-25 01:20:28.000000000 +0100
+@@ -29,7 +29,6 @@
+ require 'build/apache2'
+ require 'build/nginx'
+ require 'build/documentation'
+-require 'build/packaging'
+ require 'build/test_basics'
+ require 'build/oxt_tests'
+ require 'build/cxx_tests'
+diff -ur apache-mod_rails-3.0.0-o//build/basics.rb apache-mod_rails-3.0.0/build/basics.rb
+--- apache-mod_rails-3.0.0-o//build/basics.rb 2010-10-18 14:08:19.000000000 +0200
++++ apache-mod_rails-3.0.0/build/basics.rb 2010-11-25 01:20:28.000000000 +0100
+@@ -14,7 +14,6 @@
+ # with this program; if not, write to the Free Software Foundation, Inc.,
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")
- $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/misc")
-require 'rubygems'
require 'pathname'
- require 'rake/rdoctask'
--require 'rake/gempackagetask'
- require 'rake/extensions'
- require 'rake/cplusplus'
- require 'phusion_passenger/platform_info'
-@@ -640,101 +638,6 @@
- rd.options << "-S" << "-N" << "-p" << "-H"
- end
+ require 'phusion_passenger'
+ require 'phusion_passenger/packaging'
+@@ -32,8 +31,6 @@
+ include PhusionPassenger::PlatformInfo
--
--##### Packaging
--
--spec = Gem::Specification.new do |s|
-- s.platform = Gem::Platform::RUBY
-- s.homepage = "http://www.modrails.com/"
-- s.summary = "Apache module for Ruby on Rails support."
-- s.name = "passenger"
-- s.version = PACKAGE_VERSION
-- s.rubyforge_project = "passenger"
-- s.author = "Phusion - http://www.phusion.nl/"
-- s.email = "info@phusion.nl"
-- s.requirements << "fastthread" << "Apache 2 with development headers"
-- s.require_paths = ["lib", "ext"]
-- s.add_dependency 'rake', '>= 0.8.1'
-- s.add_dependency 'fastthread', '>= 1.0.1'
-- s.add_dependency 'rack'
-- s.extensions << 'ext/phusion_passenger/extconf.rb'
-- s.files = FileList[
-- 'Rakefile',
-- 'README',
-- 'DEVELOPERS.TXT',
-- 'LICENSE',
-- 'INSTALL',
-- 'NEWS',
-- 'lib/**/*.rb',
-- 'lib/**/*.py',
-- 'lib/phusion_passenger/templates/*',
-- 'lib/phusion_passenger/templates/apache2/*',
-- 'lib/phusion_passenger/templates/nginx/*',
-- 'bin/*',
-- 'doc/*',
--
-- # If you're running 'rake package' for the first time, then these
-- # files don't exist yet, and so won't be matched by the above glob.
-- # So we add these filenames manually.
-- 'doc/Users guide Apache.html',
-- 'doc/Users guide Nginx.html',
-- 'doc/Security of user switching support.html',
--
-- 'doc/*/*',
-- 'doc/*/*/*',
-- 'doc/*/*/*/*',
-- 'doc/*/*/*/*/*',
-- 'doc/*/*/*/*/*/*',
-- 'man/*',
-- 'debian/*',
-- 'ext/common/*.{cpp,c,h,hpp}',
-- 'ext/apache2/*.{cpp,h,c,TXT}',
-- 'ext/nginx/*.{c,cpp,h}',
-- 'ext/nginx/config',
-- 'ext/boost/*.{hpp,TXT}',
-- 'ext/boost/**/*.{hpp,cpp,pl,inl,ipp}',
-- 'ext/oxt/*.hpp',
-- 'ext/oxt/*.cpp',
-- 'ext/oxt/detail/*.hpp',
-- 'ext/phusion_passenger/*.{c,rb}',
-- 'benchmark/*.{cpp,rb}',
-- 'misc/*',
-- 'misc/*/*',
-- 'test/*.{rb,cpp,example}',
-- 'test/support/*.{cpp,h,rb}',
-- 'test/oxt/*.cpp',
-- 'test/ruby/**/*',
-- 'test/integration_tests/**/*',
-- 'test/stub/**/*'
-- ]
-- s.executables = [
-- 'passenger-spawn-server',
-- 'passenger-install-apache2-module',
-- 'passenger-install-nginx-module',
-- 'passenger-config',
-- 'passenger-memory-stats',
-- 'passenger-make-enterprisey',
-- 'passenger-status',
-- 'passenger-stress-test'
-- ]
-- s.has_rdoc = true
-- s.extra_rdoc_files = ['README']
-- s.rdoc_options <<
-- "-S" << "-N" << "-p" << "-H" <<
-- '--main' << 'README' <<
-- '--title' << 'Passenger Ruby API'
-- s.description = "Passenger is an Apache module for Ruby on Rails support."
--end
--
--Rake::GemPackageTask.new(spec) do |pkg|
-- pkg.need_tar_gz = true
--end
--
--Rake::Task['package'].prerequisites.unshift(:doc)
--Rake::Task['package:gem'].prerequisites.unshift(:doc)
--Rake::Task['package:force'].prerequisites.unshift(:doc)
--task :clobber => :'package:clean'
--
- desc "Create a fakeroot, useful for building native packages"
- task :fakeroot => [:apache2, :native_support, :doc] do
- require 'rbconfig'
-@@ -772,34 +675,6 @@
- sh "rm", "-rf", *Dir["#{docdir}/{definitions.h,Doxyfile,template}"]
- end
+ require 'build/rdoctask'
+-require 'build/packagetask'
+-require 'build/gempackagetask'
+ require 'build/rake_extensions'
+ require 'build/cplusplus_support'
--desc "Create a Debian package"
--task 'package:debian' => :fakeroot do
-- if Process.euid != 0
-- STDERR.puts
-- STDERR.puts "*** ERROR: the 'package:debian' task must be run as root."
-- STDERR.puts
-- exit 1
-- end
--
-- fakeroot = "pkg/fakeroot"
-- raw_arch = `uname -m`.strip
-- arch = case raw_arch
-- when /^i.86$/
-- "i386"
-- when /^x86_64/
-- "amd64"
-- else
-- raw_arch
-- end
--
-- sh "sed -i 's/Version: .*/Version: #{PACKAGE_VERSION}/' debian/control"
-- sh "cp -R debian #{fakeroot}/DEBIAN"
-- sh "sed -i 's/: any/: #{arch}/' #{fakeroot}/DEBIAN/control"
-- sh "chown -R root:root #{fakeroot}"
-- sh "dpkg -b #{fakeroot} pkg/passenger_#{PACKAGE_VERSION}-#{arch}.deb"
--end
--
--
- ##### Misc
-
- desc "Run 'sloccount' to see how much code Passenger has"
-diff -ur apache-mod_rails-2.2.15-o/lib/phusion_passenger/application.rb apache-mod_rails-2.2.15/lib/phusion_passenger/application.rb
---- apache-mod_rails-2.2.15-o/lib/phusion_passenger/application.rb 2010-06-24 06:23:06.000000000 -0600
-+++ apache-mod_rails-2.2.15/lib/phusion_passenger/application.rb 2010-08-30 12:29:27.000000000 -0600
+diff -ur apache-mod_rails-3.0.0-o//helper-scripts/passenger-spawn-server apache-mod_rails-3.0.0/helper-scripts/passenger-spawn-server
+--- apache-mod_rails-3.0.0-o//helper-scripts/passenger-spawn-server 2010-10-18 14:08:19.000000000 +0200
++++ apache-mod_rails-3.0.0/helper-scripts/passenger-spawn-server 2010-11-25 01:22:03.000000000 +0100
+@@ -72,7 +72,10 @@
+
+ source_root = File.expand_path(File.dirname(__FILE__) + "/..")
+ $LOAD_PATH.unshift("#{source_root}/lib")
+- require 'rubygems' rescue nil
++ begin
++ require 'rubygems'
++ rescue LoadError
++ end
+ require 'phusion_passenger'
+ require 'phusion_passenger/debug_logging'
+ require 'phusion_passenger/utils/tmpdir'
+Only in apache-mod_rails-3.0.0/helper-scripts: passenger-spawn-server~
+diff -ur apache-mod_rails-3.0.0-o//lib/phusion_passenger/abstract_server.rb apache-mod_rails-3.0.0/lib/phusion_passenger/abstract_server.rb
+--- apache-mod_rails-3.0.0-o//lib/phusion_passenger/abstract_server.rb 2010-10-18 14:08:19.000000000 +0200
++++ apache-mod_rails-3.0.0/lib/phusion_passenger/abstract_server.rb 2010-11-25 01:22:28.000000000 +0100
+@@ -172,7 +172,7 @@
+ # the associated file descriptors have just been closed. This can
+ # result in mysterious 'EBADFD' errors. So we force RubyGems to
+ # clear all open file handles.
+- Gem.clear_paths
++ Gem.clear_paths if defined? Gem
+
+ # Reseed pseudo-random number generator for security reasons.
+ srand
+Only in apache-mod_rails-3.0.0/lib/phusion_passenger: abstract_server.rb~
+diff -ur apache-mod_rails-3.0.0-o//lib/phusion_passenger/app_process.rb apache-mod_rails-3.0.0/lib/phusion_passenger/app_process.rb
+--- apache-mod_rails-3.0.0-o//lib/phusion_passenger/app_process.rb 2010-10-18 14:08:19.000000000 +0200
++++ apache-mod_rails-3.0.0/lib/phusion_passenger/app_process.rb 2010-11-25 01:20:28.000000000 +0100
@@ -21,7 +21,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
-require 'rubygems'
+begin
-+ require 'rubygems'
++ require 'rubygems'
+rescue LoadError
+end
require 'phusion_passenger/exceptions'
module PhusionPassenger
-Only in apache-mod_rails-2.2.15/lib/phusion_passenger: platform_info.rb~
-diff -ur apache-mod_rails-2.2.15-o/lib/phusion_passenger/rack/application_spawner.rb apache-mod_rails-2.2.15/lib/phusion_passenger/rack/application_spawner.rb
---- apache-mod_rails-2.2.15-o/lib/phusion_passenger/rack/application_spawner.rb 2010-06-24 06:23:06.000000000 -0600
-+++ apache-mod_rails-2.2.15/lib/phusion_passenger/rack/application_spawner.rb 2010-08-30 12:29:51.000000000 -0600
-@@ -101,7 +101,7 @@
- # Make sure RubyGems uses any new environment variable values
- # that have been set now (e.g. $HOME, $GEM_HOME, etc) and that
- # it is able to detect newly installed gems.
-- Gem.clear_paths
-+ Gem.clear_paths if defined? Gem
- setup_bundler_support
- app = load_rack_app
+@@ -63,6 +66,7 @@
+ return :vendor
end
-Only in apache-mod_rails-2.2.15/lib/phusion_passenger/rack: application_spawner.rb~
-diff -ur apache-mod_rails-2.2.15-o/lib/phusion_passenger/railz/application_spawner.rb apache-mod_rails-2.2.15/lib/phusion_passenger/railz/application_spawner.rb
---- apache-mod_rails-2.2.15-o/lib/phusion_passenger/railz/application_spawner.rb 2010-06-24 06:23:06.000000000 -0600
-+++ apache-mod_rails-2.2.15/lib/phusion_passenger/railz/application_spawner.rb 2010-08-30 12:32:04.000000000 -0600
-@@ -21,7 +21,10 @@
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
-
--require 'rubygems'
-+begin
-+ require 'rubygems'
-+rescue LoadError
-+end
- require 'socket'
- require 'etc'
- require 'fcntl'
-@@ -173,7 +176,7 @@
- # Make sure RubyGems uses any new environment variable values
- # that have been set now (e.g. $HOME, $GEM_HOME, etc) and that
- # it is able to detect newly installed gems.
-- Gem.clear_paths
-+ Gem.clear_paths if defined? Gem
- setup_bundler_support
-
- require File.expand_path('config/environment')
-@@ -262,7 +265,7 @@
- # Make sure RubyGems uses any new environment variable values
- # that have been set now (e.g. $HOME, $GEM_HOME, etc) and that
- # it is able to detect newly installed gems.
-- Gem.clear_paths
-+ Gem.clear_paths if defined? Gem
- setup_bundler_support
- preload_application
- end
-Only in apache-mod_rails-2.2.15/lib/phusion_passenger/railz: application_spawner.rb~
-diff -ur apache-mod_rails-2.2.15-o/lib/phusion_passenger/railz/framework_spawner.rb apache-mod_rails-2.2.15/lib/phusion_passenger/railz/framework_spawner.rb
---- apache-mod_rails-2.2.15-o/lib/phusion_passenger/railz/framework_spawner.rb 2010-06-24 06:23:06.000000000 -0600
-+++ apache-mod_rails-2.2.15/lib/phusion_passenger/railz/framework_spawner.rb 2010-08-30 12:31:50.000000000 -0600
-@@ -21,7 +21,10 @@
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
-
--require 'rubygems'
-+begin
-+ require 'rubygems'
-+rescue LoadError
-+end
- require 'phusion_passenger/abstract_server'
- require 'phusion_passenger/abstract_server_collection'
- require 'phusion_passenger/railz/application_spawner'
-@@ -299,7 +302,7 @@
- # missing gem. If that's the case then the sysadmin
- # will install probably the gem. So we clear RubyGems's
- # cache so that it can detect new gems.
-- Gem.clear_paths
-+ Gem.clear_paths if defined? Gem
- end
- return
- end
-Only in apache-mod_rails-2.2.15/lib/phusion_passenger/railz: framework_spawner.rb~
-diff -ur apache-mod_rails-2.2.15-o/lib/phusion_passenger/spawn_manager.rb apache-mod_rails-2.2.15/lib/phusion_passenger/spawn_manager.rb
---- apache-mod_rails-2.2.15-o/lib/phusion_passenger/spawn_manager.rb 2010-06-24 06:23:06.000000000 -0600
-+++ apache-mod_rails-2.2.15/lib/phusion_passenger/spawn_manager.rb 2010-08-30 12:29:27.000000000 -0600
-@@ -292,7 +292,7 @@
+
++ return nil if !defined? Gem
+ environment_rb = File.read("#{app_root}/config/environment.rb")
+ environment_rb =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
+ gem_version_spec = $1
+diff -ur apache-mod_rails-3.0.0-o//lib/phusion_passenger/spawn_manager.rb apache-mod_rails-3.0.0/lib/phusion_passenger/spawn_manager.rb
+--- apache-mod_rails-3.0.0-o//lib/phusion_passenger/spawn_manager.rb 2010-10-18 14:08:19.000000000 +0200
++++ apache-mod_rails-3.0.0/lib/phusion_passenger/spawn_manager.rb 2010-11-25 01:20:28.000000000 +0100
+@@ -282,12 +282,12 @@
+ send_error_page(client, 'database_error', :error => e,
+ :app_root => app_root, :app_name => app_name(app_type),
+ :app_type => app_type)
+- elsif load_error?(e)
++ elsif load_error?(e) and defined? Gem
+ # A source file failed to load, maybe because of a
# missing gem. If that's the case then the sysadmin
# will install probably the gem. So we clear RubyGems's
# cache so that it can detect new gems.
send_error_page(client, 'load_error', :error => e, :app_root => app_root,
:app_name => app_name(app_type))
elsif e.child_exception.is_a?(SystemExit)
-diff -ur apache-mod_rails-2.2.15-o/lib/phusion_passenger/utils.rb apache-mod_rails-2.2.15/lib/phusion_passenger/utils.rb
---- apache-mod_rails-2.2.15-o/lib/phusion_passenger/utils.rb 2010-06-24 06:23:06.000000000 -0600
-+++ apache-mod_rails-2.2.15/lib/phusion_passenger/utils.rb 2010-08-30 12:29:27.000000000 -0600
+diff -ur apache-mod_rails-3.0.0-o//lib/phusion_passenger/utils.rb apache-mod_rails-3.0.0/lib/phusion_passenger/utils.rb
+--- apache-mod_rails-3.0.0-o//lib/phusion_passenger/utils.rb 2010-10-18 14:08:19.000000000 +0200
++++ apache-mod_rails-3.0.0/lib/phusion_passenger/utils.rb 2010-11-25 01:20:28.000000000 +0100
@@ -22,7 +22,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
require 'thread'
if (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby") && RUBY_VERSION < "1.8.7"
require 'fastthread'
+@@ -244,7 +247,7 @@
+ # Make sure RubyGems uses any new environment variable values
+ # that have been set now (e.g. $HOME, $GEM_HOME, etc) and that
+ # it is able to detect newly installed gems.
+- Gem.clear_paths
++ Gem.clear_paths if defined? Gem
+
+ # Because spawned app processes exit using #exit!, #at_exit
+ # blocks aren't called. Here we ninja patch Kernel so that
Summary: A module to bridge Ruby on Rails to Apache
Name: apache-mod_rails
-Version: 2.2.15
+Version: 3.0.0
Release: 1
License: Apache
Group: Networking/Daemons/HTTP
Source0: http://rubygems.org/downloads/passenger-%{version}.gem
-# Source0-md5: fd0e1a0ebcf97af7e238c405a6b70235
+# Source0-md5: 1135431e5e655fb1e1173757827b0d9d
Source1: %{name}.conf
-Patch0: %{name}-alias+public.patch
Patch1: %{name}-nogems.patch
URL: http://www.modrails.com
BuildRequires: apache-base >= 2.0.55-1
BuildRequires: apache-devel >= 2.0.55-1
BuildRequires: apache-tools >= 2.0.55-1
BuildRequires: apr-util-devel >= 1:1.0.0
+BuildRequires: curl-devel
BuildRequires: libstdc++-devel
BuildRequires: pkgconfig
BuildRequires: rpm-pythonprov
%setup -q -c
%{__tar} xf %{SOURCE0} -O data.tar.gz | %{__tar} xz
find -newer README -o -print | xargs touch --reference %{SOURCE0}
-%patch0 -p0
%patch1 -p1
-# TODO : ugly metod - but works
+# TODO : ugly method - but works
%{__sed} -i 's/CXXFLAGS = "/CXXFLAGS = "`pkg-config --cflags apr-util-1`/ ' Rakefile
%{__sed} -i -e 's/rd.template/# rd.template/' Rakefile
-%{__sed} -i -e 's|ext/apache2/ApplicationPoolServerExecutable|%{apachelibdir2}/ApplicationPoolServerExecutable|g' ext/common/Utils.cpp
+%{__sed} -i -e 's!/usr/lib!%{_libdir}!g' ext/common/ResourceLocator.h
%build
-APXS2=%{apxs} rake
+
+APXS2=%{apxs} rake apache2
APXS2=%{apxs} rake doc
+cd ext/ruby
+ruby extconf.rb
+%{__make}
+cd ../..
+
rdoc --ri --op ri lib misc ext
-rm -r ri/{ConditionVariable,Exception,GC,IO,Mysql,Object,PlatformInfo,Rake*,Signal}
+rm -r ri/{ConditionVariable,Exception,GC,IO,Mysql,Object,Signal}
rm ri/created.rid
%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{apachelibdir},%{apacheconfdir},%{_mandir}/man{1,8}} \
$RPM_BUILD_ROOT{%{ruby_rubylibdir},%{ruby_ridir},%{ruby_rdocdir}} \
- $RPM_BUILD_ROOT{%{ruby_archdir}/phusion_passenger,%{_bindir}}
+ $RPM_BUILD_ROOT%{_bindir} \
+ $RPM_BUILD_ROOT%{ruby_archdir} \
+ $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \
+ $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
install ext/apache2/mod_passenger.so $RPM_BUILD_ROOT%{apachelibdir}
-install ext/apache2/ApplicationPoolServerExecutable $RPM_BUILD_ROOT%{apachelibdir}
-install ext/phusion_passenger/native_support.so $RPM_BUILD_ROOT%{ruby_archdir}/phusion_passenger
+install ext/ruby/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_archdir}
-install bin/passenger-{config,make-enterprisey,memory-stats,spawn-server,status,stress-test} \
+install bin/passenger-{config,make-enterprisey,memory-stats,status,stress-test} bin/passenger \
$RPM_BUILD_ROOT%{_bindir}
+install agents/PassengerLoggingAgent agents/PassengerWatchdog $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents
+install agents/apache2/PassengerHelperAgent $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2
+
+install helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
+
cp -a lib/* $RPM_BUILD_ROOT%{ruby_rubylibdir}
install man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
install man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{apacheconfdir}/*.conf
%attr(755,root,root) %{apachelibdir}/*
%attr(755,root,root) %{_bindir}/passenger-*
+%attr(755,root,root) %{_bindir}/passenger*
+%attr(755,root,root) %{ruby_archdir}/*.so
+%dir %{_libdir}/phusion-passenger
+%dir %{_libdir}/phusion-passenger/agents
+%attr(755,root,root) %{_libdir}/phusion-passenger/agents/Passenger*
+%dir %{_libdir}/phusion-passenger/agents/apache2
+%attr(755,root,root) %{_libdir}/phusion-passenger/agents/apache2/Passenger*
%{ruby_rubylibdir}/phusion_passenger
-%dir %{ruby_archdir}/phusion_passenger
-%attr(755,root,root) %{ruby_archdir}/phusion_passenger/*.so
+%{ruby_rubylibdir}/phusion_passenger.rb
+%dir %{_datadir}/phusion-passenger
+%dir %{_datadir}/phusion-passenger/helper-scripts
+%attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/*
%{_mandir}/man1/*
%{_mandir}/man8/*