passenger 4.0.30 → 4.0.31

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 (409) hide show
  1. data.tar.gz.asc +7 -7
  2. data/NEWS +31 -0
  3. data/bin/passenger +5 -5
  4. data/bin/passenger-config +6 -126
  5. data/bin/passenger-install-apache2-module +108 -26
  6. data/bin/passenger-install-nginx-module +81 -27
  7. data/bin/passenger-memory-stats +7 -6
  8. data/bin/passenger-status +13 -10
  9. data/build/agents.rb +8 -12
  10. data/build/apache2.rb +12 -7
  11. data/build/basics.rb +28 -20
  12. data/build/common_library.rb +4 -4
  13. data/build/cplusplus_support.rb +4 -4
  14. data/build/cxx_tests.rb +5 -3
  15. data/build/debian.rb +1 -2
  16. data/build/integration_tests.rb +25 -9
  17. data/build/misc.rb +2 -2
  18. data/build/oxt_tests.rb +5 -6
  19. data/build/packaging.rb +72 -40
  20. data/build/ruby_tests.rb +5 -1
  21. data/build/test_basics.rb +1 -2
  22. data/debian.template/locations.ini.template +1 -0
  23. data/debian.template/rules.template +2 -1
  24. data/dev/install_scripts_bootstrap_code.rb +42 -0
  25. data/dev/run_travis.sh +1 -0
  26. data/dev/runner +27 -0
  27. data/doc/Packaging.txt.md +5 -10
  28. data/doc/Users guide Apache.idmap.txt +3 -1
  29. data/doc/Users guide Apache.txt +5 -3
  30. data/doc/Users guide Nginx.idmap.txt +9 -5
  31. data/doc/Users guide Nginx.txt +47 -17
  32. data/doc/users_guide_snippets/environment_variables.txt +2 -2
  33. data/doc/users_guide_snippets/installation.txt +6 -2
  34. data/doc/users_guide_snippets/tips.txt +4 -0
  35. data/ext/apache2/Hooks.cpp +16 -3
  36. data/ext/common/Account.h +6 -5
  37. data/ext/common/AgentsStarter.h +1 -1
  38. data/ext/common/ApplicationPool2/Common.h +72 -0
  39. data/ext/common/ApplicationPool2/Group.h +263 -148
  40. data/ext/common/ApplicationPool2/Implementation.cpp +66 -44
  41. data/ext/common/ApplicationPool2/Options.h +1 -7
  42. data/ext/common/ApplicationPool2/Pool.h +96 -72
  43. data/ext/common/ApplicationPool2/Process.h +12 -17
  44. data/ext/common/ApplicationPool2/Socket.h +4 -4
  45. data/ext/common/ApplicationPool2/SuperGroup.h +20 -17
  46. data/ext/common/Constants.h +15 -1
  47. data/ext/common/MessageServer.h +22 -0
  48. data/ext/common/Utils.cpp +4 -1
  49. data/ext/common/Utils.h +3 -1
  50. data/ext/common/Utils/StrIntUtils.h +1 -0
  51. data/ext/common/Utils/Timer.h +15 -1
  52. data/ext/common/Utils/utf8/checked.h +0 -0
  53. data/ext/common/Utils/utf8/core.h +0 -0
  54. data/ext/common/Utils/utf8/unchecked.h +0 -0
  55. data/ext/common/agents/Base.cpp +59 -35
  56. data/ext/common/agents/HelperAgent/Main.cpp +23 -12
  57. data/ext/common/agents/HelperAgent/RequestHandler.h +10 -1
  58. data/ext/common/agents/LoggingAgent/FilterSupport.h +9 -5
  59. data/ext/common/agents/TempDirToucher.c +12 -3
  60. data/ext/common/agents/Watchdog/Main.cpp +8 -2
  61. data/ext/nginx/ConfigurationCommands.c +10 -0
  62. data/ext/nginx/ConfigurationFields.h +2 -0
  63. data/ext/nginx/ContentHandler.c +32 -19
  64. data/ext/nginx/CreateLocationConfig.c +5 -0
  65. data/ext/nginx/MergeLocationConfig.c +6 -0
  66. data/ext/nginx/config +13 -6
  67. data/ext/ruby/passenger_native_support.c +61 -2
  68. data/helper-scripts/classic-rails-loader.rb +9 -10
  69. data/helper-scripts/classic-rails-preloader.rb +10 -11
  70. data/helper-scripts/node-loader.js +3 -2
  71. data/helper-scripts/rack-loader.rb +8 -9
  72. data/helper-scripts/rack-preloader.rb +9 -10
  73. data/lib/phusion_passenger.rb +36 -7
  74. data/lib/phusion_passenger/abstract_installer.rb +16 -15
  75. data/lib/phusion_passenger/active_support3_extensions/init.rb +1 -1
  76. data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
  77. data/lib/phusion_passenger/admin_tools/server_instance.rb +5 -5
  78. data/lib/phusion_passenger/analytics_logger.rb +3 -3
  79. data/lib/phusion_passenger/classic_rails/thread_handler_extension.rb +1 -1
  80. data/lib/phusion_passenger/config.rb +125 -0
  81. data/lib/phusion_passenger/config/about_command.rb +183 -0
  82. data/lib/phusion_passenger/config/command.rb +57 -0
  83. data/lib/phusion_passenger/config/restart_app_command.rb +146 -0
  84. data/lib/phusion_passenger/config/utils.rb +108 -0
  85. data/lib/phusion_passenger/console_text_template.rb +2 -1
  86. data/lib/phusion_passenger/constants.rb +7 -2
  87. data/lib/phusion_passenger/loader_shared_helpers.rb +12 -21
  88. data/lib/phusion_passenger/message_client.rb +15 -4
  89. data/lib/phusion_passenger/native_support.rb +116 -98
  90. data/lib/phusion_passenger/nginx/config_options.rb +5 -0
  91. data/lib/phusion_passenger/platform_info.rb +1 -1
  92. data/lib/phusion_passenger/platform_info/apache.rb +9 -5
  93. data/lib/phusion_passenger/platform_info/apache_detector.rb +5 -6
  94. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +3 -3
  95. data/lib/phusion_passenger/platform_info/compiler.rb +29 -11
  96. data/lib/phusion_passenger/platform_info/curl.rb +1 -1
  97. data/lib/phusion_passenger/platform_info/cxx_portability.rb +30 -16
  98. data/lib/phusion_passenger/platform_info/depcheck.rb +6 -6
  99. data/lib/phusion_passenger/platform_info/linux.rb +2 -2
  100. data/lib/phusion_passenger/platform_info/operating_system.rb +25 -5
  101. data/lib/phusion_passenger/platform_info/ruby.rb +7 -4
  102. data/lib/phusion_passenger/platform_info/zlib.rb +1 -1
  103. data/lib/phusion_passenger/plugin.rb +0 -1
  104. data/lib/phusion_passenger/preloader_shared_helpers.rb +1 -1
  105. data/lib/phusion_passenger/public_api.rb +1 -1
  106. data/lib/phusion_passenger/rack/thread_handler_extension.rb +1 -1
  107. data/lib/phusion_passenger/request_handler.rb +8 -9
  108. data/lib/phusion_passenger/request_handler/thread_handler.rb +21 -9
  109. data/lib/phusion_passenger/ruby_core_enhancements.rb +1 -1
  110. data/lib/phusion_passenger/standalone/app_finder.rb +2 -2
  111. data/lib/phusion_passenger/standalone/command.rb +10 -8
  112. data/lib/phusion_passenger/standalone/help_command.rb +1 -1
  113. data/lib/phusion_passenger/standalone/main.rb +3 -3
  114. data/lib/phusion_passenger/standalone/package_runtime_command.rb +2 -2
  115. data/lib/phusion_passenger/standalone/runtime_installer.rb +55 -13
  116. data/lib/phusion_passenger/standalone/runtime_locator.rb +3 -3
  117. data/lib/phusion_passenger/standalone/start_command.rb +6 -7
  118. data/lib/phusion_passenger/standalone/status_command.rb +1 -1
  119. data/lib/phusion_passenger/standalone/stop_command.rb +1 -1
  120. data/lib/phusion_passenger/standalone/utils.rb +1 -1
  121. data/lib/phusion_passenger/standalone/version_command.rb +2 -3
  122. data/lib/phusion_passenger/utils.rb +1 -1
  123. data/lib/phusion_passenger/utils/download.rb +1 -2
  124. data/lib/phusion_passenger/utils/file_system_watcher.rb +1 -1
  125. data/lib/phusion_passenger/utils/hosts_file_parser.rb +1 -1
  126. data/lib/phusion_passenger/utils/tee_input.rb +1 -1
  127. data/lib/phusion_passenger/utils/terminal_choice_menu.rb +217 -0
  128. data/lib/phusion_passenger/utils/unseekable_socket.rb +1 -1
  129. data/resources/templates/apache2/config_snippets.txt.erb +2 -3
  130. data/resources/templates/apache2/deployment_example.txt.erb +2 -2
  131. data/resources/templates/apache2/notify_apache_module_installed.txt.erb +3 -0
  132. data/resources/templates/nginx/config_snippets.txt.erb +1 -1
  133. data/resources/templates/nginx/deployment_example.txt.erb +2 -2
  134. data/resources/templates/nginx/nginx_module_sources_not_available.txt.erb +11 -5
  135. data/rpm/Vagrantfile +1 -0
  136. data/test/cxx/ApplicationPool2/PoolTest.cpp +224 -35
  137. data/test/cxx/ApplicationPool2/ProcessTest.cpp +6 -6
  138. data/test/cxx/MessagePassingTest.cpp +1 -1
  139. data/test/cxx/RequestHandlerTest.cpp +26 -26
  140. data/test/integration_tests/apache2_tests.rb +162 -243
  141. data/test/integration_tests/native_packaging_spec.rb +10 -10
  142. data/test/integration_tests/nginx_tests.rb +87 -107
  143. data/test/integration_tests/shared/example_webapp_tests.rb +246 -0
  144. data/test/integration_tests/source_packaging_test.rb +2 -1
  145. data/test/integration_tests/standalone_tests.rb +34 -19
  146. data/test/ruby/admin_tools_spec.rb +4 -4
  147. data/test/ruby/analytics_logger_spec.rb +1 -1
  148. data/test/ruby/debug_logging_spec.rb +2 -2
  149. data/test/ruby/message_channel_spec.rb +1 -1
  150. data/test/ruby/request_handler_spec.rb +171 -64
  151. data/test/ruby/shared/loader_sharedspec.rb +5 -5
  152. data/test/ruby/shared/rails/analytics_logging_extensions_sharedspec.rb +2 -2
  153. data/test/ruby/spec_helper.rb +4 -4
  154. data/test/ruby/standalone/runtime_installer_spec.rb +1 -1
  155. data/test/ruby/standalone/runtime_locator_spec.rb +1 -1
  156. data/test/ruby/utils/file_system_watcher_spec.rb +1 -1
  157. data/test/ruby/utils/hosts_file_parser.rb +1 -1
  158. data/test/ruby/utils/unseekable_socket_spec.rb +1 -1
  159. data/test/ruby/utils_spec.rb +4 -4
  160. data/test/stub/apache2/httpd.conf.erb +5 -0
  161. data/test/stub/index.html +1 -0
  162. data/test/stub/rack/config.ru +80 -33
  163. data/test/stub/{rails_apps/1.2/empty/app/models → rack/public}/.gitignore +0 -0
  164. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/Rakefile +0 -0
  165. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/application_controller.rb +0 -0
  166. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/recipes_controller.rb +0 -0
  167. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/uploads_controller.rb +0 -0
  168. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/controllers/welcome_controller.rb +0 -0
  169. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/app/helpers/application_helper.rb +0 -0
  170. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/recipes_helper.rb +0 -0
  171. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/test_helper.rb +0 -0
  172. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/uploads_helper.rb +0 -0
  173. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/helpers/welcome_helper.rb +0 -0
  174. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/layouts/default.rhtml +0 -0
  175. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/create.rhtml +0 -0
  176. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/index.rhtml +0 -0
  177. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/recipes/new.rhtml +0 -0
  178. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/index.rhtml +0 -0
  179. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/uploads/new.html.erb +0 -0
  180. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/cached.rhtml +0 -0
  181. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/app/views/welcome/index.rhtml +0 -0
  182. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/boot.rb +0 -0
  183. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/database.yml +0 -0
  184. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environment.rb +0 -0
  185. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/environments/development.rb +0 -0
  186. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/environments/production.rb +0 -0
  187. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/inflections.rb +0 -0
  188. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/config/initializers/mime_types.rb +0 -0
  189. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/config/routes.rb +0 -0
  190. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/log/useless.txt +0 -0
  191. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/.htaccess +0 -0
  192. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/404.html +0 -0
  193. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/422.html +0 -0
  194. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/500.html +0 -0
  195. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.cgi +0 -0
  196. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.fcgi +0 -0
  197. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/dispatch.rb +0 -0
  198. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/favicon.ico +0 -0
  199. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/angrywizard.gif +0 -0
  200. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/cookbook.gif +0 -0
  201. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/images/header.png +0 -0
  202. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/public/images/rails.png +0 -0
  203. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/public/robots.txt +0 -0
  204. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/uploads.html +0 -0
  205. data/test/stub/{rails_apps/1.2/empty/db → rails2.3-mycook/public/uploads}/.gitignore +0 -0
  206. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/public/welcome/cached.html +0 -0
  207. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/about +0 -0
  208. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/console +0 -0
  209. data/test/stub/{rails_apps/2.2/empty → rails2.3-mycook}/script/dbconsole +0 -0
  210. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/destroy +0 -0
  211. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/generate +0 -0
  212. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/benchmarker +0 -0
  213. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/performance/profiler +0 -0
  214. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/performance/request +0 -0
  215. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/plugin +0 -0
  216. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/inspector +0 -0
  217. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/reaper +0 -0
  218. data/test/stub/{rails_apps/1.2/empty → rails2.3-mycook}/script/process/spawner +0 -0
  219. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/runner +0 -0
  220. data/test/stub/{rails_apps/2.0/empty → rails2.3-mycook}/script/server +0 -0
  221. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/uploads.html +0 -0
  222. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/sites/some.site/public/welcome/cached.html +0 -0
  223. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/cache/useless.txt +0 -0
  224. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/pids/useless.txt +0 -0
  225. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sessions/useless.txt +0 -0
  226. data/test/stub/{rails_apps/2.3/mycook → rails2.3-mycook}/tmp/sockets/useless.txt +0 -0
  227. data/test/stub/rails2.3/app/controllers/foo_controller.rb +1 -1
  228. data/test/stub/rails2.3/config/routes.rb +1 -2
  229. data/test/stub/wsgi/passenger_wsgi.py +47 -8
  230. data/test/stub/{rails_apps/1.2/empty/public/stylesheets → wsgi/public}/.gitignore +0 -0
  231. data/test/support/apache2_controller.rb +2 -2
  232. data/test/support/nginx_controller.rb +11 -5
  233. data/test/support/placebo-preloader.rb +2 -2
  234. data/test/support/test_helper.rb +26 -7
  235. metadata +78 -240
  236. metadata.gz.asc +7 -7
  237. data/debian.template/repack.sh +0 -42
  238. data/debian.template/watch +0 -3
  239. data/test/integration_tests/cgi_environment_spec.rb +0 -36
  240. data/test/integration_tests/hello_world_rack_spec.rb +0 -43
  241. data/test/integration_tests/hello_world_wsgi_spec.rb +0 -41
  242. data/test/integration_tests/mycook_spec.rb +0 -166
  243. data/test/stub/rack/public/rack.jpg +0 -0
  244. data/test/stub/rails_apps/1.2/empty/.gitignore +0 -3
  245. data/test/stub/rails_apps/1.2/empty/app/controllers/application.rb +0 -7
  246. data/test/stub/rails_apps/1.2/empty/config/boot.rb +0 -108
  247. data/test/stub/rails_apps/1.2/empty/config/database.yml +0 -31
  248. data/test/stub/rails_apps/1.2/empty/config/environment.rb +0 -66
  249. data/test/stub/rails_apps/1.2/empty/config/environments/development.rb +0 -21
  250. data/test/stub/rails_apps/1.2/empty/config/environments/production.rb +0 -18
  251. data/test/stub/rails_apps/1.2/empty/config/environments/staging.rb +0 -18
  252. data/test/stub/rails_apps/1.2/empty/config/environments/test.rb +0 -19
  253. data/test/stub/rails_apps/1.2/empty/config/routes.rb +0 -23
  254. data/test/stub/rails_apps/1.2/empty/doc/README_FOR_APP +0 -2
  255. data/test/stub/rails_apps/1.2/empty/public/.htaccess +0 -40
  256. data/test/stub/rails_apps/1.2/empty/public/500.html +0 -30
  257. data/test/stub/rails_apps/1.2/empty/public/dispatch.cgi +0 -10
  258. data/test/stub/rails_apps/1.2/empty/public/dispatch.fcgi +0 -24
  259. data/test/stub/rails_apps/1.2/empty/public/dispatch.rb +0 -10
  260. data/test/stub/rails_apps/1.2/empty/public/robots.txt +0 -1
  261. data/test/stub/rails_apps/1.2/empty/script/about +0 -3
  262. data/test/stub/rails_apps/1.2/empty/script/breakpointer +0 -3
  263. data/test/stub/rails_apps/1.2/empty/script/console +0 -3
  264. data/test/stub/rails_apps/1.2/empty/script/destroy +0 -3
  265. data/test/stub/rails_apps/1.2/empty/script/generate +0 -3
  266. data/test/stub/rails_apps/1.2/empty/script/plugin +0 -3
  267. data/test/stub/rails_apps/1.2/empty/script/runner +0 -3
  268. data/test/stub/rails_apps/1.2/empty/script/server +0 -3
  269. data/test/stub/rails_apps/1.2/empty/test/test_helper.rb +0 -28
  270. data/test/stub/rails_apps/2.0/empty/.gitignore +0 -3
  271. data/test/stub/rails_apps/2.0/empty/Rakefile +0 -10
  272. data/test/stub/rails_apps/2.0/empty/app/controllers/application.rb +0 -10
  273. data/test/stub/rails_apps/2.0/empty/app/helpers/application_helper.rb +0 -3
  274. data/test/stub/rails_apps/2.0/empty/app/models/.gitignore +0 -0
  275. data/test/stub/rails_apps/2.0/empty/config/boot.rb +0 -108
  276. data/test/stub/rails_apps/2.0/empty/config/database.yml +0 -31
  277. data/test/stub/rails_apps/2.0/empty/config/environment.rb +0 -59
  278. data/test/stub/rails_apps/2.0/empty/config/environments/production.rb +0 -18
  279. data/test/stub/rails_apps/2.0/empty/config/environments/staging.rb +0 -18
  280. data/test/stub/rails_apps/2.0/empty/config/environments/test.rb +0 -22
  281. data/test/stub/rails_apps/2.0/empty/config/routes.rb +0 -35
  282. data/test/stub/rails_apps/2.0/empty/db/.gitignore +0 -0
  283. data/test/stub/rails_apps/2.0/empty/doc/README_FOR_APP +0 -2
  284. data/test/stub/rails_apps/2.0/empty/public/.htaccess +0 -40
  285. data/test/stub/rails_apps/2.0/empty/public/404.html +0 -30
  286. data/test/stub/rails_apps/2.0/empty/public/dispatch.cgi +0 -10
  287. data/test/stub/rails_apps/2.0/empty/public/dispatch.fcgi +0 -24
  288. data/test/stub/rails_apps/2.0/empty/public/dispatch.rb +0 -10
  289. data/test/stub/rails_apps/2.0/empty/public/favicon.ico +0 -0
  290. data/test/stub/rails_apps/2.0/empty/public/images/rails.png +0 -0
  291. data/test/stub/rails_apps/2.0/empty/public/stylesheets/.gitignore +0 -0
  292. data/test/stub/rails_apps/2.0/empty/script/performance/benchmarker +0 -3
  293. data/test/stub/rails_apps/2.0/empty/script/performance/profiler +0 -3
  294. data/test/stub/rails_apps/2.0/empty/script/process/inspector +0 -3
  295. data/test/stub/rails_apps/2.0/empty/script/process/reaper +0 -3
  296. data/test/stub/rails_apps/2.0/empty/script/process/spawner +0 -3
  297. data/test/stub/rails_apps/2.0/empty/test/test_helper.rb +0 -38
  298. data/test/stub/rails_apps/2.2/empty/.gitignore +0 -3
  299. data/test/stub/rails_apps/2.2/empty/Rakefile +0 -10
  300. data/test/stub/rails_apps/2.2/empty/app/controllers/application.rb +0 -15
  301. data/test/stub/rails_apps/2.2/empty/app/helpers/application_helper.rb +0 -3
  302. data/test/stub/rails_apps/2.2/empty/app/models/.gitignore +0 -0
  303. data/test/stub/rails_apps/2.2/empty/config/boot.rb +0 -109
  304. data/test/stub/rails_apps/2.2/empty/config/database.yml +0 -31
  305. data/test/stub/rails_apps/2.2/empty/config/environment.rb +0 -75
  306. data/test/stub/rails_apps/2.2/empty/config/environments/development.rb +0 -17
  307. data/test/stub/rails_apps/2.2/empty/config/environments/production.rb +0 -24
  308. data/test/stub/rails_apps/2.2/empty/config/environments/staging.rb +0 -24
  309. data/test/stub/rails_apps/2.2/empty/config/environments/test.rb +0 -22
  310. data/test/stub/rails_apps/2.2/empty/config/initializers/inflections.rb +0 -10
  311. data/test/stub/rails_apps/2.2/empty/config/initializers/mime_types.rb +0 -5
  312. data/test/stub/rails_apps/2.2/empty/config/initializers/new_rails_defaults.rb +0 -17
  313. data/test/stub/rails_apps/2.2/empty/config/locales/en.yml +0 -5
  314. data/test/stub/rails_apps/2.2/empty/config/routes.rb +0 -43
  315. data/test/stub/rails_apps/2.2/empty/db/.gitignore +0 -0
  316. data/test/stub/rails_apps/2.2/empty/doc/README_FOR_APP +0 -5
  317. data/test/stub/rails_apps/2.2/empty/public/404.html +0 -30
  318. data/test/stub/rails_apps/2.2/empty/public/422.html +0 -30
  319. data/test/stub/rails_apps/2.2/empty/public/500.html +0 -33
  320. data/test/stub/rails_apps/2.2/empty/public/dispatch.cgi +0 -10
  321. data/test/stub/rails_apps/2.2/empty/public/dispatch.fcgi +0 -24
  322. data/test/stub/rails_apps/2.2/empty/public/dispatch.rb +0 -10
  323. data/test/stub/rails_apps/2.2/empty/public/favicon.ico +0 -0
  324. data/test/stub/rails_apps/2.2/empty/public/images/rails.png +0 -0
  325. data/test/stub/rails_apps/2.2/empty/public/robots.txt +0 -5
  326. data/test/stub/rails_apps/2.2/empty/public/stylesheets/.gitignore +0 -0
  327. data/test/stub/rails_apps/2.2/empty/script/about +0 -4
  328. data/test/stub/rails_apps/2.2/empty/script/console +0 -3
  329. data/test/stub/rails_apps/2.2/empty/script/destroy +0 -3
  330. data/test/stub/rails_apps/2.2/empty/script/generate +0 -3
  331. data/test/stub/rails_apps/2.2/empty/script/performance/benchmarker +0 -3
  332. data/test/stub/rails_apps/2.2/empty/script/performance/profiler +0 -3
  333. data/test/stub/rails_apps/2.2/empty/script/performance/request +0 -3
  334. data/test/stub/rails_apps/2.2/empty/script/plugin +0 -3
  335. data/test/stub/rails_apps/2.2/empty/script/process/inspector +0 -3
  336. data/test/stub/rails_apps/2.2/empty/script/process/reaper +0 -3
  337. data/test/stub/rails_apps/2.2/empty/script/process/spawner +0 -3
  338. data/test/stub/rails_apps/2.2/empty/script/runner +0 -3
  339. data/test/stub/rails_apps/2.2/empty/script/server +0 -3
  340. data/test/stub/rails_apps/2.2/empty/test/performance/browsing_test.rb +0 -9
  341. data/test/stub/rails_apps/2.2/empty/test/test_helper.rb +0 -38
  342. data/test/stub/rails_apps/2.3/empty/.gitignore +0 -3
  343. data/test/stub/rails_apps/2.3/empty/Rakefile +0 -10
  344. data/test/stub/rails_apps/2.3/empty/app/controllers/application_controller.rb +0 -10
  345. data/test/stub/rails_apps/2.3/empty/app/helpers/application_helper.rb +0 -3
  346. data/test/stub/rails_apps/2.3/empty/app/models/.gitignore +0 -0
  347. data/test/stub/rails_apps/2.3/empty/config/boot.rb +0 -110
  348. data/test/stub/rails_apps/2.3/empty/config/database.yml +0 -31
  349. data/test/stub/rails_apps/2.3/empty/config/environment.rb +0 -41
  350. data/test/stub/rails_apps/2.3/empty/config/environments/development.rb +0 -17
  351. data/test/stub/rails_apps/2.3/empty/config/environments/production.rb +0 -28
  352. data/test/stub/rails_apps/2.3/empty/config/environments/staging.rb +0 -28
  353. data/test/stub/rails_apps/2.3/empty/config/environments/test.rb +0 -28
  354. data/test/stub/rails_apps/2.3/empty/config/initializers/backtrace_silencers.rb +0 -7
  355. data/test/stub/rails_apps/2.3/empty/config/initializers/inflections.rb +0 -10
  356. data/test/stub/rails_apps/2.3/empty/config/initializers/mime_types.rb +0 -5
  357. data/test/stub/rails_apps/2.3/empty/config/initializers/new_rails_defaults.rb +0 -21
  358. data/test/stub/rails_apps/2.3/empty/config/initializers/session_store.rb +0 -15
  359. data/test/stub/rails_apps/2.3/empty/config/locales/en.yml +0 -5
  360. data/test/stub/rails_apps/2.3/empty/config/routes.rb +0 -43
  361. data/test/stub/rails_apps/2.3/empty/db/.gitignore +0 -0
  362. data/test/stub/rails_apps/2.3/empty/db/seeds.rb +0 -7
  363. data/test/stub/rails_apps/2.3/empty/doc/README_FOR_APP +0 -2
  364. data/test/stub/rails_apps/2.3/empty/public/404.html +0 -30
  365. data/test/stub/rails_apps/2.3/empty/public/422.html +0 -30
  366. data/test/stub/rails_apps/2.3/empty/public/500.html +0 -30
  367. data/test/stub/rails_apps/2.3/empty/public/favicon.ico +0 -0
  368. data/test/stub/rails_apps/2.3/empty/public/images/rails.png +0 -0
  369. data/test/stub/rails_apps/2.3/empty/public/robots.txt +0 -5
  370. data/test/stub/rails_apps/2.3/empty/public/stylesheets/.gitignore +0 -0
  371. data/test/stub/rails_apps/2.3/empty/script/about +0 -4
  372. data/test/stub/rails_apps/2.3/empty/script/console +0 -3
  373. data/test/stub/rails_apps/2.3/empty/script/dbconsole +0 -3
  374. data/test/stub/rails_apps/2.3/empty/script/destroy +0 -3
  375. data/test/stub/rails_apps/2.3/empty/script/generate +0 -3
  376. data/test/stub/rails_apps/2.3/empty/script/performance/benchmarker +0 -3
  377. data/test/stub/rails_apps/2.3/empty/script/performance/profiler +0 -3
  378. data/test/stub/rails_apps/2.3/empty/script/plugin +0 -3
  379. data/test/stub/rails_apps/2.3/empty/script/runner +0 -3
  380. data/test/stub/rails_apps/2.3/empty/script/server +0 -3
  381. data/test/stub/rails_apps/2.3/empty/test/performance/browsing_test.rb +0 -9
  382. data/test/stub/rails_apps/2.3/empty/test/test_helper.rb +0 -38
  383. data/test/stub/rails_apps/2.3/mycook/Rakefile +0 -10
  384. data/test/stub/rails_apps/2.3/mycook/app/helpers/application_helper.rb +0 -3
  385. data/test/stub/rails_apps/2.3/mycook/config/environments/development.rb +0 -18
  386. data/test/stub/rails_apps/2.3/mycook/config/initializers/inflections.rb +0 -10
  387. data/test/stub/rails_apps/2.3/mycook/config/initializers/mime_types.rb +0 -5
  388. data/test/stub/rails_apps/2.3/mycook/public/404.html +0 -30
  389. data/test/stub/rails_apps/2.3/mycook/public/422.html +0 -30
  390. data/test/stub/rails_apps/2.3/mycook/public/500.html +0 -30
  391. data/test/stub/rails_apps/2.3/mycook/public/favicon.ico +0 -0
  392. data/test/stub/rails_apps/2.3/mycook/public/images/rails.png +0 -0
  393. data/test/stub/rails_apps/2.3/mycook/public/robots.txt +0 -5
  394. data/test/stub/rails_apps/2.3/mycook/public/uploads/.gitignore +0 -0
  395. data/test/stub/rails_apps/2.3/mycook/script/about +0 -3
  396. data/test/stub/rails_apps/2.3/mycook/script/console +0 -3
  397. data/test/stub/rails_apps/2.3/mycook/script/dbconsole +0 -3
  398. data/test/stub/rails_apps/2.3/mycook/script/destroy +0 -3
  399. data/test/stub/rails_apps/2.3/mycook/script/generate +0 -3
  400. data/test/stub/rails_apps/2.3/mycook/script/performance/benchmarker +0 -3
  401. data/test/stub/rails_apps/2.3/mycook/script/performance/profiler +0 -3
  402. data/test/stub/rails_apps/2.3/mycook/script/performance/request +0 -3
  403. data/test/stub/rails_apps/2.3/mycook/script/plugin +0 -3
  404. data/test/stub/rails_apps/2.3/mycook/script/process/inspector +0 -3
  405. data/test/stub/rails_apps/2.3/mycook/script/process/reaper +0 -3
  406. data/test/stub/rails_apps/2.3/mycook/script/process/spawner +0 -3
  407. data/test/stub/rails_apps/2.3/mycook/script/runner +0 -3
  408. data/test/stub/rails_apps/2.3/mycook/script/server +0 -3
  409. data/test/stub/wsgi/public/wsgi-snake.jpg +0 -0
