passenger 4.0.33 → 4.0.34

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (112) hide show
  1. checksums.yaml +15 -0
  2. checksums.yaml.gz.asc +12 -0
  3. data.tar.gz.asc +7 -7
  4. data/NEWS +60 -0
  5. data/bin/passenger-config +1 -1
  6. data/bin/passenger-install-apache2-module +510 -40
  7. data/bin/passenger-install-nginx-module +26 -2
  8. data/build/cxx_tests.rb +1 -1
  9. data/build/documentation.rb +19 -21
  10. data/build/integration_tests.rb +39 -12
  11. data/build/misc.rb +18 -0
  12. data/build/packaging.rb +116 -56
  13. data/build/rpm.rb +20 -11
  14. data/build/ruby_tests.rb +2 -3
  15. data/build/test_basics.rb +9 -0
  16. data/debian.template/passenger.conf +2 -0
  17. data/debian.template/passenger.load +2 -0
  18. data/dev/run_travis.sh +3 -5
  19. data/dev/test_rpm_packaging.sh +28 -0
  20. data/doc/Users guide Apache.idmap.txt +6 -4
  21. data/doc/users_guide_snippets/installation.txt +20 -2
  22. data/doc/users_guide_snippets/tips.txt +1 -1
  23. data/ext/common/ApplicationPool2/Pool.h +1 -1
  24. data/ext/common/Constants.h +5 -1
  25. data/ext/common/agents/HelperAgent/RequestHandler.h +1 -1
  26. data/ext/common/agents/Watchdog/AgentWatcher.cpp +20 -0
  27. data/ext/common/agents/Watchdog/Main.cpp +10 -0
  28. data/ext/ruby/passenger_native_support.c +23 -11
  29. data/helper-scripts/classic-rails-loader.rb +9 -3
  30. data/helper-scripts/classic-rails-preloader.rb +10 -4
  31. data/helper-scripts/download_binaries/extconf.rb +46 -22
  32. data/helper-scripts/meteor-loader.rb +0 -1
  33. data/helper-scripts/node-loader.js +2 -1
  34. data/helper-scripts/prespawn +7 -1
  35. data/helper-scripts/rack-loader.rb +32 -3
  36. data/helper-scripts/rack-preloader.rb +10 -4
  37. data/lib/phusion_passenger.rb +40 -21
  38. data/lib/phusion_passenger/abstract_installer.rb +7 -4
  39. data/lib/phusion_passenger/analytics_logger.rb +4 -3
  40. data/lib/phusion_passenger/config/about_command.rb +27 -6
  41. data/lib/phusion_passenger/{config.rb → config/main.rb} +3 -2
  42. data/lib/phusion_passenger/config/restart_app_command.rb +1 -1
  43. data/lib/phusion_passenger/config/validate_install_command.rb +231 -0
  44. data/lib/phusion_passenger/constants.rb +2 -0
  45. data/lib/phusion_passenger/loader_shared_helpers.rb +92 -19
  46. data/lib/phusion_passenger/native_support.rb +33 -11
  47. data/lib/phusion_passenger/packaging.rb +1 -0
  48. data/lib/phusion_passenger/platform_info.rb +5 -2
  49. data/lib/phusion_passenger/platform_info/apache.rb +229 -60
  50. data/lib/phusion_passenger/platform_info/apache_detector.rb +26 -31
  51. data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +4 -4
  52. data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +4 -4
  53. data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +1 -1
  54. data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +1 -1
  55. data/lib/phusion_passenger/platform_info/linux.rb +2 -1
  56. data/lib/phusion_passenger/platform_info/ruby.rb +7 -0
  57. data/lib/phusion_passenger/preloader_shared_helpers.rb +2 -1
  58. data/lib/phusion_passenger/request_handler.rb +2 -1
  59. data/lib/phusion_passenger/request_handler/thread_handler.rb +2 -1
  60. data/lib/phusion_passenger/standalone/runtime_installer.rb +35 -13
  61. data/lib/phusion_passenger/standalone/start_command.rb +2 -2
  62. data/lib/phusion_passenger/utils.rb +1 -23
  63. data/lib/phusion_passenger/utils/ansi_colors.rb +7 -1
  64. data/lib/phusion_passenger/utils/download.rb +36 -2
  65. data/lib/phusion_passenger/utils/native_support_utils.rb +65 -0
  66. data/resources/templates/apache2/apache_install_broken.txt.erb +20 -0
  67. data/resources/templates/apache2/config_snippets.txt.erb +2 -4
  68. data/resources/templates/apache2/present_choice_for_no_update_config.txt.erb +5 -0
  69. data/resources/templates/installer_common/cannot_access_files_as_root.txt.erb +15 -0
  70. data/resources/templates/installer_common/run_installer_as_root.txt.erb +6 -3
  71. data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +1 -1
  72. data/resources/templates/nginx/other_nginx_installations_exist.txt.erb +17 -0
  73. data/rpm/apache-passenger.conf.in +26 -0
  74. data/rpm/config.json +30 -0
  75. data/rpm/passenger.logrotate +7 -0
  76. data/rpm/passenger.spec.template +456 -0
  77. data/rpm/passenger_dynamic_thread_group.patch +16 -0
  78. data/rpm/passenger_tests_default_config_example.patch +44 -0
  79. data/rpm/rubygem-passenger-4.0.18-GLIBC_HAVE_LONG_LONG.patch +21 -0
  80. data/rpm/rubygem-passenger-4.0.18-gcc47-include-sys_types.patch +45 -0
  81. data/test/config.json.rpm-automation +15 -0
  82. data/test/integration_tests/downloaded_binaries_tests.rb +80 -2
  83. data/test/integration_tests/native_packaging_spec.rb +136 -44
  84. data/test/integration_tests/standalone_tests.rb +2 -11
  85. data/test/ruby/analytics_logger_spec.rb +65 -19
  86. data/test/ruby/utils_spec.rb +2 -0
  87. metadata +532 -548
  88. metadata.gz.asc +7 -7
  89. data/resources/templates/apache2/no_write_permission_to_passenger_root.txt.erb +0 -9
  90. data/rpm/README.rdoc +0 -117
  91. data/rpm/config/apache-passenger.conf.in +0 -19
  92. data/rpm/config/nginx-passenger.conf.in +0 -10
  93. data/rpm/config/rubygem-passenger.te +0 -10
  94. data/rpm/doc/README.nginx-alternatives +0 -5
  95. data/rpm/doc/example_yum_repository_htaccess +0 -5
  96. data/rpm/doc/footer.shtml +0 -12
  97. data/rpm/doc/header.shtml +0 -156
  98. data/rpm/nginx-alternatives.spec +0 -97
  99. data/rpm/passenger-release.spec +0 -91
  100. data/rpm/passenger.spec +0 -667
  101. data/rpm/patches/passenger-force-native.patch +0 -63
  102. data/rpm/release/RPM-GPG-KEY-stealthymonkeys +0 -33
  103. data/rpm/release/build-release.sh +0 -35
  104. data/rpm/release/build.rb +0 -301
  105. data/rpm/release/create-mirrors.sh +0 -16
  106. data/rpm/release/mirrors +0 -1
  107. data/rpm/release/mock-repo/comps.xml +0 -21
  108. data/rpm/release/mock-repo/rubygem-daemon_controller-0.2.5-1.noarch.rpm +0 -0
  109. data/rpm/release/mock-repo/rubygem-file-tail-1.0.5-1.noarch.rpm +0 -0
  110. data/rpm/release/mock-repo/rubygem-spruz-0.2.2-1.noarch.rpm +0 -0
  111. data/rpm/release/mocksetup-first.sh +0 -102
  112. data/rpm/release/mocksetup.sh +0 -67
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2013 Phusion
3
+ # Copyright (c) 2013-2014 Phusion
4
4
  #
