passenger 3.9.2.beta → 4.0.0.rc4

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 (159) hide show
  1. data/.travis.yml +3 -0
  2. data/NEWS +77 -7
  3. data/README.md +3 -11
  4. data/bin/passenger-install-apache2-module +24 -20
  5. data/bin/passenger-install-nginx-module +25 -23
  6. data/build/agents.rb +11 -0
  7. data/build/apache2.rb +9 -5
  8. data/build/basics.rb +37 -30
  9. data/build/common_library.rb +4 -1
  10. data/build/cplusplus_support.rb +5 -5
  11. data/build/cxx_tests.rb +28 -8
  12. data/build/integration_tests.rb +6 -3
  13. data/build/nginx.rb +3 -3
  14. data/build/packaging.rb +95 -57
  15. data/build/ruby_extension.rb +34 -21
  16. data/build/ruby_tests.rb +4 -2
  17. data/build/test_basics.rb +1 -1
  18. data/dev/run_travis.sh +36 -1
  19. data/doc/Users guide Apache.html +425 -308
  20. data/doc/Users guide Apache.idmap.txt +78 -70
  21. data/doc/Users guide Apache.index.sqlite3 +0 -0
  22. data/doc/Users guide Apache.txt +33 -92
  23. data/doc/Users guide Nginx.html +519 -220
  24. data/doc/Users guide Nginx.idmap.txt +78 -60
  25. data/doc/Users guide Nginx.txt +115 -26
  26. data/doc/Users guide Standalone.html +8 -2
  27. data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +1 -7
  28. data/doc/users_guide_snippets/installation.txt +167 -22
  29. data/doc/users_guide_snippets/rackup_specifications.txt +4 -0
  30. data/doc/users_guide_snippets/since_version.txt +1 -0
  31. data/doc/users_guide_snippets/support_information.txt +3 -7
  32. data/doc/users_guide_snippets/tips.txt +0 -24
  33. data/ext/apache2/Configuration.cpp +11 -33
  34. data/ext/apache2/Configuration.hpp +3 -18
  35. data/ext/apache2/DirectoryMapper.h +20 -70
  36. data/ext/apache2/Hooks.cpp +2 -2
  37. data/ext/common/AgentsStarter.cpp +0 -2
  38. data/ext/common/AgentsStarter.h +0 -1
  39. data/ext/common/AgentsStarter.hpp +1 -3
  40. data/ext/common/ApplicationPool2/AppTypes.cpp +74 -0
  41. data/ext/common/ApplicationPool2/AppTypes.h +202 -0
  42. data/ext/common/ApplicationPool2/Common.h +12 -10
  43. data/ext/common/ApplicationPool2/DirectSpawner.h +256 -0
  44. data/ext/common/ApplicationPool2/DummySpawner.h +90 -0
  45. data/ext/common/ApplicationPool2/Group.h +311 -94
  46. data/ext/common/ApplicationPool2/Implementation.cpp +405 -145
  47. data/ext/common/ApplicationPool2/Options.h +24 -26
  48. data/ext/common/ApplicationPool2/PipeWatcher.h +20 -13
  49. data/ext/common/ApplicationPool2/Pool.h +326 -183
  50. data/ext/common/ApplicationPool2/Process.h +205 -55
  51. data/ext/common/ApplicationPool2/README.md +1 -1
  52. data/ext/common/ApplicationPool2/Session.h +21 -10
  53. data/ext/common/ApplicationPool2/SmartSpawner.h +801 -0
  54. data/ext/common/ApplicationPool2/Spawner.h +141 -1149
  55. data/ext/common/ApplicationPool2/SpawnerFactory.h +132 -0
  56. data/ext/common/ApplicationPool2/SuperGroup.h +146 -223
  57. data/ext/common/Constants.h +4 -2
  58. data/ext/common/Exceptions.h +23 -1
  59. data/ext/common/Logging.cpp +17 -6
  60. data/ext/common/Logging.h +37 -7
  61. data/ext/common/ResourceLocator.h +1 -1
  62. data/ext/common/Utils.cpp +49 -1
  63. data/ext/common/Utils.h +13 -4
  64. data/ext/common/{AnsiColorConstants.h → Utils/AnsiColorConstants.h} +0 -0
  65. data/ext/common/{BCrypt.cpp → Utils/BCrypt.cpp} +0 -0
  66. data/ext/common/{BCrypt.h → Utils/BCrypt.h} +0 -0
  67. data/ext/common/{Blowfish.c → Utils/Blowfish.c} +0 -0
  68. data/ext/common/{Blowfish.h → Utils/Blowfish.h} +0 -0
  69. data/ext/common/Utils/CachedFileStat.hpp +27 -25
  70. data/ext/common/Utils/Curl.h +184 -0
  71. data/ext/common/{HttpConstants.h → Utils/HttpConstants.h} +3 -0
  72. data/ext/common/Utils/IOUtils.cpp +6 -2
  73. data/ext/common/{IniFile.h → Utils/IniFile.h} +0 -0
  74. data/ext/common/Utils/LargeFiles.cpp +30 -0
  75. data/ext/common/Utils/LargeFiles.h +40 -0
  76. data/ext/common/Utils/StrIntUtils.cpp +72 -8
  77. data/ext/common/Utils/StrIntUtils.h +24 -2
  78. data/ext/common/Utils/StringMap.h +12 -2
  79. data/ext/common/Utils/VariantMap.h +51 -2
  80. data/ext/common/Utils/jsoncpp.cpp +1 -1
  81. data/ext/common/agents/Base.cpp +147 -11
  82. data/ext/common/agents/HelperAgent/AgentOptions.h +14 -6
  83. data/ext/common/agents/HelperAgent/Main.cpp +79 -19
  84. data/ext/common/agents/HelperAgent/RequestHandler.h +36 -16
  85. data/ext/common/agents/LoggingAgent/LoggingServer.h +3 -5
  86. data/ext/common/agents/LoggingAgent/Main.cpp +2 -4
  87. data/ext/common/agents/LoggingAgent/RemoteSender.h +18 -24
  88. data/ext/common/agents/SpawnPreparer.cpp +7 -0
  89. data/ext/common/agents/Watchdog/Main.cpp +96 -38
  90. data/ext/nginx/Configuration.c +26 -22
  91. data/ext/nginx/Configuration.h +4 -2
  92. data/ext/nginx/ContentHandler.c +23 -52
  93. data/ext/nginx/ContentHandler.h +5 -11
  94. data/ext/nginx/config +10 -3
  95. data/ext/nginx/ngx_http_passenger_module.c +21 -6
  96. data/ext/nginx/ngx_http_passenger_module.h +4 -1
  97. data/ext/oxt/dynamic_thread_group.hpp +9 -1
  98. data/ext/oxt/system_calls.cpp +2 -2
  99. data/ext/ruby/extconf.rb +2 -1
  100. data/helper-scripts/backtrace-sanitizer.rb +2 -0
  101. data/helper-scripts/wsgi-loader.py +54 -21
  102. data/lib/phusion_passenger.rb +5 -3
  103. data/lib/phusion_passenger/abstract_installer.rb +18 -41
  104. data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
  105. data/lib/phusion_passenger/admin_tools/server_instance.rb +2 -2
  106. data/lib/phusion_passenger/common_library.rb +23 -3
  107. data/lib/phusion_passenger/debug_logging.rb +10 -3
  108. data/lib/phusion_passenger/packaging.rb +1 -0
  109. data/lib/phusion_passenger/platform_info.rb +113 -115
  110. data/lib/phusion_passenger/platform_info/compiler.rb +224 -134
  111. data/lib/phusion_passenger/platform_info/cxx_portability.rb +143 -0
  112. data/lib/phusion_passenger/platform_info/depcheck.rb +371 -0
  113. data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +124 -0
  114. data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +97 -0
  115. data/lib/phusion_passenger/platform_info/depcheck_specs/gems.rb +39 -0
  116. data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +118 -0
  117. data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +137 -0
  118. data/lib/phusion_passenger/platform_info/depcheck_specs/utilities.rb +15 -0
  119. data/lib/phusion_passenger/platform_info/operating_system.rb +6 -5
  120. data/lib/phusion_passenger/platform_info/ruby.rb +45 -34
  121. data/lib/phusion_passenger/request_handler.rb +35 -22
  122. data/lib/phusion_passenger/request_handler/thread_handler.rb +5 -6
  123. data/lib/phusion_passenger/ruby_core_enhancements.rb +7 -1
  124. data/lib/phusion_passenger/standalone/runtime_installer.rb +43 -34
  125. data/lib/phusion_passenger/utils/robust_interruption.rb +34 -18
  126. data/passenger.gemspec +25 -0
  127. data/resources/templates/standalone/config.erb +3 -1
  128. data/test/config.json.travis +2 -2
  129. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +37 -5
  130. data/test/cxx/ApplicationPool2/PoolTest.cpp +143 -50
  131. data/test/cxx/ApplicationPool2/ProcessTest.cpp +8 -0
  132. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +28 -17
  133. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +31 -26
  134. data/test/cxx/RequestHandlerTest.cpp +17 -1
  135. data/test/cxx/UtilsTest.cpp +84 -10
  136. data/test/integration_tests/apache2_tests.rb +49 -163
  137. data/test/integration_tests/hello_world_wsgi_spec.rb +2 -2
  138. data/test/integration_tests/mycook_spec.rb +1 -1
  139. data/test/integration_tests/nginx_tests.rb +37 -19
  140. data/test/ruby/request_handler_spec.rb +1 -0
  141. data/test/ruby/spec_helper.rb +52 -1
  142. data/test/stub/nginx/nginx.conf.erb +2 -0
  143. data/test/stub/rack/start.rb +5 -0
  144. data/test/stub/rails3.0/Gemfile.lock +30 -30
  145. data/test/stub/rails3.1/Gemfile +1 -1
  146. data/test/stub/rails3.1/Gemfile.lock +3 -3
  147. data/test/stub/rails3.2/Gemfile +1 -1
  148. data/test/stub/rails3.2/Gemfile.lock +4 -4
  149. data/test/stub/rails_apps/2.3/mycook/app/controllers/welcome_controller.rb +1 -1
  150. data/test/stub/rails_apps/2.3/mycook/app/helpers/recipes_helper.rb +2 -0
  151. data/test/stub/rails_apps/2.3/mycook/app/helpers/test_helper.rb +2 -0
  152. data/test/stub/rails_apps/2.3/mycook/app/helpers/uploads_helper.rb +2 -0
  153. data/test/stub/rails_apps/2.3/mycook/app/helpers/welcome_helper.rb +2 -0
  154. data/test/support/nginx_controller.rb +2 -1
  155. metadata +160 -156
  156. data/build/gempackagetask.rb +0 -99
  157. data/build/packagetask.rb +0 -186
  158. data/ext/common/StringListCreator.h +0 -83
  159. data/lib/phusion_passenger/dependencies.rb +0 -657