@@ -22,16 +22,17 @@
22
22
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  # THE SOFTWARE.
24
24
 
25
- ## Magic comment: set locations.ini ##
26
-
25
+ ## Magic comment: begin bootstrap ##
27
26
  source_root = File.expand_path("..", File.dirname(__FILE__))
28
27
  $LOAD_PATH.unshift("#{source_root}/lib")
28
+ require 'rubygems' rescue nil
29
29
  require 'phusion_passenger'
30
- PhusionPassenger.locate_directories
30
+ ## Magic comment: end bootstrap ##
31
31
 
32
- require 'phusion_passenger/platform_info'
33
- require 'phusion_passenger/platform_info/ruby'
34
- require 'phusion_passenger/admin_tools/memory_stats'
32
+ PhusionPassenger.locate_directories
33
+ PhusionPassenger.require_passenger_lib 'platform_info'
34
+ PhusionPassenger.require_passenger_lib 'platform_info/ruby'
35
+ PhusionPassenger.require_passenger_lib 'admin_tools/memory_stats'
35
36
 
36
37
  include PhusionPassenger
37
38
 
@@ -22,16 +22,17 @@
22
22
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  # THE SOFTWARE.
24
24
 
25
- ## Magic comment: set locations.ini ##
26
-
25
+ ## Magic comment: begin bootstrap ##
27
26
  source_root = File.expand_path("..", File.dirname(__FILE__))