5
5
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
6
  #
@@ -51,7 +51,20 @@ module Download
51
51
  # The default is to use the download tool's down CA database.
52
52
  # use_cache: Whether to copy the file from the download cache, if available.
53
53
  # Default: false.
54
+ # connect_timeout: The maximum amount of time to spend on DNS lookup
55
+ # and establishing the TCP connection. Set to nil to
56
+ # disable this timeout. Default: 4.
57
+ # idle_timeout: The maximum idle read time. Set to nil to set this timeout
58
+ # to the default wget value, 900. Set to nil to disable this
59
+ # timeout. Default: 5.
60
+ # total_timeout: The maximum amount of time spent on the whole download
61
+ # operation, including connection time. Only has effect on curl.
62
+ # Set to nil to disable this timeout. Default: nil.
54
63
  def download(url, output, options = {})
64
+ options = {
65
+ :connect_timeout => 4,
66
+ :idle_timeout => 5
67
+ }.merge(options)
55
68
  logger = options[:logger] || Logger.new(STDERR)
56
69
 
57
70
  if options[:use_cache] && cache_dir = PhusionPassenger.download_cache_dir
@@ -90,6 +103,20 @@ private
90
103
  command << "--cacert"
91
104
  command << options[:cacert]
92
105
  end
106
+ if options[:connect_timeout]
107
+ command << "--connect-timeout"
108
+ command << options[:connect_timeout].to_s
109
+ end
110
+ if options[:idle_timeout]
111
+ command << "--speed-time"
112
+ command << options[:idle_timeout].to_s
113
+ command << "--speed-limit"
114
+ command << "1"
115
+ end
116
+ if options[:total_timeout]
117
+ command << "--max-time"
118
+ command << options[:total_timeout].to_s
119
+ end
93
120
  command << url
94
121
  command_str = Shellwords.join(command)
95
122
  logger.info("Invoking: #{command_str}")
@@ -147,13 +174,20 @@ private
147
174
  end
148
175
 
149
176
  def download_with_wget(logger, url, output, options)
150
- command = ["wget", "--tries=3", "-O", output]
177
+ command = ["wget", "--tries=1", "-O", output]
151
178
  if !options[:show_progress]
152
179
  command << "-nv"
153
180
  end
154
181
  if options[:cacert]
155
182
  command << "--ca-certificate=#{options[:cacert]}"
156
183
  end
184
+ if options[:connect_timeout]
185
+ command << "--dns-timeout=#{options[:connect_timeout]}"
186
+ command << "--connect-timeout=#{options[:connect_timeout]}"
187
+ end
188
+ if options[:idle_timeout]
189
+ command << "--timeout=#{options[:idle_timeout]}"
190
+ end
157
191
  command << url
158
192
  command_str = Shellwords.join(command)
159
193
  logger.info("Invoking: #{command_str}")