@@ -0,0 +1,371 @@
1
+ # encoding: utf-8
2
+ require 'phusion_passenger/platform_info/ruby'
3
+ require 'phusion_passenger/platform_info/linux'
4
+ require 'phusion_passenger/platform_info/compiler'
5
+ require 'phusion_passenger/platform_info/operating_system'
6
+ require 'phusion_passenger/utils/ansi_colors'
7
+
8
+ module PhusionPassenger
9
+ module PlatformInfo
10
+
11
+ # Almost all software require other software in order to run. We call those
12
+ # other software 'dependencies'. Reliably checking for dependencies can be
13
+ # difficult. Helping the user in case a dependency is not installed (or
14
+ # doesn't seem to be installed) is more difficult still.
15
+ #
16
+ # The Depcheck framework seeks to make all this easier. It allows the programmer
17
+ # to write "specs" which contain dependency checking code in a structured way.
18
+ # The programmer defines a dependency's basic information (name, website, etc),
19
+ # defines installation instructions (which may be customized per platform) and
20
+ # defines code for checking whether the dependency actually exists. The Depcheck
21
+ # framework:
22
+ #
23
+ # * Provides helpers for checking for the existance of commands, libraries,
24
+ # headers, etc.
25
+ # * Registers all dependency specs in a way that can be easily accessed
26
+ # structurally.
27
+ # * Allows user-friendly display of dependency checking progress and user help
28
+ # instructions.
29
+ #
30
+ # Most dependency checking code (e.g. autoconf) is very straightforward: they
31
+ # just check for the existance of a command, library, header, etc and either
32
+ # report "found" or "not found". In our experience the world is unfortunately
33
+ # not that simple. Users can have multiple versions of a dependency installed,
34
+ # where some dependencies are suitable while others are not. Therefore specs
35
+ # should print as many details about the dependency as possible (location, version,
36
+ # etc) so that the user can override any decisions if necessary.
37
+ module Depcheck
38
+ THIS_DIR = File.expand_path(File.dirname(__FILE__))
39
+ @@loaded = {}
40
+ @@database = {}
41
+
42
+ def self.load(partial_filename)
43
+ if !@@loaded[partial_filename]
44
+ filename = "#{THIS_DIR}/#{partial_filename}.rb"
45
+ content = File.read(filename)
46
+ instance_eval(content, filename)
47
+ @@loaded[partial_filename] = true
48
+ end
49
+ end
50
+
51
+ def self.define(identifier, &block)
52
+ @@database[identifier.to_s] = block
53
+ end
54
+
55
+ def self.find(identifier)
56
+ # We lazy-initialize everything in order to save resources. This also
57
+ # allows blocks to perform relatively expensive checks without hindering
58
+ # startup time.
59
+ identifier = identifier.to_s
60
+ result = @@database[identifier]
61
+ if result.is_a?(Proc)
62
+ result = Dependency.new(&result)
63
+ @@database[identifier] = result
64
+ end
65
+ result
66
+ end
67
+
68
+ class Dependency
69
+ def initialize(&block)
70
+ instance_eval(&block)
71
+ check_syntax_aspect("Name must be given") { !!@name }
72
+ check_syntax_aspect("A checker must be given") { !!@checker }
73
+ end
74
+
75
+ def check
76
+ @install_comments = nil
77
+ @check_result ||= @checker.call
78
+ end
79
+
80
+ ### DSL for specs ###
81
+
82
+ def name(value = nil)
83
+ value ? @name = value : @name
84
+ end
85
+
86
+ def website(value = nil)
87
+ value ? @website = value : @website
88
+ end
89
+
90
+ def website_comments(value = nil)
91
+ value ? @website_comments = value : @website_comments
92
+ end
93
+
94
+ def install_instructions(value = nil)
95
+ if value
96
+ @install_instructions = value
97
+ else
98
+ if @install_instructions
99
+ @install_instructions
100
+ elsif @website
101
+ result = "Please download it from <b>#{@website}</b>"
102
+ result << "\n(#{@website_comments})" if @website_comments
103
+ result
104
+ else
105
+ "Search Google for '#{@name}'."
106
+ end
107
+ end
108
+ end
109
+
110
+ def install_comments(value = nil)
111
+ value ? @install_comments = value : @install_comments
112
+ end
113
+
114
+ private
115
+ def check_syntax_aspect(description)
116
+ if !yield
117
+ raise description
118
+ end
119
+ end
120
+
121
+ ### DSL for specs ###
122
+
123
+ def define_checker(&block)
124
+ @checker = block
125
+ end
126
+
127
+ def check_for_command(name)
128
+ result = find_command(name)
129
+ if result
130
+ { :found => true,
131
+ "Location" => result }
132
+ else
133
+ false
134
+ end
135
+ end
136
+
137
+ def check_for_ruby_tool(name)
138
+ result = locate_ruby_tool(name)
139
+ if result
140
+ { :found => true,
141
+ "Location" => result }
142
+ else
143
+ false
144
+ end
145
+ end
146
+
147
+ def check_for_header(header_name, language = :c, flags = nil)
148
+ if result = PlatformInfo.find_header(header_name, language, flags)
149
+ { :found => true,
150
+ "Location" => result }
151
+ else
152
+ false
153
+ end
154
+ end
155
+
156
+ # def check_for_library(name)
157
+ # check_by_compiling("int main() { return 0; }", :cxx, nil, "-l#{name}")
158
+ # end
159
+
160
+ # def check_by_compiling(source, language = :c, cflags = nil, linkflags = nil)
161
+ # case language
162
+ # when :c
163
+ # source_file = "#{PlatformInfo.tmpexedir}/depcheck-#{Process.pid}-#{Thread.current.object_id}.c"
164
+ # compiler = "gcc"
165
+ # compiler_flags = ENV['CFLAGS']
166
+ # when :cxx
167
+ # source_file = "#{PlatformInfo.tmpexedir}/depcheck-#{Process.pid}-#{Thread.current.object_id}.cpp"
168
+ # compiler = "g++"
169
+ # compiler_flags = "#{ENV['CFLAGS']} #{ENV['CXXFLAGS']}".strip
170
+ # else
171
+ # raise ArgumentError, "Unknown language '#{language}"
172
+ # end
173
+
174
+ # output_file = "#{PlatformInfo.tmpexedir}/depcheck-#{Process.pid}-#{Thread.current.object_id}"
175
+
176
+ # begin
177
+ # File.open(source_file, 'w') do |f|
178
+ # f.puts(source)
179
+ # end
180
+
181
+ # if find_command(compiler)
182
+ # command = "#{compiler} #{compiler_flags} #{cflags} " +
183
+ # "#{source_file} -o #{output_file} #{linkflags}"
184
+ # [!!system(command)]
185
+ # else
186
+ # [:unknown, "Cannot check: compiler '#{compiler}' not found."]
187
+ # end
188
+ # ensure
189
+ # File.unlink(source_file) rescue nil
190
+ # File.unlink(output_file) rescue nil
191
+ # end
192
+ # end
193
+
194
+ def check_for_ruby_library(name)
195
+ begin
196
+ require(name)
197
+ { :found => true }
198
+ rescue LoadError
199
+ if defined?(Gem)
200
+ false
201
+ else
202
+ begin
203
+ require 'rubygems'
204
+ require(name)
205
+ { :found => true }
206
+ rescue LoadError
207
+ false
208
+ end
209
+ end
210
+ end
211
+ end
212
+
213
+ def on(platform)
214
+ return if @on_invoked
215
+ invoke = false
216
+ if (linux_distro_tags || []).include?(platform)
217
+ invoke = true
218
+ else
219
+ case platform
220
+ when :linux
221
+ invoke = true if PlatformInfo.os_name =~ /linux/
222
+ when :freebsd
223
+ invoke = true if PlatformInfo.os_name =~ /freebsd/
224
+ when :macosx
225
+ invoke = true if PlatformInfo.os_name == "macosx"
226
+ when :solaris
227
+ invoke = true if PlatformInfo.os_name =~ /solaris/
228
+ when :other_platforms
229
+ invoke = true
230
+ end
231
+ end
232
+ if invoke
233
+ yield
234
+ @on_invoked = true
235
+ end
236
+ end
237
+
238
+ def apt_get_install(package_name)
239
+ install_instructions("Please install it with <b>apt-get install #{package_name}</b>")
240
+ end
241
+
242
+ def urpmi(package_name)
243
+ install_instructions("Please install it with <b>urpmi #{package_name}</b>")
244
+ end
245
+
246
+ def yum_install(package_name)
247
+ install_instructions("Please install it with <b>yum install #{package_name}</b>")
248
+ end
249
+
250
+ def emerge(package_name)
251
+ install_instructions("Please install it with <b>emerge -av #{package_name}</b>")
252
+ end
253
+
254
+ def gem_install(package_name)
255
+ install_instructions("Please make sure RubyGems is installed, then run " +
256
+ "<b>#{gem_command || 'gem'} install #{package_name}</b>")
257
+ end
258
+
259
+ def xcode_install(component)
260
+ install_instructions("Please install <b>Xcode</b>, then in Xcode go to " +
261
+ "<b>Preferences -> Downloads -> Components</b> and install <b>#{component}</b>")
262
+ end
263
+
264
+
265
+ def ruby_command
266
+ PlatformInfo.ruby_command
267
+ end
268
+
269
+ def gem_command
270
+ PlatformInfo.gem_command
271
+ end
272
+
273
+ def find_command(command)
274
+ PlatformInfo.find_command(command)
275
+ end
276
+
277
+ def linux_distro_tags
278
+ PlatformInfo.linux_distro_tags
279
+ end
280
+
281
+ def locate_ruby_tool(name)
282
+ PlatformInfo.locate_ruby_tool(name)
283
+ end
284
+ end # class Dependency
285
+
286
+ class ConsoleRunner
287
+ attr_reader :missing_dependencies
288
+
289
+ def initialize
290
+ @stdout = STDOUT
291
+ @dep_identifiers = []
292
+ end
293
+
294
+ def add(identifier)
295
+ @dep_identifiers << identifier
296
+ end
297
+
298
+ def check_all
299
+ old_log_impl = PlatformInfo.log_implementation
300
+ begin
301
+ PlatformInfo.log_implementation = lambda do |message|
302
+ message = PlatformInfo.send(:reindent, message, 10)
303
+ message.sub!(/^ /, '')
304
+ STDOUT.puts " -> #{message}"
305
+ end
306
+ @missing_dependencies = []
307
+ @dep_identifiers.each do |identifier|
308
+ dep = Depcheck.find(identifier)
309
+ raise "Cannot find depcheck spec #{identifier.inspect}" if !dep
310
+ puts_header "Checking for #{dep.name}..."
311
+ result = dep.check
312
+ result = { :found => false } if !result
313
+
314
+ if result[:found] && !result[:error]
315
+ puts_detail "Found: <green>yes</green>"
316
+ else
317
+ if result[:error]
318
+ puts_detail "Found: #{result[:found] ? "<yellow>yes, but there was an error</yellow>" : "<red>no</red>"}"
319
+ puts_detail "Error: <red>#{result[:error]}</red>"
320
+ else
321
+ puts_detail "Found: #{result[:found] ? "<green>yes</green>" : "<red>no</red>"}"
322
+ end
323
+ @missing_dependencies << dep
324
+ end
325
+
326
+ result.each_pair do |key, value|
327
+ if key.is_a?(String)
328
+ puts_detail "#{key}: #{value}"
329
+ end
330
+ end
331
+ end
332
+
333
+ return @missing_dependencies.empty?
334
+ ensure
335
+ PlatformInfo.log_implementation = old_log_impl
336
+ end
337
+ end
338
+
339
+ def print_installation_instructions_for_missing_dependencies
340
+ @missing_dependencies.each do |dep|
341
+ puts " * To install <yellow>#{dep.name}</yellow>:"
342
+ puts " #{dep.install_instructions}"
343
+ if dep.install_comments
344
+ puts " #{dep.install_comments}"
345
+ end
346
+ puts
347
+ end
348
+ end
349
+
350
+ private
351
+ def puts(text = nil)
352
+ if text
353
+ @stdout.puts(Utils::AnsiColors.ansi_colorize(text))
354
+ else
355
+ @stdout.puts
356
+ end
357
+ @stdout.flush
358
+ end
359
+
360
+ def puts_header(text)
361
+ puts " <b>* #{text}</b>"
362
+ end
363
+
364
+ def puts_detail(text)
365
+ puts " #{text}"
366
+ end
367
+ end
368
+ end # module Depcheck
369
+
370
+ end # module PlatformInfo
371
+ end # module PhusionPassenger
@@ -0,0 +1,124 @@
1
+ define 'apache2' do
2
+ name 'Apache 2'
3
+ website 'http://httpd.apache.org/'
4
+ define_checker do
5
+ require 'phusion_passenger/platform_info/apache'
6
+ if check_for_command(PlatformInfo.httpd)
7
+ {
8
+ :found => true,
9
+ "Location of httpd" => PlatformInfo.httpd,
10
+ "Apache version" => PlatformInfo.httpd_version
11
+ }
12
+ else
13
+ false
14
+ end
15
+ end
16
+
17
+ on :debian do
18
+ apt_get_install "apache2-mpm-worker"
19
+ end
20
+ on :mandriva do
21
+ urpmi "apache"
22
+ end
23
+ on :redhat do
24
+ yum_install "httpd"
25
+ end
26
+ on :gentoo do
27
+ emerge "apache"
28
+ end
29
+ end
30
+
31
+ define 'apache2-dev' do
32
+ name "Apache 2 development headers"
33
+ website "http://httpd.apache.org/"
34
+ define_checker do
35
+ require 'phusion_passenger/platform_info/apache'
36
+ if PlatformInfo.apxs2
37
+ {
38
+ :found => true,
39
+ "Location of apxs2" => PlatformInfo.apxs2
40
+ }
41
+ else
42
+ false
43
+ end
44
+ end
45
+
46
+ on :debian do
47
+ apt_get_install "apache2-worker-dev"
48
+ end
49
+ on :mandriva do
50
+ urpmi "apache-devel"
51
+ end
52
+ on :redhat do
53
+ yum_install "httpd-devel"
54
+ end
55
+ on :gentoo do
56
+ emerge "apache"
57
+ end
58
+ on :macosx do
59
+ xcode_install "Command Line Tools"
60
+ end
61
+ end
62
+
63
+ define 'apr-dev' do
64
+ name "Apache Portable Runtime (APR) development headers"
65
+ website "http://httpd.apache.org/"
66
+ define_checker do
67
+ require 'phusion_passenger/platform_info/apache'
68
+ if PlatformInfo.apr_config
69
+ {
70
+ :found => true,
71
+ "Location" => PlatformInfo.apr_config,
72
+ "Version" => `#{PlatformInfo.apr_config} --version`.strip
73
+ }
74
+ else
75
+ false
76
+ end
77
+ end
78
+
79
+ on :debian do
80
+ apt_get_install "libapr1-dev"
81
+ end
82
+ on :mandriva do
83
+ urpmi "libapr-devel"
84
+ end
85
+ on :redhat do
86
+ yum_install "apr-devel"
87
+ end
88
+ on :gentoo do
89
+ emerge "apr"
90
+ end
91
+ on :macosx do
92
+ xcode_install "Command Line Tools"
93
+ end
94
+ end
95
+
96
+ define 'apu-dev' do
97
+ name "Apache Portable Runtime Utility (APU) development headers"
98
+ website "http://httpd.apache.org/"
99
+ define_checker do
100
+ require 'phusion_passenger/platform_info/apache'
101
+ if PlatformInfo.apu_config
102
+ {
103
+ :found => true,
104
+ "Location" => PlatformInfo.apu_config,
105
+ "Version" => `#{PlatformInfo.apu_config} --version`.strip
106
+ }
107
+ else
108
+ false
109
+ end
110
+ end
111
+
112
+ on :debian do
113
+ apt_get_install "libaprutil1-dev"
114
+ end
115
+ on :mandriva do
116
+ urpmi "libapr-util-devel"
117
+ end
118
+ on :redhat do
119
+ yum_install "apr-util-devel"
120
+ end
121
+ on :macosx do
122
+ xcode_install "Command Line Tools"
123
+ end
124
+ end