28
27
  $LOAD_PATH.unshift("#{source_root}/lib")
28
+ require 'rubygems' rescue nil
29
29
  require 'phusion_passenger'
30
- PhusionPassenger.locate_directories
30
+ ## Magic comment: end bootstrap ##
31
31
 
32
- require 'phusion_passenger/platform_info'
33
- require 'phusion_passenger/admin_tools/server_instance'
34
- require 'phusion_passenger/utils/ansi_colors'
32
+ PhusionPassenger.locate_directories
33
+ PhusionPassenger.require_passenger_lib 'platform_info'
34
+ PhusionPassenger.require_passenger_lib 'admin_tools/server_instance'
35
+ PhusionPassenger.require_passenger_lib 'utils/ansi_colors'
35
36
  require 'optparse'
36
37
 
37
38
  include PhusionPassenger::AdminTools
@@ -80,9 +81,11 @@ def find_server_instance_on_pid(pid)
80
81
  end
81
82
 
82
83
  def show_status(server_instance, options)
83
- puts "Version : #{PhusionPassenger::VERSION_STRING}"
84
- puts "Date : #{Time.now}"
85
- puts "Instance: #{server_instance.pid}"
84
+ if options[:show] != 'xml'
85
+ puts "Version : #{PhusionPassenger::VERSION_STRING}"
86
+ puts "Date : #{Time.now}"
87
+ puts "Instance: #{server_instance.pid}"
88
+ end
86
89
  case options[:show]