@@ -0,0 +1,65 @@
1
+ # Phusion Passenger - https://www.phusionpassenger.com/
2
+ # Copyright (c) 2010-2014 Phusion
3
+ #
4
+ # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in
14
+ # all copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ # THE SOFTWARE.
23
+
24
+ PhusionPassenger.require_passenger_lib 'native_support'
25
+
26
+ module PhusionPassenger
27
+ module Utils
28
+
29
+ # Utility functions that can potentially be accelerated by native_support functions.
30
+ module NativeSupportUtils
31
+ extend self
32
+
33
+ if defined?(PhusionPassenger::NativeSupport)
34
+ # Split the given string into an hash. Keys and values are obtained by splitting the
35
+ # string using the null character as the delimitor.
36
+ def split_by_null_into_hash(data)
37
+ return PhusionPassenger::NativeSupport.split_by_null_into_hash(data)
38
+ end
39
+
40
+ # Wrapper for getrusage().
41
+ def process_times
42
+ return PhusionPassenger::NativeSupport.process_times
43
+ end
44
+ else
45
+ NULL = "\0".freeze
46
+
47
+ class ProcessTimes < Struct.new(:utime, :stime)
48
+ end
49
+
50
+ def split_by_null_into_hash(data)
51
+ args = data.split(NULL, -1)
52
+ args.pop
53
+ return Hash[*args]
54
+ end
55
+
56
+ def process_times
57
+ times = Process.times
58
+ return ProcessTimes.new((times.utime * 1_000_000).to_i,
59
+ (times.stime * 1_000_000).to_i)
60
+ end
61
+ end
62
+ end
63
+
64
+ end # module Utils
65
+ end # module PhusionPassenger
@@ -0,0 +1,20 @@
1
+ <red>Your Apache installation might be broken</red>
2
+
3
+ You are about to install <%= PhusionPassenger::PROGRAM_NAME %> against the following
4
+ Apache installation:
5
+
6
+ apxs2: <%= @apxs2 %>
7
+
8
+ However, this Apache installation appears to be broken, so this installer
9
+ cannot continue. To find out why this installer thinks the above Apache
10
+ installation is broken, run:
11
+
12
+ <b>export ORIG_PATH="$PATH"
13
+ <%= @sudo_s_e %>
14
+ export PATH="$ORIG_PATH"
15
+ <%= @ruby %> <%= @passenger_config %> --detect-apache2</b>
16
+
17
+ It is also possible that your system has multiple Apache installations,
18
+ and that you are simply compiling <%= PROGRAM_NAME %> against the wrong
19
+ Apache install. If this is the case, then the above command will also
20
+ advise you about what to do.
@@ -1,10 +1,8 @@
1
- <banner>The Apache 2 module was successfully installed.</banner>
1
+ <banner>Almost there!</banner>
2
2
 
3
3
  Please edit your Apache configuration file, and add these lines:
4
4
 
5
- <b>LoadModule passenger_module <%= @module_location %></b>
6
- <b>PassengerRoot <%= @passenger_root %></b>
7
- <b>PassengerDefaultRuby <%= @ruby %></b>
5
+ <b><%= @snippet.split("\n").join("\n ") %></b>
8
6
 
9
7
  After you restart Apache, you are ready to deploy any number of web
10
8
  applications on Apache, with a minimum amount of configuration!
@@ -0,0 +1,5 @@
1
+ (<yellow>Tip:</yellow> you can also re-run this installer with <yellow>--no-update-config</yellow>, to prevent
2
+ it from automatically updating your Apache configuration files. This way, the
3
+ installer will not need as many privileges. The installer will then tell you
4
+ how you must update the config files. You will then have to edit the config
5
+ files manually.)
@@ -0,0 +1,15 @@
1
+ <red>Cannot access <%= @type || "files" %></red>
2
+
3
+ This installer must be able to <%= @access || "write to" %> the following <%= @type || "files" %>:
4
+
5
+ <b><%= @files.join("\n ") %></b>
6
+
7
+ But it can't do that, despite the fact that it's running as root. There's
8
+ probably a permission problem, an SELinux problem or some kind of operating
9
+ system security problem.
10
+
11
+ This installer tried its best to find out the exact reason for this failure,
12
+ but unfortunately it couldn't figure it out, so it's up to you now. Please
13
+ find out what's wrong with your system, fix the problems, and re-run this
14
+ installer. If you don't know it either, please contact your operating system
15
+ vendor for support, or consult your operating system's manual.
@@ -1,11 +1,14 @@
1
1
  <red>Permission problems</red>
2
-
3
- This installer must be able to write to the following directory:
2
+ <% if @desc %>
3
+ This installer must be able to <%= @access || "write to" %> <%= @desc %>.
4
+ <% else %>
5
+ This installer must be able to <%= @access || "write to" %> the following directory:
4
6
 
5
7
  <b><%= @dir %></b>
6
8
 
9
+ <% end -%>
7
10
  But it can't do that, because you're running the installer as <b><%= `whoami`.strip %></b>.
8
- Please re-run this installer using <%= @sudo %>:
11
+ Please give this installer root privileges, by re-running it with <yellow><%= @sudo %></yellow>:
9
12
 
10
13
  <b>export ORIG_PATH="$PATH"
11
14
  <%= @sudo_s_e %>
@@ -6,7 +6,7 @@ Please install them with:
6
6
  <% elsif PhusionPassenger.native_packaging_method == "rpm" %>
7
7
  Please install them with:
8
8
 
9
- <b>sudo yum install <%= RPM_DEV_PACKAGE %></b>
9
+ <b>sudo yum install <%= RPM_DEV_PACKAGE %>-<%= VERSION_STRING %></b>
10
10
  <% else %>
11
11
  Please ask your operating system vendor how to solve this problem.
12
12
  <% end %>