87
90
  when 'pool'
88
91
  client = server_instance.connect(:role => :passenger_status)
@@ -151,7 +154,7 @@ def show_status(server_instance, options)
151
154
  puts response
152
155
  end
153
156
  rescue ServerInstance::RoleDeniedError
154
- require 'phusion_passenger/platform_info/ruby'
157
+ PhusionPassenger.require_passenger_lib 'platform_info/ruby'
155
158
  STDERR.puts "*** ERROR: You are not authorized to query the status for this Phusion " <<
156
159
  "Passenger instance. Please try again with '#{PhusionPassenger::PlatformInfo.ruby_sudo_command}'."
157
160
  exit 2
@@ -46,10 +46,9 @@ file AGENT_OUTPUT_DIR + 'PassengerWatchdog' => dependencies do
46
46
  "#{AGENT_OUTPUT_DIR}PassengerWatchdog.o " <<
47
47
  "#{watchdog_libs.link_objects_as_string} " <<
48
48
  "#{LIBBOOST_OXT} " <<
49
- "#{EXTRA_PRE_LDFLAGS} " <<
50
- "#{PlatformInfo.portability_ldflags} " <<
49
+ "#{EXTRA_PRE_CXX_LDFLAGS} " <<
50
+ "#{PlatformInfo.portability_cxx_ldflags} " <<
51
51
  "#{AGENT_LDFLAGS} " <<
52
- "#{EXTRA_LDFLAGS} " <<
53
52
  "#{EXTRA_CXX_LDFLAGS}")
54
53
  end
55
54
 
@@ -100,12 +99,11 @@ file AGENT_OUTPUT_DIR + 'PassengerHelperAgent' => dependencies do
100
99
  "#{AGENT_OUTPUT_DIR}PassengerHelperAgent.o",
101
100
  "#{helper_agent_libs.link_objects_as_string} " <<
102
101
  "#{LIBBOOST_OXT} " <<
103
- "#{EXTRA_PRE_LDFLAGS} " <<
102
+ "#{EXTRA_PRE_CXX_LDFLAGS} " <<
104
103
  "#{LIBEV_LIBS} " <<
105
104
  "#{LIBEIO_LIBS} " <<
106
- "#{PlatformInfo.portability_ldflags} " <<
105
+ "#{PlatformInfo.portability_cxx_ldflags} " <<
107
106
  "#{AGENT_LDFLAGS} " <<
108
- "#{EXTRA_LDFLAGS} " <<
109
107
  "#{EXTRA_CXX_LDFLAGS}")
110
108
  end
111
109
 
@@ -143,13 +141,12 @@ file AGENT_OUTPUT_DIR + 'PassengerLoggingAgent' => dependencies do
143
141
  "#{AGENT_OUTPUT_DIR}PassengerLoggingAgent.o",
144
142
  "#{logging_agent_libs.link_objects_as_string} " <<
145
143
  "#{LIBBOOST_OXT} " <<
146
- "#{EXTRA_PRE_LDFLAGS} " <<
144
+ "#{EXTRA_PRE_CXX_LDFLAGS} " <<
147
145
  "#{LIBEV_LIBS} " <<
148
146
  "#{PlatformInfo.curl_libs} " <<
149
147
  "#{PlatformInfo.zlib_libs} " <<
150
- "#{PlatformInfo.portability_ldflags} " <<
148
+ "#{PlatformInfo.portability_cxx_ldflags} " <<
151
149
  "#{AGENT_LDFLAGS} " <<
152
- "#{EXTRA_LDFLAGS} " <<
153
150
  "#{EXTRA_CXX_LDFLAGS}")
154
151
  end
155
152
 
@@ -163,13 +160,12 @@ file AGENT_OUTPUT_DIR + 'SpawnPreparer' => dependencies do
163
160
  sh "mkdir -p #{AGENT_OUTPUT_DIR}" if !File.directory?(AGENT_OUTPUT_DIR)
164
161
  create_executable(AGENT_OUTPUT_DIR + 'SpawnPreparer',
165
162
  'ext/common/agents/SpawnPreparer.cpp',
166
- "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_LDFLAGS} " <<
163
+ "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_CXX_LDFLAGS} " <<
167
164
  "-Iext -Iext/common " <<
168
165
  "#{AGENT_CFLAGS} #{EXTRA_CXXFLAGS} " <<
169
166
  "#{spawn_preparer_libs.link_objects_as_string} " <<
170
167
  "#{LIBBOOST_OXT} " <<
171
- "#{PlatformInfo.portability_ldflags} " <<
172
- "#{EXTRA_LDFLAGS} " <<
168
+ "#{PlatformInfo.portability_cxx_ldflags} " <<
173
169
  "#{EXTRA_CXX_LDFLAGS}")
174
170
  end
175
171
 
@@ -105,7 +105,11 @@ APACHE2_MODULE_INPUT_FILES.each_pair do |target, sources|
105
105
  file(target => sources + extra_deps) do
106
106
  object_basename = File.basename(target)
107
107
  object_filename = APACHE2_OUTPUT_DIR + object_basename
108
- compile_cxx(sources[0], "#{APACHE2_MODULE_CXXFLAGS} -o #{object_filename}")
108
+ compile_cxx(sources[0],
109
+ "#{EXTRA_PRE_CXXFLAGS} " <<
110
+ "#{APACHE2_MODULE_CXXFLAGS} " <<
111
+ "-o #{object_filename} " <<
112
+ "#{EXTRA_CXXFLAGS}")
109
113
  end
110
114
  end
111
115
 
@@ -124,21 +128,22 @@ file APACHE2_MODULE => dependencies do
124
128
 
125
129
  sources = (APACHE2_MODULE_OBJECTS + [APACHE2_MOD_PASSENGER_O]).join(' ')
126
130
  linkflags =
127
- "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_LDFLAGS} " <<
128
- "#{PlatformInfo.apache2_module_cflags} " <<
129
- "#{EXTRA_CXXFLAGS} " <<
131
+ "#{EXTRA_PRE_CXX_LDFLAGS} " <<
130
132
  "#{APACHE2_MODULE_COMMON_LIBRARIES.join(' ')} " <<
131
133
  "#{APACHE2_MODULE_BOOST_OXT_LIBRARY} " <<
132
134
  "#{PlatformInfo.apache2_module_ldflags} " <<
133
- "#{PlatformInfo.portability_ldflags} " <<
134
- "#{EXTRA_LDFLAGS} #{EXTRA_CXX_LDFLAGS} "
135
+ "#{PlatformInfo.portability_cxx_ldflags} " <<
136
+ "#{EXTRA_CXX_LDFLAGS} "
135
137
 
136
138
  create_shared_library(APACHE2_MODULE, sources, linkflags)
137
139
  end
138
140
 
139
141
  file APACHE2_MOD_PASSENGER_O => ['ext/apache2/mod_passenger.c'] do
140
142
  compile_c('ext/apache2/mod_passenger.c',
141
- "#{APACHE2_MODULE_CFLAGS} -o #{APACHE2_MOD_PASSENGER_O}")
143
+ "#{EXTRA_PRE_CFLAGS} " <<
144
+ "#{APACHE2_MODULE_CFLAGS} " <<
145
+ "-o #{APACHE2_MOD_PASSENGER_O} " <<
146
+ "#{EXTRA_CFLAGS}")
142
147
  end
143
148
 
144
149
  task :clean => 'apache2:clean'
@@ -29,16 +29,16 @@ require 'pathname'
29
29
  require 'fileutils'
30
30
  require 'phusion_passenger'
31
31
  PhusionPassenger.locate_directories
32
- require 'phusion_passenger/packaging'
33
- require 'phusion_passenger/platform_info'
34
- require 'phusion_passenger/platform_info/operating_system'
35
- require 'phusion_passenger/platform_info/binary_compatibility'
36
- require 'phusion_passenger/platform_info/ruby'
37
- require 'phusion_passenger/platform_info/apache'
38
- require 'phusion_passenger/platform_info/curl'
39
- require 'phusion_passenger/platform_info/zlib'
40
- require 'phusion_passenger/platform_info/compiler'
41
- require 'phusion_passenger/platform_info/cxx_portability'
32
+ PhusionPassenger.require_passenger_lib 'packaging'
33
+ PhusionPassenger.require_passenger_lib 'platform_info'
34
+ PhusionPassenger.require_passenger_lib 'platform_info/operating_system'
35
+ PhusionPassenger.require_passenger_lib 'platform_info/binary_compatibility'
36
+ PhusionPassenger.require_passenger_lib 'platform_info/ruby'
37
+ PhusionPassenger.require_passenger_lib 'platform_info/apache'
38
+ PhusionPassenger.require_passenger_lib 'platform_info/curl'
39
+ PhusionPassenger.require_passenger_lib 'platform_info/zlib'
40
+ PhusionPassenger.require_passenger_lib 'platform_info/compiler'
41
+ PhusionPassenger.require_passenger_lib 'platform_info/cxx_portability'
42
42
 
43
43
  include PhusionPassenger
44
44
  include PhusionPassenger::PlatformInfo
@@ -83,6 +83,10 @@ def string_option(name, default_value = nil)
83
83
  end
84
84
  end
85
85
 
86
+ def compiler_flag_option(name)
87
+ return string_option(name, '').gsub("\n", " ")
88
+ end
89
+
86
90
  def boolean_option(name, default_value = false)
87
91
  value = ENV[name]
88
92
  if value.nil? || value.empty?
@@ -157,25 +161,29 @@ AGENT_LDFLAGS.strip!
157
161
 
158
162
  # Extra compiler flags that should always be passed to the C/C++ compiler.
159
163
  # These should be included first in the command string, before anything else.
160
- EXTRA_PRE_CFLAGS = string_option('EXTRA_PRE_CFLAGS', '').gsub("\n", " ")
161
- EXTRA_PRE_CXXFLAGS = string_option('EXTRA_PRE_CXXFLAGS', '').gsub("\n", " ")
164
+ EXTRA_PRE_CFLAGS = compiler_flag_option('EXTRA_PRE_CFLAGS')
165
+ EXTRA_PRE_CXXFLAGS = compiler_flag_option('EXTRA_PRE_CXXFLAGS')
162
166
  # These should be included last in the command string.
163
167
  EXTRA_CFLAGS = PlatformInfo.default_extra_cflags.dup
164
- EXTRA_CFLAGS << " " << string_option('EXTRA_CFLAGS').gsub("\n", " ") if string_option('EXTRA_CFLAGS')
168
+ EXTRA_CFLAGS << " " << compiler_flag_option('EXTRA_CFLAGS') if !compiler_flag_option('EXTRA_CFLAGS').empty?
165
169
  EXTRA_CXXFLAGS = PlatformInfo.default_extra_cxxflags.dup
166
- EXTRA_CXXFLAGS << " " << string_option('EXTRA_CXXFLAGS').gsub("\n", " ") if string_option('EXTRA_CXXFLAGS')
170
+ EXTRA_CXXFLAGS << " " << compiler_flag_option('EXTRA_CXXFLAGS') if !compiler_flag_option('EXTRA_CXXFLAGS').empty?
167
171
  [EXTRA_CFLAGS, EXTRA_CXXFLAGS].each do |flags|
168
172
  flags << " -fno-omit-frame-pointers" if USE_ASAN
169
173
  flags << " -DPASSENGER_DISABLE_THREAD_LOCAL_STORAGE" if !boolean_option('PASSENGER_THREAD_LOCAL_STORAGE', true)
170
174
  end
171
175
 