@@ -0,0 +1,17 @@
1
+ <yellow>Wait! You are about to install a NEW Nginx installation!</yellow>
2
+
3
+ Your system already has an Nginx installation at:
4
+
5
+ <b><%= @existing_binary %></b>
6
+
7
+ If you continue using this installer, then it will install an <b>an entirely new</b>
8
+ Nginx installation, at <b><%= @prefix %>/sbin/nginx</b>.
9
+ Are you sure this is what you want?
10
+
11
+ <yellow>"Wait, what? Do you mean you're not going to extend my existing Nginx with
12
+ <%= PROGRAM_NAME %> support?"</yellow>
13
+ We're sorry, but no. Please read the following for more information, and for
14
+ advise on how to deal with this situation:
15
+ <b>https://github.com/phusion/passenger/wiki/Why-can't-Phusion-Passenger-extend-my-existing-Nginx%3F</b>
16
+
17
+ <b>Press Enter to continue installing, or Ctrl-C to abort.</b>
@@ -0,0 +1,26 @@
1
+ ### Begin automatically installed Phusion Passenger load snippet ###
2
+ LoadModule passenger_module modules/mod_passenger.so
3
+ ### End automatically installed Phusion Passenger load snippet ###
4
+ ### Begin automatically installed Phusion Passenger config snippet ###
5
+ <IfModule mod_passenger.c>
6
+ PassengerRoot @PASSENGERROOT@
7
+ PassengerRuby /usr/bin/ruby
8
+ </IfModule>
9
+ ### End automatically installed Phusion Passenger config snippet ###
10
+
11
+ # Deploying a web application: an example
12
+
13
+ # Suppose you have a web application in /somewhere. Add a virtual host to
14
+ # your Apache configuration file and set its DocumentRoot to /somewhere/public:
15
+ #
16
+ # <VirtualHost *:80>
17
+ # ServerName www.yourhost.com
18
+ # # Be sure to point to 'public'!
19
+ # DocumentRoot /somewhere/public
20
+ # <Directory /somewhere/public>
21
+ # # Relax Apache security settings
22
+ # AllowOverride all
23
+ # # <-- MultiViews must be turned off
24
+ # Options -MultiViews
25
+ # </Directory>
26
+ # </VirtualHost>
@@ -0,0 +1,30 @@
1
+ {
2
+ //// This file contains system-specific configuration options that the test suite needs.
3
+ //// Please customize it for your system.
4
+
5
+ // These are the usernames and group names of normal, non-administrator
6
+ // users and groups. Preferably, these are user and group accounts that
7
+ // are normally not used.
8
+ //
9
+ // These users and groups MUST be able to access this 'test' directory,
10
+ // otherwise the tests will fail.
11
+
12
+ ///// Good values for Linux and FreeBSD. Same restrictions apply.
13
+ "normal_user_1": "games",
14
+ "normal_user_2": "daemon",
15
+ "default_user": "man",
16
+ "normal_group_1": "daemon",
17
+ "normal_group_2": "man",
18
+ "default_group": "games",
19
+
20
+ // A nonexistant username, group name, user ID and group ID.
21
+ "nonexistant_user": "xxxxxxxxxxxxxxxxxxx",
22
+ "nonexistant_group": "xxxxxxxxxxxxxxxxxxx",
23
+ "nonexistant_uid": 9999,
24
+ "nonexistant_gid": 9999,
25
+
26
+ // If you want to run the Nginx integration tests, then set the following
27
+ // config option to the full path of the Nginx binary. This Nginx binary *must*
28
+ // be compiled with Phusion Passenger support!
29
+ "nginx": "/usr/local/sbin/nginx"
30
+ }
@@ -0,0 +1,7 @@
1
+ /var/log/passenger-analytics/*.log {
2
+ missingok
3
+ notifempty
4
+ sharedscripts
5
+ compress
6
+ delaycompress
7
+ }
@@ -0,0 +1,456 @@
1
+ %global package_name <%= RPM_NAME %>
2
+ %global namespace <%= GLOBAL_NAMESPACE_DIRNAME %>
3
+ %global nginx_version <%= PREFERRED_NGINX_VERSION %>
4
+ %global bundled_boost_version 1.54.0
5
+
6
+ %if 0%{?fc18}
7
+ %global rubyabi 1.9.1
8
+ %endif
9
+
10
+ %if 0%{?el6}
11
+ %global rubyabi 1.8
12
+ %endif
13
+
14
+ %if 0%{?fedora} >= 19
15
+ %global gem_extdir %{gem_extdir_mri}
16
+ %endif
17
+ %{!?gem_extdir: %global gem_extdir %{gem_instdir}/extdir}
18
+
19
+ %{!?_httpd_mmn: %{expand: %%global _httpd_mmn %%(cat %{_includedir}/httpd/.mmn 2>/dev/null || echo missing-httpd-devel)}}
20
+ %{!?_httpd_confdir: %{expand: %%global _httpd_confdir %%{_sysconfdir}/httpd/conf.d}}
21
+ # /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
22
+ %{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
23
+ %{!?_httpd_moddir: %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}}
24
+
25
+ %global ruby_dir_version %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["ruby_version"]')
26
+ %global ruby_arch_name %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["arch"]')
27
+ %{!?ruby_sitelibdir: %global ruby_sitelibdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]')}
28
+ %{!?ruby_sitearchdir: %global ruby_sitearchdir %(ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitearchdir"]')}
29
+ %global passenger_ruby_libdir %{ruby_sitelibdir}
30
+ %global locations_ini %{passenger_ruby_libdir}/phusion_passenger/locations.ini
31
+
32
+
33
+ Summary: Phusion Passenger application server
34
+ Name: %{package_name}
35
+ Version: 4.0.33
36
+ Release: 1%{?dist}
37
+ Group: System Environment/Daemons
38
+ # Passenger code uses MIT license.
39
+ # Bundled(Boost) uses Boost Software License
40
+ # BCrypt and Blowfish files use BSD license.
41
+ # Documentation is CC-BY-SA
42
+ # See: https://bugzilla.redhat.com/show_bug.cgi?id=470696#c146
43
+ License: Boost and BSD and BSD with advertising and MIT and zlib
44
+ URL: https://www.phusionpassenger.com
45
+ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
46
+
47
+ Source: http://s3.amazonaws.com/phusion-passenger/releases/passenger-%{version}.tar.gz
48
+ Source1: http://nginx.org/download/nginx-%{nginx_version}.tar.gz
49
+ Source10: passenger.logrotate
50
+ Source11: apache-passenger.conf.in
51
+ Source12: config.json
52
+
53
+ # Include sys/types.h for GCC 4.7
54
+ Patch2: rubygem-passenger-4.0.18-gcc47-include-sys_types.patch
55
+
56
+ # Make example config for tests ready for linux by default
57
+ Patch4: passenger_tests_default_config_example.patch
58
+
59
+ # Test tries to spawn 1000 threads with 256kb stacks. Default Linux settings
60
+ # deny allocating so much, causing test to fail. Let's use 8kb stacks instead.
61
+ Patch102: passenger_dynamic_thread_group.patch
62
+
63
+ # https://bugzilla.redhat.com/show_bug.cgi?id=985634
64
+ Patch107: rubygem-passenger-4.0.18-GLIBC_HAVE_LONG_LONG.patch
65
+
66
+ Requires: rubygems
67
+ # XXX: Needed to run passenger standalone
68
+ Requires: rubygem(daemon_controller) >= 1.1.0
69
+ Requires: rubygem(rack)
70
+ Requires: rubygem(rake)
71
+ %if 0%{?fedora} >= 19
72
+ Requires: ruby(release)
73
+ %else
74
+ Requires: ruby(abi) = %{rubyabi}
75
+ %endif
76
+
77
+ %if 0%{?rhel} >= 6 || 0%{?fedora} >= 15
78
+ BuildRequires: libcurl-devel
79
+ %else
80
+ BuildRequires: curl-devel
81
+ %endif
82
+
83
+ %if 0%{?rhel} < 6 && 0%{?fedora} <= 16
84
+ Requires: rubygem(fastthread) >= 1.0.1
85
+ BuildRequires: rubygem(fastthread) >= 1.0.1
86
+ %endif
87
+
88
+ BuildRequires: httpd-devel
89
+ BuildRequires: libev-devel >= 4.0.0
90
+ BuildRequires: ruby
91
+ BuildRequires: ruby-devel
92
+ BuildRequires: rubygems
93
+ BuildRequires: rubygems-devel
94
+ BuildRequires: rubygem(rake) >= 0.8.1
95
+ BuildRequires: rubygem(rack)
96
+ BuildRequires: zlib-devel
97
+ BuildRequires: pcre-devel
98
+ BuildRequires: openssl-devel
99
+
100
+ Provides: %{package_name} = %{version}-%{release}
101
+ Provides: bundled(boost) = %{bundled_boost_version}
102
+ Obsoletes: rubygem(passenger) < 4.0.33
103
+ Obsoletes: rubygem-passenger < 4.0.33
104
+ Obsoletes: rubygem-passenger%{_isa} < 4.0.33
105
+ Obsoletes: rubygem-passenger-native < 4.0.33
106
+ Obsoletes: rubygem-passenger-native%{?_isa} < 4.0.33
107
+
108
+ %description
109
+ Phusion Passenger® is a web server and application server, designed to be fast, robust
110
+ and lightweight. It takes a lot of complexity out of deploying web apps, adds powerful
111
+ enterprise-grade features that are useful in production, and makes administration much
112
+ easier and less complex. It supports Ruby, Python, Node.js and Meteor.
113
+
114
+ %package -n mod_passenger
115
+ Summary: Apache Module for Phusion Passenger
116
+ Group: System Environment/Daemons
117
+ BuildRequires: httpd-devel
118
+ Requires: httpd-mmn = %{_httpd_mmn}
119
+ Requires: %{package_name} = %{version}-%{release}
120
+ License: Boost and BSD and BSD with advertising and MIT and zlib
121
+
122
+ %description -n mod_passenger
123
+ This package contains the pluggable Apache server module for Phusion Passenger®.
124
+
125
+ %package devel
126
+ Summary: Phusion Passenger development files
127
+ Group: System Environment/Daemons
128
+ Requires: %{package_name}%{?_isa} = %{version}-%{release}
129
+ Provides: bundled(boost-devel) = %{bundled_boost_version}
130
+ Obsoletes: rubygem-passenger-devel < 4.0.33
131
+ Obsoletes: rubygem-passenger-devel%{?_isa} < 4.0.33
132
+ License: Boost and BSD and BSD with advertising and GPL+ and MIT and zlib
133
+
134
+ %description devel
135
+ This package contains development files for Phusion Passenger®. Installing this
136
+ package allows it to compile native extensions for non-standard Ruby interpreters,
137
+ and allows Passenger Standalone to use a different Nginx core version.
138
+
139
+ %package doc
140
+ Summary: Phusion Passenger documentation
141
+ Group: System Environment/Daemons
142
+ Requires: %{package_name} = %{version}-%{release}
143
+ Obsoletes: rubygem-passenger-doc < 4.0.33
144
+ BuildArch: noarch
145
+ License: CC-BY-SA and MIT and (MIT or GPL+)
146
+
147
+ %description doc
148
+ This package contains documentation files for Phusion Passenger®.
149
+
150
+ %package native-libs
151
+ Summary: Phusion Passenger native extensions
152
+ Group: System Environment/Daemons
153
+ Requires: %{package_name}%{?_isa} = %{version}-%{release}
154
+ Requires: ruby
155
+ Obsoletes: rubygem-passenger-native-libs < 4.0.33
156
+ Obsoletes: rubygem-passenger-native-libs%{?_isa} < 4.0.33
157
+ License: Boost and BSD and BSD with advertising and MIT and zlib
158
+ %description native-libs
159
+ This package contains Phusion Passenger® native extensions for Ruby.
160
+ It has been separated so that installing a new Ruby interpreter only
161
+ necessitates rebuilding this package.
162
+
163
+
164
+ %prep
165
+ %setup -q -n %{package_name}-%{version}
166
+ tar xzf %{SOURCE1}
167
+
168
+ %patch2 -p1 -b .include-sys-types
169
+ %patch4 -p1 -b .lindefault
170
+ %patch102 -p1 -b .threadtest
171
+
172
+ # fix passenger boost for glibc >= 2.18
173
+ %if 0%{?fedora} >= 20
174
+ %patch107 -p1 -b .glibc-long
175
+ %endif
176
+
177
+ # Don't use bundled libev
178
+ %{__rm} -rf ext/libev
179
+
180
+ %build
181
+ export EXTRA_CFLAGS="${CFLAGS:-%optflags} -Wno-deprecated"
182
+ export EXTRA_CXXFLAGS="${CXXFLAGS:-%optflags} -Wno-deprecated"
183
+
184
+ # Reduce optimization level. Passenger has not been tested with -O2.
185
+ export EXTRA_CFLAGS=`echo "$EXTRA_CFLAGS" | sed 's|-O2|-O|g'`
186
+ export EXTRA_CXXFLAGS=`echo "$EXTRA_CXXFLAGS" | sed 's|-O2|-O|g'`
187
+
188
+ export USE_VENDORED_LIBEV=false
189
+
190
+ # Speed up ccache (reduce I/O) by lightly compressing things.
191
+ # Always set these variables because pbuilder uses ccache transparently.
192
+ export CCACHE_COMPRESS=1
193
+ export CCACHE_COMPRESS_LEVEL=3
194
+
195
+ # Build Passenger.
196
+ rake fakeroot \
197
+ NATIVE_PACKAGING_METHOD=rpm \
198
+ FS_PREFIX=%{_prefix} \
199
+ FS_BINDIR=%{_bindir} \
200
+ FS_SBINDIR=%{_sbindir} \
201
+ FS_DATADIR=%{_datadir} \
202
+ FS_DOCDIR=%{_docdir} \
203
+ FS_LIBDIR=%{_libdir} \
204
+ RUBYLIBDIR=%{ruby_sitelibdir} \
205
+ RUBYARCHDIR=%{ruby_sitearchdir} \
206
+ APACHE2_MODULE_PATH=%{_httpd_moddir}/mod_passenger.so
207
+
208
+ # Build Nginx core for Passenger Standalone.
209
+ nginx_config_opts=`ruby -Ilib -rphusion_passenger -e 'PhusionPassenger.locate_directories; PhusionPassenger.require_passenger_lib "constants"; puts PhusionPassenger::STANDALONE_NGINX_CONFIGURE_OPTIONS'`
210
+ pushd nginx-%{nginx_version}
211
+ ./configure --prefix=/tmp $nginx_config_opts --add-module=`pwd`/../ext/nginx
212
+ make
213
+ popd
214
+
215
+
216
+ %install
217
+ %{__rm} -rf %{buildroot}
218
+ %{__mkdir} %{buildroot}
219
+ %{__cp} -a pkg/fakeroot/* %{buildroot}/
220
+ %{__cp} nginx-%{nginx_version}/objs/nginx %{buildroot}%{_libdir}/%{namespace}/PassengerWebHelper
221
+
222
+ # Install bootstrapping code into the executables and the Nginx config script.
223
+ ./dev/install_scripts_bootstrap_code.rb --ruby %{passenger_ruby_libdir} %{buildroot}%{_bindir}/* %{buildroot}%{_sbindir}/*
224
+ ./dev/install_scripts_bootstrap_code.rb --nginx-module-config %{_bindir} %{buildroot}%{_datadir}/%{namespace}/ngx_http_passenger_module/config
225
+
226
+ # Install Apache config.
227
+ %{__mkdir_p} %{buildroot}%{_httpd_confdir} %{buildroot}%{_httpd_modconfdir}
228
+ %{__sed} -e 's|@PASSENGERROOT@|%{passenger_ruby_libdir}/phusion_passenger/locations.ini|g' %{SOURCE11} > passenger.conf
229
+
230
+ %if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
231
+ %{__sed} -n /^LoadModule/p passenger.conf > 10-passenger.conf
232
+ %{__sed} -i /^LoadModule/d passenger.conf
233
+ touch -r %{SOURCE11} 10-passenger.conf
234
+ install -pm 0644 10-passenger.conf %{buildroot}%{_httpd_modconfdir}/passenger.conf
235
+ %endif
236
+ touch -r %{SOURCE11} passenger.conf
237
+ install -pm 0644 passenger.conf %{buildroot}%{_httpd_confdir}/passenger.conf
238
+
239
+ # Install man pages into the proper location.
240
+ %{__mkdir_p} %{buildroot}%{_mandir}/man1
241
+ %{__mkdir_p} %{buildroot}%{_mandir}/man8
242
+ %{__cp} man/*.1 %{buildroot}%{_mandir}/man1
243
+ %{__cp} man/*.8 %{buildroot}%{_mandir}/man8
244
+
245
+ # Make our ghost log and run directories...
246
+ %{__mkdir_p} %{buildroot}%{_localstatedir}/log/passenger-analytics
247
+
248
+ # logrotate
249
+ %{__mkdir_p} %{buildroot}%{_sysconfdir}/logrotate.d
250
+ install -pm 0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/logrotate.d/passenger
251
+
252
+
253
+ %check
254
+ export EXTRA_CFLAGS="${CFLAGS:-%optflags} -Wno-deprecated"
255
+ export EXTRA_CXXFLAGS="${CXXFLAGS:-%optflags} -Wno-deprecated"
256
+ export EXTRA_CFLAGS=`echo "$EXTRA_CFLAGS" | sed 's|-O2||g'`
257
+ export EXTRA_CXXFLAGS=`echo "$EXTRA_CXXFLAGS" | sed 's|-O2||g'`
258
+ export USE_VENDORED_LIBEV=false
259
+ export CCACHE_COMPRESS=1
260
+ export CCACHE_COMPRESS_LEVEL=3
261
+
262
+ # Running the full test suite is not only slow, but also impossible
263
+ # because not all requirements are packaged by Fedora. It's also not
264
+ # too useful because Phusion Passenger is automatically tested by a CI
265
+ # server on every commit. The C++ tests are the most likely to catch
266
+ # any platform-specific bugs (e.g. bugs caused by wrong compiler options)
267
+ # so we only run those. Note that the C++ tests are highly timing
268
+ # sensitive, so sometimes they may fail even though nothing is really
269
+ # wrong. We therefore do not make failures fatal, although the result
270
+ # should still be checked.
271
+ %{__cp} %{SOURCE12} test/config.json
272
+ rake test:cxx || true
273
+
274
+ %files
275
+ %doc "%{_docdir}/%{namespace}/Users guide.html"
276
+ %doc "%{_docdir}/%{namespace}/Users guide Nginx.html"
277
+ %doc "%{_docdir}/%{namespace}/Users guide Apache.html"
278
+ %doc "%{_docdir}/%{namespace}/Users guide Standalone.html"
279
+ %{_bindir}
280
+ %{_sbindir}
281
+ %{_libdir}/%{namespace}/PassengerWebHelper
282
+ %{_libdir}/%{namespace}/agents
283
+ %{_datadir}/%{namespace}/helper-scripts
284
+ %{_datadir}/%{namespace}/templates
285
+ %{_datadir}/%{namespace}/standalone_default_root
286
+ %{_datadir}/%{namespace}/node
287
+ %{_datadir}/%{namespace}/*.types
288
+ %{_datadir}/%{namespace}/*.crt
289
+ %{_datadir}/%{namespace}/*.txt
290
+ %dir %{_localstatedir}/log/passenger-analytics
291
+ %{_sysconfdir}/logrotate.d/passenger
292
+ %{_mandir}
293
+ %{passenger_ruby_libdir}
294
+
295
+ %files doc
296
+ %doc %{_docdir}/%{namespace}
297
+
298
+ %files devel
299
+ %{_datadir}/%{namespace}/ngx_http_passenger_module
300
+ %{_datadir}/%{namespace}/ruby_extension_source
301
+ %{_datadir}/%{namespace}/include
302
+ %{_libdir}/%{namespace}/common
303
+
304
+ %files -n mod_passenger
305
+ %config(noreplace) %{_httpd_modconfdir}/*.conf
306
+ %if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
307
+ %config(noreplace) %{_httpd_confdir}/*.conf
308
+ %endif
309
+ %doc "%{_docdir}/%{namespace}/Users guide Apache.html"
310
+ %{_httpd_moddir}/mod_passenger.so
311
+
312
+ %files native-libs
313
+ %{ruby_sitearchdir}/passenger_native_support.so
314
+
315
+ %changelog
316
+ * Thu Nov 14 2013 Jan Kaluza <jkaluza@redhat.com> - 4.0.18-4
317
+ - load native library from proper path
318
+
319
+ * Thu Oct 31 2013 Jan Kaluza <jkaluza@redhat.com> - 4.0.18-3
320
+ - fix #1021940 - add locations.ini with proper Fedora locations
321
+
322
+ * Wed Sep 25 2013 Troy Dawson <tdawson@redhat.com> - 4.0.18-2
323
+ - Cleanup spec file
324
+ - Fix for bz#987879
325
+
326
+ * Tue Sep 24 2013 Troy Dawson <tdawson@redhat.com> - 4.0.18-1
327
+ - Update to 4.0.18
328
+ - Remove patches no longer needed
329
+ - Update patches that need updating
330
+
331
+ * Mon Sep 23 2013 Brett Lentz <blentz@redhat.com> - 3.0.21-9
332
+ - finish fixing bz#999384
333
+
334
+ * Fri Sep 20 2013 Joe Orton <jorton@redhat.com> - 3.0.21-8
335
+ - update packaging for httpd 2.4.x
336
+
337
+ * Thu Sep 19 2013 Troy Dawson <tdawson@redhat.com> - 3.0.21-7
338
+ - Fix for F20 FTBFS (#993310)
339
+
340
+ * Thu Aug 22 2013 Brett Lentz <blentz@redhat.com> - 3.0.21-6
341
+ - bz#999384
342
+
343
+ * Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.21-5
344
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
345
+
346
+ * Thu Jul 18 2013 Troy Dawson <tdawson@redhat.com> - 3.0.21-4
347
+ - Fix for CVE-2013-4136 (#985634)
348
+
349
+ * Fri Jun 21 2013 Troy Dawson <tdawson@redhat.com> - 3.0.21-3
350
+ - Putting the agents back to where they originally were
351
+
352
+ * Fri Jun 21 2013 Troy Dawson <tdawson@redhat.com> - 3.0.21-2
353
+ - Remove Rakefile (only used for building) (#976843)
354
+
355
+ * Thu May 30 2013 Troy Dawson <tdawson@redhat.com> - 3.0.21-1
356
+ - Update to version 3.0.21
357
+ - Fix for CVE-2013-2119
358
+
359
+ * Thu May 16 2013 Troy Dawson <tdawson@redhat.com> - 3.0.19-4
360
+ - Fix to make agents work on F19+
361
+
362
+ * Wed Mar 13 2013 Troy Dawson <tdawson@redhat.com> - 3.0.19-3
363
+ - Fix to make it build/install on F19+
364
+ - Added patch105
365
+
366
+ * Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0.19-2
367
+ - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
368
+
369
+ * Sun Jan 20 2013 Orion Poplawski <orion@cora.nwra.com> - 3.0.19-1
370
+ - Update to 3.0.19
371
+
372
+ * Wed Sep 19 2012 Orion Poplawski <orion@cora.nwra.com> - 3.0.17-3
373
+ - Drop dependency on rubygem(file-tail), no longer needed
374
+
375
+ * Fri Sep 7 2012 Brett Lentz <blentz@redhat.com> - 3.0.17-2
376
+ - Fix License
377
+
378
+ * Thu Sep 6 2012 Brett Lentz <blentz@redhat.com> - 3.0.17-1
379
+ - update to 3.0.17
380
+
381
+ * Wed Sep 5 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-15
382
+ - add support for tmpfiles.d
383
+
384
+ * Tue Sep 4 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-14
385
+ - Fix License tag
386
+ - Fix gem_extdir ownership issue
387
+
388
+ * Wed Aug 29 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-13
389
+ - fix pathing issues
390
+ - fix ruby abi requires
391
+
392
+ * Wed Aug 29 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-12
393
+ - remove capability for running passenger standalone until daemon_controller is updated
394
+
395
+ * Tue Aug 28 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-11
396
+ - fix issues with fastthread
397
+
398
+ * Mon Aug 27 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-10
399
+ - get test suite sort of working
400
+ - move agents to gem_extdir
401
+
402
+ * Fri Aug 24 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-9
403
+ - stop using _bindir
404
+ - fix native libs path
405
+ - fix ownership on extdir
406
+ - improve test output
407
+
408
+ * Wed Aug 22 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-8
409
+ - removed policycoreutils requirement
410
+ - moved native libs to gem_extdir
411
+
412
+ * Wed Aug 22 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-7
413
+ - remove selinux policy module. it's in the base policy now.
414
+
415
+ * Fri Aug 17 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-6
416
+ - put native-libs into ruby_vendorarchdir.
417
+
418
+ * Thu Aug 16 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-5
419
+ - clean up packaging and file placement.
420
+ - add logrotate file for /var/log/passenger-analytics
421
+
422
+ * Wed Aug 15 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-4
423
+ - backported fix only needed on f18+
424
+
425
+ * Wed Aug 15 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-3
426
+ - backport fix from https://svn.boost.org/trac/boost/ticket/6940
427
+
428
+ * Mon Aug 13 2012 Brett Lentz <blentz@redhat.com> - 3.0.14-2
429
+ - remove F15 conditional. F15 is EOL.
430
+
431
+ * Fri Jul 27 2012 Troy Dawson <tdawson@redhat.com> - 3.0.14-1
432
+ - Updated to version 3.0.14
433
+
434
+ * Fri Jul 27 2012 Troy Dawson <tdawson@redhat.com> - 3.0.12-6
435
+ - Added patch20, spawn-ip
436
+ - Changed selinux files to be more dynamic
437
+
438
+ * Tue Jun 05 2012 Troy Dawson <tdawson@redhat.com> - 3.0.12-5
439
+ - Add all the selinux files
440
+
441
+ * Tue Jun 05 2012 Troy Dawson <tdawson@redhat.com> - 3.0.12-4
442
+ - Added selinux configurations
443
+
444
+ * Tue Jun 05 2012 Troy Dawson <tdawson@redhat.com> - 3.0.12-3
445
+ - Added native and native-libs rpms.
446
+
447
+ * Mon Apr 16 2012 Brett Lentz <blentz@redhat.com> - 3.0.12-2
448
+ - Add dist to release.
449
+ - Shuffle around deprecated buildrequires and requires.
450
+
451
+ * Mon Apr 16 2012 Brett Lentz <blentz@redhat.com> - 3.0.12-1
452
+ - Update to 3.0.12
453
+ - Incorporate specfile changes from kanarip's version
454
+
455
+ * Wed Apr 11 2012 Brett Lentz <blentz@redhat.com> - 3.0.11-1
456
+ - Initial spec file