172
176
  # Extra linker flags that should always be passed to the linker.
173
- # These should be included first in the command string, before anything else.
174
- EXTRA_PRE_LDFLAGS = string_option('EXTRA_PRE_LDFLAGS', '').gsub("\n", " ")
175
- # These should be included last in the command string, even after PlatformInfo.portability_ldflags.
176
- EXTRA_LDFLAGS = string_option('EXTRA_LDFLAGS', '').gsub("\n", " ")
177
- EXTRA_C_LDFLAGS = string_option('EXTRA_C_LDFLAGS', '').gsub("\n", " ")
178
- EXTRA_CXX_LDFLAGS = string_option('EXTRA_CXX_LDFLAGS', '').gsub("\n", " ")
177
+ # These should be included first in the command string.
178
+ EXTRA_PRE_C_LDFLAGS = compiler_flag_option('EXTRA_PRE_LDFLAGS') + " " +
179
+ compiler_flag_option('EXTRA_PRE_C_LDFLAGS')
180
+ EXTRA_PRE_CXX_LDFLAGS = compiler_flag_option('EXTRA_PRE_LDFLAGS') + " " +
181
+ compiler_flag_option('EXTRA_PRE_CXX_LDFLAGS')
182
+ # These should be included last in the command string, even after portability_*_ldflags.
183
+ EXTRA_C_LDFLAGS = compiler_flag_option('EXTRA_LDFLAGS') + " " +
184
+ compiler_flag_option('EXTRA_C_LDFLAGS')
185
+ EXTRA_CXX_LDFLAGS = compiler_flag_option('EXTRA_LDFLAGS') + " " +
186
+ compiler_flag_option('EXTRA_CXX_LDFLAGS')
179
187
 
180
188
 
181
189
  AGENT_OUTPUT_DIR = string_option('AGENT_OUTPUT_DIR', OUTPUT_DIR + "agents") + "/"
@@ -21,12 +21,12 @@
21
21
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
22
  # THE SOFTWARE.
23
23
 
24
- require 'phusion_passenger/platform_info/compiler'
25
- require 'phusion_passenger/platform_info/cxx_portability'
24
+ PhusionPassenger.require_passenger_lib 'platform_info/compiler'
25
+ PhusionPassenger.require_passenger_lib 'platform_info/cxx_portability'
26
26
 
27
27
  ########## Phusion Passenger common library ##########
28
28
 
29
- require 'phusion_passenger/common_library'
29
+ PhusionPassenger.require_passenger_lib 'common_library'
30
30
 
31
31
 
32
32
  ########## libboost_oxt ##########
@@ -219,7 +219,7 @@ end
219
219
 
220
220
  dependencies = ['ext/common/Constants.h.erb', 'lib/phusion_passenger.rb', 'lib/phusion_passenger/constants.rb']
221
221
  file 'ext/common/Constants.h' => dependencies do
222
- require 'phusion_passenger/constants'
222
+ PhusionPassenger.require_passenger_lib 'constants'
223
223
  template = TemplateRenderer.new('ext/common/Constants.h.erb')
224
224
  template.render_to('ext/common/Constants.h')
225
225
  end
@@ -24,7 +24,7 @@
24
24
  # Rake functions for compiling/linking C++ stuff.
25
25
 
26
26
  def run_compiler(*command)
27
- require 'phusion_passenger/utils/ansi_colors' if !defined?(PhusionPassenger::Utils::AnsiColors)
27
+ PhusionPassenger.require_passenger_lib 'utils/ansi_colors' if !defined?(PhusionPassenger::Utils::AnsiColors)
28
28
  show_command = command.join(' ')
29
29
  puts show_command
30
30
  if !system(*command)
@@ -73,15 +73,15 @@ def create_static_library(target, sources)
73
73
  sh "ranlib #{target}"
74
74
  end
75
75
 
76
- def create_executable(target, sources, linkflags = "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_LDFLAGS} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS} #{EXTRA_CXX_LDFLAGS}")
76
+ def create_executable(target, sources, linkflags = "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_C_LDFLAGS} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_cxx_ldflags} #{EXTRA_CXX_LDFLAGS}")
77
77
  run_compiler "#{CXX} #{sources} -o #{target} #{linkflags}"
78
78
  end
79
79
 
80
- def create_c_executable(target, sources, linkflags = "#{EXTRA_PRE_CFLAGS} #{EXTRA_PRE_LDFLAGS}#{EXTRA_CFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS} #{EXTRA_C_LDFLAGS}")
80
+ def create_c_executable(target, sources, linkflags = "#{EXTRA_PRE_CFLAGS} #{EXTRA_PRE_CXX_LDFLAGS}#{EXTRA_CFLAGS} #{PlatformInfo.portability_c_ldflags} #{EXTRA_C_LDFLAGS}")
81
81
  run_compiler "#{CC} #{sources} -o #{target} #{linkflags}"
82
82
  end
83
83
 
84
- def create_shared_library(target, sources, flags = "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_LDFLAGS} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS} #{EXTRA_CXX_LDFLAGS}")
84
+ def create_shared_library(target, sources, flags = "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_CXX_LDFLAGS} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_cxx_ldflags} #{EXTRA_CXX_LDFLAGS}")
85
85
  if PlatformInfo.os_name == "macosx"
86
86
  shlib_flag = "-flat_namespace -bundle -undefined dynamic_lookup"
87
87
  else
@@ -24,17 +24,19 @@
24
24
  ### C++ components tests ###
25
25
 
26
26
  TEST_CXX_CFLAGS = "-Iext -Iext/common " <<
27
+ "#{EXTRA_PRE_CXXFLAGS} " <<
27
28
  "#{LIBEV_CFLAGS} #{LIBEIO_CFLAGS} #{PlatformInfo.curl_flags} -Itest/cxx -Itest/support " <<
28
29
  "#{TEST_COMMON_CFLAGS}"
29
30
  TEST_CXX_CFLAGS << " #{PlatformInfo.adress_sanitizer_flag}" if USE_ASAN
30
- TEST_CXX_LDFLAGS = "#{TEST_COMMON_LIBRARY.link_objects_as_string} " <<
31
+ TEST_CXX_LDFLAGS = "#{EXTRA_PRE_CXX_LDFLAGS} " <<
32
+ "#{TEST_COMMON_LIBRARY.link_objects_as_string} " <<
31
33
  "#{TEST_BOOST_OXT_LIBRARY} #{LIBEV_LIBS} #{LIBEIO_LIBS} " <<
32
34
  "#{PlatformInfo.curl_libs} " <<
33
35
  "#{PlatformInfo.zlib_libs} " <<
34
- "#{PlatformInfo.portability_ldflags}"
36
+ "#{PlatformInfo.portability_cxx_ldflags}"
35
37
  TEST_CXX_LDFLAGS << " #{PlatformInfo.dmalloc_ldflags}" if USE_DMALLOC
36
38
  TEST_CXX_LDFLAGS << " #{PlatformInfo.adress_sanitizer_flag}" if USE_ASAN
37
- TEST_CXX_LDFLAGS << " #{EXTRA_LDFLAGS} #{EXTRA_CXX_LDFLAGS}"
39
+ TEST_CXX_LDFLAGS << " #{EXTRA_CXX_LDFLAGS}"
38
40
  TEST_CXX_LDFLAGS.strip!
39
41
  TEST_CXX_OBJECTS = {
40
42
  'test/cxx/CxxTestMain.o' => %w(
@@ -22,7 +22,7 @@
22
22
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
23
  # THE SOFTWARE.
24
24
 
25
- require 'phusion_passenger/constants'
25
+ PhusionPassenger.require_passenger_lib 'constants'
26
26
  require 'build/preprocessor'
27
27
 
28
28
  # If you change the default distribution list, don't forget to update the configuration
@@ -70,7 +70,6 @@ task 'debian:orig_tarball' => Packaging::PREGENERATED_FILES do
70
70
  "It will not be regenerated. If you are sure that the orig tarball is outdated, please delete it " +
71
71
  "and rerun this task."
72
72
  else
73
- require 'phusion_passenger/constants'
74
73
  sh "mkdir -p #{PKG_DIR}"
75
74
  nginx_version = PhusionPassenger::PREFERRED_NGINX_VERSION
76
75
  local_nginx_tarball = File.expand_path("#{PKG_DIR}/nginx-#{nginx_version}.tar.gz")
@@ -37,6 +37,10 @@ task 'test:integration:apache2' => dependencies do
37
37
  if boolean_option('SUDO')
38
38
  command = "#{PlatformInfo.ruby_sudo_command} -E #{command}"
39
39
  end
40
+ if grep = string_option('E')
41
+ require 'shellwords'
42
+ command << " -e #{Shellwords.escape(grep)}"
43
+ end
40
44
  sh "cd test && #{command}"
41
45
  end
42
46
  end
@@ -51,6 +55,10 @@ task 'test:integration:nginx' => dependencies do
51
55
  if boolean_option('SUDO')
52
56
  command = "#{PlatformInfo.ruby_sudo_command} -E #{command}"
53
57
  end
58
+ if grep = string_option('E')
59
+ require 'shellwords'
60
+ command << " -e #{Shellwords.escape(grep)}"
61
+ end
54
62
  sh "cd test && #{command}"
55
63
  end
56
64
  end
@@ -61,8 +69,13 @@ task 'test:integration:standalone' => dependencies do
61
69
  if PlatformInfo.rspec.nil?
62
70
  abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
63
71
  else
72
+ command = "#{PlatformInfo.rspec} -c -f s integration_tests/standalone_tests.rb"
73
+ if grep = string_option('E')
74
+ require 'shellwords'
75
+ command << " -e #{Shellwords.escape(grep)}"
76
+ end
64
77
  Dir.chdir("test") do
65
- #ruby "#{PlatformInfo.rspec} -c -f s integration_tests/standalone_tests.rb"
78
+ ruby command
66
79
  end
67
80
  end
68
81
  end
@@ -83,14 +96,17 @@ end
83
96
  dependencies = [:apache2, NATIVE_SUPPORT_TARGET].compact
84
97
  desc "Run the 'apache2' integration test infinitely, and abort if/when it fails"
85
98
  task 'test:restart' => dependencies do
86
- Dir.chdir("test") do
87
- color_code_start = "\e[33m\e[44m\e[1m"
88
- color_code_end = "\e[0m"
89
- i = 1
90
- while true do
91
- puts "#{color_code_start}Test run #{i} (press Ctrl-C multiple times to abort)#{color_code_end}"
92
- sh "spec -c -f s integration_tests/apache2.rb -e 'mod_passenger running in Apache 2 : MyCook(tm) beta running on root URI should support restarting via restart.txt'"
93
- i += 1
99
+ require 'shellwords'
100
+ color_code_start = "\e[33m\e[44m\e[1m"
101
+ color_code_end = "\e[0m"
102
+ i = 1
103
+ while true do
104
+ puts "#{color_code_start}Test run #{i} (press Ctrl-C multiple times to abort)#{color_code_end}"
105
+ command = "cd test && rspec -c -f s integration_tests/apache2_tests.rb"
106
+ if grep = string_option('E')
107
+ command << " -e #{Shellwords.escape(grep)}"
94
108
  end
109
+ sh(command)
110
+ i += 1
95
111
  end
96
112
  end
@@ -173,8 +173,8 @@ task :compile_app => dependencies do
173
173
  "#{LIBBOOST_OXT} " <<
174
174
  "#{LIBEV_LIBS} " <<
175
175
  "#{LIBEIO_LIBS} " <<
176
- "#{PlatformInfo.portability_ldflags} " <<
177
- "#{EXTRA_LDFLAGS}")
176
+ "#{PlatformInfo.portability_cxx_ldflags} " <<
177
+ "#{EXTRA_CXX_LDFLAGS}")
178
178
  ensure
179
179
  File.unlink('_source.cpp') rescue nil
180
180
  end
@@ -23,8 +23,8 @@
23
23
 
24
24
  ### OXT library tests ###
25
25
 
26
- TEST_OXT_CFLAGS = "-I../../ext -I../support #{TEST_COMMON_CFLAGS}"
27
- TEST_OXT_LDFLAGS = "#{TEST_BOOST_OXT_LIBRARY} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}"
26
+ TEST_OXT_CFLAGS = "#{EXTRA_PRE_CXXFLAGS} -Iext -Itest/support #{TEST_COMMON_CFLAGS}"
27
+ TEST_OXT_LDFLAGS = "#{TEST_BOOST_OXT_LIBRARY} #{PlatformInfo.portability_cxx_ldflags} #{EXTRA_CXX_LDFLAGS}"
28
28
  TEST_OXT_LDFLAGS << " #{PlatformInfo.adress_sanitizer_flag}" if USE_ASAN
29
29
  TEST_OXT_OBJECTS = {
30
30
  'oxt_test_main.o' => %w(oxt_test_main.cpp),
@@ -52,9 +52,8 @@ end
52
52
  # Define tasks for each OXT test source file.
53
53
  TEST_OXT_OBJECTS.each_pair do |target, sources|
54
54
  file "test/oxt/#{target}" => sources.map{ |x| "test/oxt/#{x}" } do
55
- Dir.chdir('test/oxt') do
56
- puts "### In test/oxt:"
57
- compile_cxx sources[0], TEST_OXT_CFLAGS
58
- end
55
+ source = "test/oxt/#{sources[0]}"
56
+ object = source.sub(/\.cpp$/, '.o')
57
+ compile_cxx source, "#{TEST_OXT_CFLAGS} -o #{object}"
59
58
  end
60
59
  end
@@ -80,8 +80,7 @@ end
80
80
 
81
81
  desc "Build, sign & upload gem & tarball"
82
82
  task 'package:release' => ['package:set_official', 'package:gem', 'package:tarball', 'package:sign'] do
83
- require 'phusion_passenger'
84
- require 'phusion_passenger/platform_info'
83
+ PhusionPassenger.require_passenger_lib 'platform_info'
85
84
  require 'yaml'
86
85
  require 'uri'
87
86
  require 'net/http'
@@ -150,9 +149,9 @@ task 'package:release' => ['package:set_official', 'package:gem', 'package:tarba
150
149
  homebrew_dir = "/tmp/homebrew"
151
150
  sh "rm -rf #{homebrew_dir}"
152
151
  sh "git clone git@github.com:phusion/homebrew.git #{homebrew_dir}"
153
- sh "cd #{homebrew_dir} && git remote add mxcl https://github.com/mxcl/homebrew.git"
154
- sh "cd #{homebrew_dir} && git fetch mxcl"
155
- sh "cd #{homebrew_dir} && git reset --hard mxcl/master"
152
+ sh "cd #{homebrew_dir} && git remote add Homebrew https://github.com/Homebrew/homebrew.git"
153
+ sh "cd #{homebrew_dir} && git fetch Homebrew"
154
+ sh "cd #{homebrew_dir} && git reset --hard Homebrew/master"
156
155
  formula = File.read("/tmp/homebrew/Library/Formula/passenger.rb")
157
156
  formula.gsub!(/passenger-.+?\.tar\.gz/, "passenger-#{version}.tar.gz") ||
158
157
  abort("Unable to substitute Homebrew formula tarball filename")
@@ -169,7 +168,7 @@ task 'package:release' => ['package:set_official', 'package:gem', 'package:tarba
169
168
  end
170
169
  sh "cd #{homebrew_dir} && git commit -a -m 'passenger #{version}'"
171
170
  sh "cd #{homebrew_dir} && git push -f"
172
- sh "cd #{homebrew_dir} && hub pull-request 'Update passenger to version #{version}' -b mxcl:master"
171
+ sh "cd #{homebrew_dir} && hub pull-request 'Update passenger to version #{version}' -b Homebrew:master"
173
172
 
174
173
  puts "Initiating building of Debian packages"
175
174
  Rake::Task['package:initiate_debian_building'].invoke
@@ -187,8 +186,17 @@ task 'package:release' => ['package:set_official', 'package:gem', 'package:tarba
187
186
 
188
187
  sh "scp #{PKG_DIR}/#{basename}.{gem,tar.gz,gem.asc,tar.gz.asc} app@shell.phusion.nl:#{dir}/"
189
188
  sh "ssh app@shell.phusion.nl 'mkdir -p \"#{dir}/assets/#{subdir}\" && mv #{dir}/#{basename}.{gem,tar.gz,gem.asc,tar.gz.asc} \"#{dir}/assets/#{subdir}/\"'"
190
- sh "curl -F file=@#{PKG_DIR}/#{basename}.gem --user admin:#{website_config['admin_password']} " +
189
+ command = "curl -F file=@#{PKG_DIR}/#{basename}.gem --user admin:#{website_config['admin_password']} " +
190
+ "--output /dev/stderr --write-out '%{http_code}' --silent " +
191
191
  "https://www.phusionpassenger.com/enterprise_gems/upload"
192
+ puts command
193
+ if `#{command}` != "200\n"
194
+ abort "Gem upload failed"
195
+ else
196
+ # The response body does not contain a newline,
197
+ # so fix terminal output.
198
+ puts
199
+ end
192
200
 
193
201
  puts "Initiating building of binaries"
194
202
  command = "cd /srv/passenger_autobuilder/app && " +
@@ -326,26 +334,49 @@ task :fakeroot => [:apache2, :nginx, :doc] do
326
334
  require 'rbconfig'
327
335
  require 'fileutils'
328
336
  include RbConfig
329
- fakeroot = "pkg/fakeroot"
330
-
337
+
338
+ fs_prefix = ENV['FS_PREFIX'] || "/usr"
339
+ fs_bindir = ENV['FS_BINDIR'] || "#{fs_prefix}/bin"
340
+ fs_sbindir = ENV['FS_SBINDIR'] || "#{fs_prefix}/sbin"
341
+ fs_datadir = ENV['FS_DATADIR'] || "#{fs_prefix}/share"
342
+ fs_docdir = ENV['FS_DOCDIR'] || "#{fs_datadir}/doc"
343
+ fs_libdir = ENV['FS_LIBDIR'] || "#{fs_prefix}/lib"
344
+
331
345
  # We don't use CONFIG['archdir'] and the like because we want
332
346
  # the files to be installed to /usr, and the Ruby interpreter
333
347
  # on the packaging machine might be in /usr/local.
334
- fake_rubylibdir = "#{fakeroot}/usr/lib/ruby/vendor_ruby"
335
- fake_nodelibdir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/node"
336
- fake_libdir = "#{fakeroot}/usr/lib/#{GLOBAL_NAMESPACE_DIRNAME}"
337
- fake_native_support_dir = "#{fakeroot}/usr/lib/ruby/#{CONFIG['ruby_version']}/#{CONFIG['arch']}"
338
- fake_agents_dir = "#{fakeroot}/usr/lib/#{GLOBAL_NAMESPACE_DIRNAME}/agents"
339
- fake_helper_scripts_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/helper-scripts"
340
- fake_resources_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}"
341
- fake_include_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/include"
342
- fake_docdir = "#{fakeroot}/usr/share/doc/#{GLOBAL_NAMESPACE_DIRNAME}"
343
- fake_bindir = "#{fakeroot}/usr/bin"
344
- fake_sbindir = "#{fakeroot}/usr/sbin"
345
- fake_apache2_module_dir = "#{fakeroot}/usr/lib/apache2/modules"
346
- fake_apache2_module = "#{fake_apache2_module_dir}/mod_passenger.so"
347
- fake_ruby_extension_source_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/ruby_extension_source"
348
- fake_nginx_module_source_dir = "#{fakeroot}/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/ngx_http_passenger_module"
348
+ psg_rubylibdir = ENV['RUBYLIBDIR'] || "#{fs_libdir}/ruby/vendor_ruby"
349
+ psg_nodelibdir = "#{fs_datadir}/#{GLOBAL_NAMESPACE_DIRNAME}/node"
350
+ psg_libdir = "#{fs_libdir}/#{GLOBAL_NAMESPACE_DIRNAME}"
351
+ psg_native_support_dir = ENV["RUBYARCHDIR"] || "#{fs_libdir}/ruby/#{CONFIG['ruby_version']}/#{CONFIG['arch']}"
352
+ psg_agents_dir = "#{fs_libdir}/#{GLOBAL_NAMESPACE_DIRNAME}/agents"
353
+ psg_helper_scripts_dir = "#{fs_datadir}/#{GLOBAL_NAMESPACE_DIRNAME}/helper-scripts"
354
+ psg_resources_dir = "#{fs_datadir}/#{GLOBAL_NAMESPACE_DIRNAME}"
355
+ psg_include_dir = "#{fs_datadir}/#{GLOBAL_NAMESPACE_DIRNAME}/include"
356
+ psg_docdir = "#{fs_docdir}/#{GLOBAL_NAMESPACE_DIRNAME}"
357
+ psg_bindir = "#{fs_bindir}"
358
+ psg_sbindir = "#{fs_sbindir}"
359
+ psg_apache2_module_path = ENV['APACHE2_MODULE_PATH'] || "#{fs_libdir}/apache2/modules/mod_passenger.so"
360
+ psg_ruby_extension_source_dir = "#{fs_datadir}/#{GLOBAL_NAMESPACE_DIRNAME}/ruby_extension_source"
361
+ psg_nginx_module_source_dir = "#{fs_datadir}/#{GLOBAL_NAMESPACE_DIRNAME}/ngx_http_passenger_module"
362
+
363
+ fakeroot = "pkg/fakeroot"
364
+ fake_rubylibdir = "#{fakeroot}#{psg_rubylibdir}"
365
+ fake_nodelibdir = "#{fakeroot}#{psg_nodelibdir}"
366
+ fake_libdir = "#{fakeroot}#{psg_libdir}"
367
+ fake_native_support_dir = "#{fakeroot}#{psg_native_support_dir}"
368
+ fake_agents_dir = "#{fakeroot}#{psg_agents_dir}"
369
+ fake_helper_scripts_dir = "#{fakeroot}#{psg_helper_scripts_dir}"
370
+ fake_resources_dir = "#{fakeroot}#{psg_resources_dir}"
371
+ fake_include_dir = "#{fakeroot}#{psg_include_dir}"
372
+ fake_docdir = "#{fakeroot}#{psg_docdir}"
373
+ fake_bindir = "#{fakeroot}#{psg_bindir}"
374
+ fake_sbindir = "#{fakeroot}#{psg_sbindir}"
375
+ fake_apache2_module_path = "#{fakeroot}#{psg_apache2_module_path}"
376
+ fake_ruby_extension_source_dir = "#{fakeroot}#{psg_ruby_extension_source_dir}"
377
+ fake_nginx_module_source_dir = "#{fakeroot}#{psg_nginx_module_source_dir}"
378
+
379
+ native_packaging_method = ENV['NATIVE_PACKAGING_METHOD'] || "deb"
349
380
 
350
381
  sh "rm -rf #{fakeroot}"
351
382
  sh "mkdir -p #{fakeroot}"
@@ -419,7 +450,7 @@ task :fakeroot => [:apache2, :nginx, :doc] do
419
450
  Packaging::USER_EXECUTABLES.each do |exe|
420
451
  sh "cp bin/#{exe} #{fake_bindir}/"
421
452
  if !Packaging::EXECUTABLES_WITH_FREE_RUBY.include?(exe)
422
- change_shebang("#{fake_bindir}/#{exe}", "/usr/bin/ruby")
453
+ change_shebang("#{fake_bindir}/#{exe}", "#{fs_bindir}/ruby")
423
454
  end
424
455
  end
425
456
 
@@ -428,13 +459,13 @@ task :fakeroot => [:apache2, :nginx, :doc] do
428
459
  Packaging::SUPER_USER_EXECUTABLES.each do |exe|
429
460
  sh "cp bin/#{exe} #{fake_sbindir}/"
430
461
  if !Packaging::EXECUTABLES_WITH_FREE_RUBY.include?(exe)
431
- change_shebang("#{fake_sbindir}/#{exe}", "/usr/bin/ruby")
462
+ change_shebang("#{fake_sbindir}/#{exe}", "#{fs_bindir}/ruby")
432
463
  end
433
464
  end
434
465
 
435
466
  # Apache 2 module
436
- sh "mkdir -p #{fake_apache2_module_dir}"
437
- sh "cp #{APACHE2_MODULE} #{fake_apache2_module_dir}/"
467
+ sh "mkdir -p #{File.dirname(fake_apache2_module_path)}"
468
+ sh "cp #{APACHE2_MODULE} #{fake_apache2_module_path}"
438
469
 
439
470
  # Ruby extension sources
440
471
  sh "mkdir -p #{fake_ruby_extension_source_dir}"
@@ -444,18 +475,19 @@ task :fakeroot => [:apache2, :nginx, :doc] do
444
475
  File.open("#{fake_rubylibdir}/phusion_passenger/locations.ini", "w") do |f|
445
476
  f.puts "[locations]"
446
477
  f.puts "natively_packaged=true"
447
- f.puts "bin_dir=/usr/bin"
448
- f.puts "agents_dir=/usr/lib/#{GLOBAL_NAMESPACE_DIRNAME}/agents"
449
- f.puts "lib_dir=/usr/lib/#{GLOBAL_NAMESPACE_DIRNAME}"
450
- f.puts "helper_scripts_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/helper-scripts"
451
- f.puts "resources_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}"
452
- f.puts "include_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/include"
453
- f.puts "doc_dir=/usr/share/doc/#{GLOBAL_NAMESPACE_DIRNAME}"
454
- f.puts "ruby_libdir=/usr/lib/ruby/vendor_ruby"
455
- f.puts "node_libdir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/node"
456
- f.puts "apache2_module_path=/usr/lib/apache2/modules/mod_passenger.so"
457
- f.puts "ruby_extension_source_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/ruby_extension_source"
458
- f.puts "nginx_module_source_dir=/usr/share/#{GLOBAL_NAMESPACE_DIRNAME}/ngx_http_passenger_module"
478
+ f.puts "native_packaging_method=#{native_packaging_method}"
479
+ f.puts "bin_dir=#{psg_bindir}"
480
+ f.puts "agents_dir=#{psg_agents_dir}"
481
+ f.puts "lib_dir=#{psg_libdir}"
482
+ f.puts "helper_scripts_dir=#{psg_helper_scripts_dir}"
483
+ f.puts "resources_dir=#{psg_resources_dir}"
484
+ f.puts "include_dir=#{psg_include_dir}"
485
+ f.puts "doc_dir=#{psg_docdir}"
486
+ f.puts "ruby_libdir=#{psg_rubylibdir}"
487
+ f.puts "node_libdir=#{psg_nodelibdir}"
488
+ f.puts "apache2_module_path=#{psg_apache2_module_path}"
489
+ f.puts "ruby_extension_source_dir=#{psg_ruby_extension_source_dir}"
490
+ f.puts "nginx_module_source_dir=#{psg_nginx_module_source_dir}"
459
491
  end
460
492
 
461
493
  # Sanity check the locations.ini file