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,91 +0,0 @@
1
- Summary: Phusion Passenger release RPM/Yum repository configuration
2
- Name: passenger-release
3
- Version: 3
4
- Release: 4%{?dist}
5
- License: MIT
6
- Group: Group: System Environment/Base
7
- URL: http://passenger.stealthymonkeys.com/
8
- Source0: mirrors-passenger
9
- Source1: RPM-GPG-KEY-stealthymonkeys
10
- BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
11
- BuildArch: noarch
12
-
13
- %description
14
- Phusion Passenger Yum/RPM configuration. This package contains the Yum
15
- repository configuration to install & update Phusion Passenger, as
16
- well as the GPG signing key to verify them.
17
-
18
- %prep
19
- #%setup -c
20
-
21
- %{?el5:name='Red Hat Enterprise' version='5' path='rhel'}
22
- %{?el6:name='Red Hat Enterprise' version='6' path='rhel'}
23
-
24
- %{?fc13:name='Fedora Core' version='13' path='fedora'}
25
- %{?fc14:name='Fedora Core' version='14' path='fedora'}
26
-
27
- if [ -z "$name" ] ; then
28
- echo "Please specify a distro to build for (f'rex: el5 or fc13)" >&2
29
- exit 255
30
- fi
31
-
32
- %{__cat} <<EOF > passenger.repo
33
- ### Name: Phusion Passenger RPM Repository for $name $version
34
- ### URL: %{url}
35
- [passenger]
36
- name = $name \$releasever - Phusion Passenger
37
- baseurl = %{url}$path/\$releasever/\$basearch
38
- mirrorlist = %{url}$path/mirrors
39
- #mirrorlist = file:///etc/yum.repos.d/mirrors-passenger
40
- enabled = 1
41
- gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-passenger
42
- gpgcheck = 1
43
-
44
- ### Name: Phusion Passenger RPM Repository for $name $version (TESTING)
45
- ### URL: %{url}
46
- [passenger-testing]
47
- name = $name \$releasever - Phusion Passenger - TEST
48
- baseurl = %{url}$path/\$releasever/\$basearch/testing/
49
- enabled = 0
50
- gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-passenger
51
- gpgcheck = 0
52
- EOF
53
-
54
- for mirror in $(%{__cat} %{SOURCE0}); do
55
- echo "$mirror/$path/\$releasever/\$ARCH/"
56
- done > mirrors-passenger
57
-
58
- %build
59
-
60
- %install
61
- rm -rf %{buildroot}
62
- %{__install} -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-passenger
63
- %{__install} -D -p -m 0644 passenger.repo %{buildroot}%{_sysconfdir}/yum.repos.d/passenger.repo
64
-
65
-
66
-
67
- %clean
68
- rm -rf %{buildroot}
69
-
70
-
71
- %files
72
- %defattr(-,root,root,-)
73
- %doc mirrors-passenger
74
- %{_sysconfdir}/pki/rpm-gpg/RPM-GPG-KEY-passenger
75
- %{_sysconfdir}/yum.repos.d/passenger.repo
76
-
77
-
78
-
79
- %changelog
80
- * Wed Nov 24 2010 Erik Ogan <erik@stealthymonkeys.com> - 3-4
81
- - Fix EL6 & FC14 version numbers.
82
- - Fix the errant /en in the mirrors file
83
-
84
- * Thu Oct 28 2010 Erik Ogan <erik@stealthymonkeys.com> - 3-3
85
- - Typo in the gpgkey directives
86
-
87
- * Thu Oct 28 2010 Erik Ogan <erik@stealthymonkeys.com> - 3-2
88
- - Update the mirrorlist URL
89
-
90
- * Tue Oct 26 2010 Erik Ogan <erik@stealthymonkeys.com> - 3-1
91
- - Initial build.
@@ -1,667 +0,0 @@
1
- # RPM Spec file for Phusion Passenger
2
- #
3
- # The latest version of this file (as well as supporting files,
4
- # documentation, and scripts to help build it) can be found here:
5
- #
6
- # http://github.com/erikogan/rubygem-passenger
7
- #
8
- # (If you fork this project feel free to add your repo below, but please
9
- # do not remove the URL above.)
10
-
11
- %define gemname passenger
12
- %if %{?passenger_version:0}%{?!passenger_version:1}
13
- %define passenger_version 3.0.2
14
- %endif
15
- %if %{?passenger_release:0}%{?!passenger_release:1}
16
- %define passenger_release 1%{?dist}
17
- %endif
18
- %define passenger_epoch 1
19
-
20
- %if %{?nginx_version:0}%{?!nginx_version:1}
21
- %define nginx_version 0.8.53
22
- %endif
23
- %define nginx_release %{passenger_version}_%{passenger_release}
24
- %define nginx_user passenger
25
- %define nginx_group %{nginx_user}
26
- %define nginx_home %{_localstatedir}/lib/nginx
27
- %define nginx_home_tmp %{nginx_home}/tmp
28
- %define nginx_logdir %{_localstatedir}/log/nginx
29
- %define nginx_confdir %{_sysconfdir}/nginx
30
- %define nginx_datadir %{_datadir}/nginx
31
- %define nginx_webroot %{nginx_datadir}/html
32
-
33
- %define httpd_confdir %{_sysconfdir}/httpd/conf.d
34
-
35
- # Macros on the command-line overrides these defaults. You should also
36
- # make sure these match the binaries found in your PATH
37
- %{?!ruby: %define ruby /usr/bin/ruby}
38
- %{?!rake: %define rake /usr/bin/rake}
39
- %{?!gem: %define gem /usr/bin/gem}
40
-
41
- # Debug packages are currently broken. So don't even build them
42
- %define debug_package %nil
43
-
44
- %define ruby_sitelib %(%{ruby} -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
45
-
46
- %define ruby_version_patch %(%{ruby} -e 'puts "#{RUBY_VERSION}#{defined?(RUBY_PATCHLEVEL) ? %q{.} + RUBY_PATCHLEVEL.to_s : nil}"')
47
-
48
- # Does Gem::Version crash&burn on the version defined above? (RHEL might)
49
- %define broken_gem_version %(%{ruby} -rrubygems -e 'begin ; Gem::Version.create "%{passenger_version}" ; rescue => e ; puts 1 ; exit ; end ; puts 0')
50
-
51
- %if %{broken_gem_version}
52
- # Strip any non-numeric version part
53
- %define gemversion %(echo '%{passenger_version}'|sed -e 's/\\.[^.]*[^.0-9]\\+[^.]*//g')
54
- %else
55
- %define gemversion %{passenger_version}
56
- %endif
57
-
58
- # Invoke a shell to do a comparison, silly but it works across versions of RPM
59
- %define gem_version_mismatch %([ '%{passenger_version}' != '%{gemversion}' ] && echo 1 || echo 0)
60
-
61
- %define gemdir %(%{ruby} -rubygems -e 'puts Gem::dir' 2>/dev/null)
62
- %define geminstdir %{gemdir}/gems/%{gemname}-%{gemversion}
63
-
64
- %define perldir %(perl -MConfig -e 'print $Config{installvendorarch}')
65
-
66
- # This will cause a chicken/egg problem where the dir isn't present yet
67
- #% define gemnativedir % (%{ruby} -I%{_builddir}/%{gemname}-%{passenger_version}/lib -rphusion_passenger/platform_info/binary_compatibility -e 'puts PhusionPassenger::PlatformInfo.ruby_extension_binary_compatibility_ids.join("-")')
68
- # %define native_libs_release %{passenger_release}_% (%{ruby} -I%{_builddir}/%{gemname}-%{passenger_version}/lib -rphusion_passenger/platform_info/binary_compatibility -e 'puts PhusionPassenger::PlatformInfo.ruby_extension_binary_compatibility_ids[0,2].join("_")')
69
- %define native_libs_release %{passenger_release}_%{ruby_version_patch}
70
-
71
- %{!?only_native_libs: %define only_native_libs 0}
72
-
73
- # Really wish they'd standardize this
74
- %define sharedir %{?fedora:%{_datarootdir}}%{?!fedora:%{_datadir}}
75
-
76
- Summary: Easy and robust Ruby web application deployment
77
- Name: rubygem-%{gemname}
78
- Version: %{passenger_version}
79
- Release: %{passenger_release}
80
- Group: System Environment/Daemons
81
- License: Modified BSD
82
- URL: http://www.modrails.com/
83
- Source0: %{gemname}-%{passenger_version}.tar.gz
84
- Source1: nginx-%{nginx_version}.tar.gz
85
- Source100: apache-passenger.conf.in
86
- Source101: nginx-passenger.conf.in
87
- Source200: rubygem-passenger.te
88
- # The most recent nginx RPM no longer includes this plugin. Remove it from the
89
- # SRPM
90
- # # Ignore everything after the ?, it's meant to trick rpmbuild into
91
- # # finding the correct file
92
- # Source300: http://github.com/gnosek/nginx-upstream-fair/tarball/master?/nginx-upstream-fair.tar.gz
93
- Patch0: passenger-force-native.patch
94
- BuildRoot: %{_tmppath}/%{name}-%{passenger_version}-%{passenger_release}-root-%(%{__id_u} -n)
95
- Requires: rubygems
96
- Requires: rubygem(rake) >= 0.8.1
97
- Requires: rubygem(fastthread) >= 1.0.1
98
- Requires: rubygem(daemon_controller) >= 0.2.5
99
- Requires: rubygem(file-tail)
100
- Requires: rubygem(rack)
101
- BuildRequires: ruby-devel
102
- BuildRequires: httpd-devel
103
- BuildRequires: rubygems
104
- BuildRequires: rubygem(rake) >= 0.8.1
105
- BuildRequires: rubygem(rack)
106
- BuildRequires: rubygem(fastthread) >= 1.0.1
107
- %if %{?fedora:1}%{?!fedora:0}
108
- BuildRequires: libcurl-devel
109
- BuildRequires: source-highlight
110
- %else
111
- BuildRequires: curl-devel
112
- %endif
113
- BuildRequires: doxygen
114
- BuildRequires: asciidoc
115
- BuildRequires: graphviz
116
- # standaline build deps
117
- %if %{?fedora:1}%{?!fedora:0}
118
- BuildRequires: libev-devel
119
- %endif
120
- BuildRequires: rubygem(daemon_controller) >= 0.2.5
121
- BuildRequires: rubygem(file-tail)
122
- # native build deps
123
- %if %{?fedora:1}%{?!fedora:0}
124
- BuildRequires: selinux-policy
125
- %else
126
- BuildRequires: selinux-policy-devel
127
- %endif
128
- # nginx build deps
129
- BuildRequires: pcre-devel
130
- BuildRequires: zlib-devel
131
- BuildRequires: openssl-devel
132
- %if %{?fedora:1}%{?!fedora:0}
133
- BuildRequires: perl-devel
134
- %else
135
- BuildRequires: perl
136
- %endif
137
- BuildRequires: perl(ExtUtils::Embed)
138
- BuildRequires: libxslt-devel
139
- BuildRequires: GeoIP-devel
140
- BuildRequires: gd-devel
141
- # Can't have a noarch package with an arch'd subpackage
142
- #BuildArch: noarch
143
- Provides: rubygem(%{gemname}) = %{passenger_version}
144
- Epoch: %{passenger_epoch}
145
-
146
- %description
147
- Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment
148
- of Ruby web applications, such as those built on the revolutionary
149
- Ruby on Rails web framework, a breeze. It follows the usual Ruby on
150
- Rails conventions, such as “Don’t-Repeat-Yourself”.
151
-
152
- %if %{gem_version_mismatch}
153
- **NOTE: Because the default Gem::Version doesn't accept the correct
154
- version, it is installed as %{gemversion} instead of %{passenger_version}.
155
- %endif
156
-
157
- %if !%{only_native_libs}
158
-
159
- %package native
160
- Summary: Phusion Passenger native extensions
161
- Group: System Environment/Daemons
162
- Requires: %{name} = %{passenger_epoch}:%{passenger_version}-%{passenger_release}
163
- %if %{?fedora:1}%{?!fedora:0}
164
- Requires: libev
165
- %endif
166
- Requires(post): policycoreutils, initscripts
167
- Requires(preun): policycoreutils, initscripts
168
- Requires(postun): policycoreutils
169
- Epoch: %{passenger_epoch}
170
- %description native
171
- Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment
172
- of Ruby web applications, such as those built on the revolutionary
173
- Ruby on Rails web framework, a breeze. It follows the usual Ruby on
174
- Rails conventions, such as “Don’t-Repeat-Yourself”.
175
-
176
- This package contains the native code extensions for Apache & Nginx bindings
177
-
178
- %endif #! only_native_libs
179
-
180
- %package native-libs
181
- Summary: Phusion Passenger native extensions
182
- Group: System Environment/Daemons
183
- Release: %{native_libs_release}
184
- Epoch: %{passenger_epoch}
185
- Requires: %{name}-native = %{passenger_epoch}:%{passenger_version}-%{passenger_release}
186
- Requires: ruby = %{ruby_version_patch}
187
- Provides: rubygem-passenger-native-libs = %{passenger_epoch}:%{passenger_version}-%{passenger_release}
188
- %description native-libs
189
- Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment
190
- of Ruby web applications, such as those built on the revolutionary
191
- Ruby on Rails web framework, a breeze. It follows the usual Ruby on
192
- Rails conventions, such as “Don’t-Repeat-Yourself”.
193
-
194
- This package contains the native shared library for Apache & Nginx
195
- bindings, built against ruby sources. It has been separated so that
196
- installing a new ruby interpreter only necessitates rebuilding this
197
- package.
198
-
199
- %if !%{only_native_libs}
200
-
201
- %package -n passenger-standalone
202
- Summary: Standalone Phusion Passenger Server
203
- Group: System Environment/Daemons
204
- Requires: %{name} = %{passenger_epoch}:%{passenger_version}-%{passenger_release}
205
- %if %{?fedora:1}%{?!fedora:0}
206
- Requires: libev
207
- %endif
208
- Epoch: %{passenger_epoch}
209
- Obsoletes: rubygem-passenger-standalone
210
- Provides: rubygem-passenger-standalone
211
- %description -n passenger-standalone
212
- Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment
213
- of Ruby web applications, such as those built on the revolutionary
214
- Ruby on Rails web framework, a breeze. It follows the usual Ruby on
215
- Rails conventions, such as “Don’t-Repeat-Yourself”.
216
-
217
- This package contains the standalone Passenger server
218
-
219
- %package -n mod_passenger
220
- Summary: Apache Module for Phusion Passenger
221
- Group: System Environment/Daemons
222
- Requires: %{name}-native = %{passenger_epoch}:%{passenger_version}-%{passenger_release}
223
- #BuildArch: %_target_arch
224
- Obsoletes: rubygem-passenger-apache
225
- Epoch: %{passenger_epoch}
226
- %description -n mod_passenger
227
- Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment
228
- of Ruby web applications, such as those built on the revolutionary
229
- Ruby on Rails web framework, a breeze. It follows the usual Ruby on
230
- Rails conventions, such as “Don’t-Repeat-Yourself”.
231
-
232
- This package contains the pluggable Apache server module for Passenger.
233
-
234
- %package -n nginx-passenger
235
- Summary: nginx server with Phusion Passenger enabled
236
- Group: System Environment/Daemons
237
- Requires: %{name} = %{passenger_epoch}:%{passenger_version}
238
- Version: %{nginx_version}
239
- Release: %{passenger_version}_%{passenger_release}
240
- Requires: %{name}-native-libs = %{passenger_epoch}:%{passenger_version}-%{passenger_release}
241
- Requires: pcre
242
- Requires: zlib
243
- Requires: openssl
244
- Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
245
- Requires: GeoIP
246
- Requires: gd
247
- Requires: nginx-alternatives
248
- Epoch: %{passenger_epoch}
249
- %description -n nginx-passenger
250
- Phusion Passenger™ — a.k.a. mod_rails or mod_rack — makes deployment
251
- of Ruby web applications, such as those built on the revolutionary
252
- Ruby on Rails web framework, a breeze. It follows the usual Ruby on
253
- Rails conventions, such as “Don’t-Repeat-Yourself”.
254
-
255
- This package includes an nginx server with Passenger compiled in.
256
-
257
- %endif # !only_native_libs
258
-
259
- %define perlfileckinner $SIG{__WARN__} = sub {die @_};
260
- %define perlfileck BEGIN { %perlfileckinner } ;
261
- %define perlfileescd %(echo '%{perlfileck}' | sed -e 's/[$@]/\\\\&/g')
262
-
263
- %prep
264
- %setup -q -n %{gemname}-%{passenger_version} -b 1
265
- # %setup -q -T -D -n nginx-%{nginx_version} -a 300
266
- # # Fix the CWD
267
- # %setup -q -T -D -n %{gemname}-%{passenger_version}
268
- %patch0 -p1
269
-
270
- # Rather than hard-coding the path into the patch, change it here so
271
- # that it's consistent with the %{ruby} macro, which might be defined on
272
- # the command-line (4 %'s = 2)
273
- perl -pi -e '%{perlfileck} s{%%%%GEM_INSTALL_DIR%%%%}{%{geminstdir}};s{%%%%APACHE_INSTALLED_MOD%%%%}{%{_libdir}/httpd/modules/mod_passenger.so}' lib/phusion_passenger.rb ext/common/ResourceLocator.h
274
-
275
- %if %{gem_version_mismatch}
276
- %{warn:
277
- ***
278
- *** WARNING: Your Gem::Version crashes on '%{passenger_version},'
279
- *** Falling back to use '%gemversion' internally
280
- ***
281
-
282
- }
283
- # Use sed rather than a patch, so it's more resilliant to version changes
284
- sed -i -e "s/\(^[ \t]VERSION_STRING *= *'[0-9]\+\.[0-9]\+\.[0-9]\+\)[^']\+/\1/" lib/phusion_passenger.rb
285
- sed -i -e 's/^\(#define PASSENGER_VERSION "[0-9]\+\.[0-9]\+\.[0-9]\+\)[^"]\+/\1/' ext/common/Constants.h
286
- %endif
287
-
288
- # Fix the preferred version
289
- perl -pi -e "s{(PREFERRED_NGINX_VERSION\s*=\s*(['\"]))[\d\.]+\2}{\${1}%{nginx_version}\$2}" lib/phusion_passenger.rb
290
-
291
- # RPM finds these in shebangs and assumes they're requirements. Clean them up here rather than in the install-dir.
292
- find test -type f -print0 | xargs -0 perl -pi -e '%{perlfileck} s{#!(/opt/ruby.*|/usr/bin/ruby1.8)}{%{ruby}}g'
293
-
294
-
295
- %build
296
- %if %{?fedora:1}%{?!fedora:0}
297
- export USE_VENDORED_LIBEV=false
298
- # This isn't honored
299
- # export CFLAGS='%optflags -I/usr/include/libev'
300
- export LIBEV_CFLAGS='-I/usr/include/libev'
301
- export LIBEV_LIBS='-lev'
302
- %endif
303
-
304
- %if %{only_native_libs}
305
- %{rake} native_support
306
- %else
307
- %{rake} package
308
- %{rake} apache2
309
-
310
- ### SELINUX
311
- rm -rf selinux
312
- mkdir selinux
313
- cd selinux
314
- cp %{SOURCE200} .
315
- echo '%{geminstdir}/agents/((apache2|nginx)/)?Passenger.* system_u:object_r:httpd_exec_t:s0' > rubygem-passenger.fc
316
- echo '%{_var}/log/passenger-analytics system_u:object_r:httpd_log_t:s0' >> rubygem-passenger.fc
317
- touch rubygem-passenger.if
318
- make -f %{sharedir}/selinux/devel/Makefile
319
- cd ..
320
-
321
- ### NGINX
322
- cd ../nginx-%{nginx_version}
323
-
324
- #export FAIRDIR=%{_builddir}/nginx-%{nginx_version}/gnosek-nginx-upstream-fair-*
325
- # I'm not sure why this fails on RHEL but not Fedora. I guess GCC 4.4 is
326
- # smarter about it than 4.1? It feels wrong to do this, but I don't see
327
- # an easier way out.
328
- %if %{?fedora:1}%{?!fedora:0}
329
- %define nginx_ccopt %{optflags}
330
- %else
331
- %define nginx_ccopt %(echo "%{optflags}" | sed -e 's/SOURCE=2/& -Wno-unused/')
332
- %endif
333
-
334
- ### Stolen [and hacked] from the nginx spec file
335
- export DESTDIR=%{buildroot}
336
- ./configure \
337
- --user=%{nginx_user} \
338
- --group=%{nginx_group} \
339
- --prefix=%{nginx_datadir} \
340
- --sbin-path=%{_sbindir}/nginx.passenger \
341
- --conf-path=%{nginx_confdir}/nginx.conf \
342
- --error-log-path=%{nginx_logdir}/error.log \
343
- --http-log-path=%{nginx_logdir}/access.log \
344
- --http-client-body-temp-path=%{nginx_home_tmp}/client_body \
345
- --http-proxy-temp-path=%{nginx_home_tmp}/proxy \
346
- --http-fastcgi-temp-path=%{nginx_home_tmp}/fastcgi \
347
- --http-uwsgi-temp-path=%{nginx_home_tmp}/uwsgi \
348
- --http-scgi-temp-path=%{nginx_home_tmp}/scgi \
349
- --pid-path=%{_localstatedir}/run/nginx.pid \
350
- --lock-path=%{_localstatedir}/lock/subsys/nginx \
351
- --with-http_ssl_module \
352
- --with-http_realip_module \
353
- --with-http_addition_module \
354
- --with-http_xslt_module \
355
- --with-http_image_filter_module \
356
- --with-http_geoip_module \
357
- --with-http_sub_module \
358
- --with-http_dav_module \
359
- --with-http_flv_module \
360
- --with-http_gzip_static_module \
361
- --with-http_random_index_module \
362
- --with-http_secure_link_module \
363
- --with-http_degradation_module \
364
- --with-http_stub_status_module \
365
- --with-http_perl_module \
366
- --with-mail \
367
- --with-file-aio \
368
- --with-mail_ssl_module \
369
- --with-ipv6 \
370
- --with-cc-opt="%{nginx_ccopt} $(pcre-config --cflags)" \
371
- --with-ld-opt="-Wl,-E" # so the perl module finds its symbols
372
-
373
- # THIS is ugly (yet now greatly simplified). It corrects the
374
- # check-buildroot error on the string saved for 'nginx -V'
375
- #
376
- # In any case, fix it correctly later
377
- perl -pi -e '%{perlfileck} s<%{buildroot}><>g;s<%{_builddir}><%%{_builddir}>g;' objs/ngx_auto_config.h
378
-
379
- # Also do it for passenger-standalone (and I thought the above was ugly)
380
- perl -pi.nohack -0777 -e 's!(^\s*run_command_with_throbber.*"Preparing Nginx...".*\n(\s*))(yield.*?\n)!${2}\@\@hack_success = false\n$1yield_result = $3${2}abort "nginx-hack failed" unless \@\@hack_success || system(*(%w{perl -pi -e} + ["%{perlfileescd} s<%{buildroot}><>g;s<%{_builddir}><%%{_builddir}>g;", "objs/ngx_auto_config.h"]))\n${2}\# Why is this running many times?\n${2}\@\@hack_success = true\n${2}yield_result\n!im' %{_builddir}/passenger-%{passenger_version}/lib/phusion_passenger/standalone/runtime_installer.rb
381
-
382
- make %{?_smp_mflags}
383
-
384
- cd -
385
- %endif # !only_native_libs
386
-
387
- %install
388
- %if %{?fedora:1}%{?!fedora:0}
389
- export USE_VENDORED_LIBEV=false
390
- # This isn't honored
391
- # export CFLAGS='%optflags -I/usr/include/libev'
392
- export LIBEV_CFLAGS='-I/usr/include/libev'
393
- export LIBEV_LIBS='-lev'
394
- %endif
395
-
396
- rm -rf %{buildroot}
397
- mkdir -p %{buildroot}%{gemdir}
398
-
399
- %if !%{only_native_libs}
400
- %{gem} install --local --install-dir %{buildroot}%{gemdir} \
401
- --force --rdoc pkg/%{gemname}-%{gemversion}.gem
402
- mkdir -p %{buildroot}/%{_bindir}
403
- mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir}
404
- rmdir %{buildroot}%{gemdir}/bin
405
- # Nothing there
406
- # find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x
407
-
408
- mkdir -p %{buildroot}/%{_libdir}/httpd/modules
409
- install -m 0644 ext/apache2/mod_passenger.so %{buildroot}/%{_libdir}/httpd/modules
410
-
411
- mkdir -p %{buildroot}/%{nginx_datadir}
412
- mkdir -p %{buildroot}/%{nginx_datadir}
413
- mkdir -p %{buildroot}/%{nginx_confdir}
414
- mkdir -p %{buildroot}/%{nginx_logdir}
415
- mkdir -p %{buildroot}/%{httpd_confdir}
416
- mkdir -p %{buildroot}/%{_var}/log/passenger-analytics
417
-
418
- # I should probably figure out how to get these into the gem
419
- cp -ra agents %{buildroot}/%{geminstdir}
420
-
421
- # PASSENGER STANDALONE (this is going to recompile nginx)
422
- %{ruby} ./bin/passenger package-runtime --nginx-version %{nginx_version} --nginx-tarball %{SOURCE1} %{buildroot}/%{_var}/lib/passenger-standalone
423
- # Now unpack the tarballs it just created
424
- # It's 2am, revisit this insanity in the light of morning
425
- standalone_dir=$(bash -c 'ls -d $1 | tail -1' -- %{buildroot}/%{_var}/lib/passenger-standalone/%{passenger_version}-*)
426
- native_dir=%{buildroot}/%{_var}/lib/passenger-standalone/natively-packaged
427
-
428
- mkdir -p $standalone_dir/support
429
- mkdir -p $standalone_dir/nginx-%{nginx_version}
430
- tar -zx -C $standalone_dir/nginx-%{nginx_version} -f $standalone_dir/nginx-%{nginx_version}.tar.gz
431
- tar -zx -C $standalone_dir/support -f $standalone_dir/support.tar.gz
432
-
433
- # Hong Li says the binaries are relocatable, so we don't have to jump
434
- # through hoops to change directories. Just move it.
435
- mv $standalone_dir $native_dir
436
- mv $native_dir/support/ext/ruby/*-linux $native_dir/support/ext/ruby/native
437
-
438
- # Unhack
439
- mv lib/phusion_passenger/standalone/runtime_installer.rb.nohack lib/phusion_passenger/standalone/runtime_installer.rb
440
- install -m 0644 lib/phusion_passenger/standalone/runtime_installer.rb $native_dir/support/lib/phusion_passenger/standalone/runtime_installer.rb
441
-
442
- # SELINUX
443
- install -p -m 644 -D selinux/%{name}.pp %{buildroot}%{sharedir}/selinux/packages/%{name}/%{name}.pp
444
-
445
- # NGINX
446
- cd ../nginx-%{nginx_version}
447
- make install DESTDIR=%{buildroot} INSTALLDIRS=vendor
448
- cd -
449
-
450
- %endif #!only_native_libs
451
-
452
- ##### NATIVE LIBS INSTALL
453
- mkdir -p %{buildroot}/%{geminstdir}/ext/ruby/native
454
- cp -ra ext/ruby/*-linux/* %{buildroot}/%{geminstdir}/ext/ruby/native
455
-
456
- %if !%{only_native_libs}
457
- #### Clean up everything we don't care about
458
- rm -rf %{buildroot}/usr/share/nginx %{buildroot}/%{nginx_confdir}
459
- # # Assume the old version is good enough. Probably not wise.
460
- # rm -rf %{buildroot}%{perldir} %{buildroot}%{_mandir}/man3/nginx.3pm*
461
- rm -f %{buildroot}%{perldir}/{auto/nginx/.packlist,perllocal.pod}
462
- # RHEL distinguishes these dirs
463
- rm -f %{buildroot}%(perl -MConfig -e 'print $Config{installarchlib}')/perllocal.pod
464
- mv %{buildroot}%{perldir}/auto/nginx/nginx{,_passenger}.bs
465
- mv %{buildroot}%{perldir}/auto/nginx/nginx{,_passenger}.so
466
- mv %{buildroot}%{perldir}/nginx{,_passenger}.pm
467
- mv %{buildroot}%{_mandir}/man3/nginx.3pm{,_passenger}
468
-
469
- install -p -d -m 0755 %{buildroot}/%{nginx_confdir}/conf.d
470
- #install -m 0644 %{SOURCE100} %{buildroot}/%{httpd_confdir}/passenger.conf
471
- #install -m 0644 %{SOURCE101} %{buildroot}/%{nginx_confdir}/conf.d/passenger.conf
472
- perl -pe 's{%%ROOT}{%geminstdir}g;s{%%RUBY}{%ruby}g' %{SOURCE100} > %{buildroot}/%{httpd_confdir}/passenger.conf
473
- perl -pe 's{%%ROOT}{%geminstdir}g;s{%%RUBY}{%ruby}g' %{SOURCE101} > %{buildroot}/%{nginx_confdir}/conf.d/passenger.conf
474
-
475
- # CLEANUP
476
- rm -f $native_dir/support/ext/ruby/native/mkmf.log
477
- # Reversed logic from most other tests
478
- %if %{?fedora:0}%{?!fedora:1}
479
- rm -f $native_dir/support/ext/libev/config.log
480
- %endif
481
-
482
- # REMOVE THIS TO FORCE 'native-packaged' (it's still in doc)
483
- rm %{buildroot}/%{geminstdir}/DEVELOPERS.TXT
484
-
485
- # This is still needed
486
- %if %{?fedora:1}%{?!fedora:0}
487
- %define libevmunge %nil
488
- %else
489
- %define libevmunge $native_dir/support/ext/libev/config.status $native_dir/support/ext/libev/Makefile
490
- %endif
491
-
492
- perl -pi -e '%perlfileck s{%buildroot}{}g;s<%{_builddir}><%%{_builddir}>g' \
493
- $native_dir/support/ext/ruby/native/Makefile %{libevmunge}
494
-
495
- %define base_files base-package-files
496
-
497
- ### BUILD FILE LIST (To remove files from the base package that will be installed by subpackages)
498
- cat <<EOF > %{base_files}
499
- %defattr(-, root, root, -)
500
- %doc %{gemdir}/doc/%{gemname}-%{gemversion}
501
- %doc README
502
- %doc DEVELOPERS.TXT
503
- %{_bindir}/passenger-install-apache2-module
504
- %{_bindir}/passenger-install-nginx-module
505
- %{_bindir}/passenger-config
506
- %{_bindir}/passenger-status
507
- %{_bindir}/passenger-memory-stats
508
- %{_bindir}/passenger-make-enterprisey
509
- %{gemdir}/cache/%{gemname}-%{gemversion}.gem
510
- %{gemdir}/specifications/%{gemname}-%{gemversion}.gemspec
511
- EOF
512
-
513
- # This feels wrong (reordering arch & os) but if it helps....
514
- # ...Going one step further and also stripping all the installed *.o files
515
- # Move the file find here to catch the byte-compiled Python files
516
- %define __spec_install_post \
517
- %{?__debug_package:%{__debug_install_post}} \
518
- %{__os_install_post} \
519
- find $native_dir -name \*.o -o -name \*.so | xargs strip ; \
520
- find %{buildroot}/%{geminstdir} \\( -type d \\( -name native -o -name agents \\) \\) -prune -o \\( -type f -print \\) | perl -pe 's{^%{buildroot}}{};s{^//}{/};s/([?|*'\\''\"])/\\\\$1/g;s{(^|\\n$)}{\"$&}g' >> %{base_files} \
521
- %{__arch_install_post}
522
-
523
- %post -n nginx-passenger
524
- if [ $1 == 1 ]; then
525
- /usr/sbin/alternatives --install /usr/sbin/nginx nginx \
526
- /usr/sbin/nginx.passenger 50 \
527
- --slave %{perldir}/auto/nginx/nginx.so nginx.so \
528
- %{perldir}/auto/nginx/nginx_passenger.so \
529
- --slave %{perldir}/auto/nginx/nginx.bs nginx.bs \
530
- %{perldir}/auto/nginx/nginx_passenger.bs \
531
- --slave %{perldir}/nginx.pm nginx.pm %{perldir}/nginx_passenger.pm \
532
- --slave %{_mandir}/man3/nginx.3pm.gz nginx.man \
533
- %{_mandir}/man3/nginx_passenger.3pm.gz
534
- fi
535
-
536
- %postun -n nginx-passenger
537
- if [ $1 == 0 ]; then
538
- /usr/sbin/alternatives --remove nginx /usr/sbin/nginx.passenger
539
- fi
540
-
541
- %post native
542
- if [ "$1" -le "1" ] ; then # First install
543
- semodule -i %{sharedir}/selinux/packages/%{name}/%{name}.pp 2>/dev/null || :
544
- fixfiles -R %{name} restore
545
- fixfiles -R %{name}-native restore
546
- fi
547
-
548
- %preun native
549
- if [ "$1" -lt "1" ] ; then # Final removal
550
- semodule -r rubygem_%{gemname} 2>/dev/null || :
551
- fixfiles -R %{name} restore
552
- fixfiles -R %{name}-native restore
553
- fi
554
-
555
- %postun native
556
- if [ "$1" -ge "1" ] ; then # Upgrade
557
- semodule -i %{sharedir}/selinux/packages/%{name}/%{name}.pp 2>/dev/null || :
558
- fi
559
- %endif # !only_native_libs
560
-
561
- %clean
562
- rm -rf %{buildroot}
563
-
564
- %if !%{only_native_libs}
565
- %files -f %{base_files}
566
-
567
- %files native
568
- %{geminstdir}/agents
569
- %{sharedir}/selinux/packages/%{name}/%{name}.pp
570
- %{_var}/log/passenger-analytics
571
-
572
- %files -n passenger-standalone
573
- %doc doc/Users\ guide\ Standalone.html
574
- %doc doc/Users\ guide\ Standalone.txt
575
- %{_bindir}/passenger
576
- %{_var}/lib/passenger-standalone/natively-packaged/
577
-
578
- %files -n mod_passenger
579
- %doc doc/Users\ guide\ Apache.html
580
- %doc doc/Users\ guide\ Apache.txt
581
- %{_libdir}/httpd/modules/mod_passenger.so
582
- %config %{httpd_confdir}/passenger.conf
583
-
584
- %files -n nginx-passenger
585
- %doc doc/Users\ guide\ Nginx.html
586
- %doc doc/Users\ guide\ Nginx.txt
587
- %config %{nginx_confdir}/conf.d/passenger.conf
588
- /usr/sbin/nginx.passenger
589
- %{perldir}/auto/nginx/nginx*
590
- %{perldir}/nginx*
591
- %{_mandir}/man3/nginx*
592
- %endif # !only_native_libs
593
-
594
- %files native-libs
595
- # %{geminstdir}/ext/ruby/%{gemnativedir}
596
- %{geminstdir}/ext/ruby/native
597
-
598
-
599
- %changelog
600
- * Thu Dec 16 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.2-1
601
- - Bump to 3.0.2
602
-
603
- * Mon Dec 13 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.1-4
604
- - rename rubygem-passenger-standalone to passenger-standalone
605
- - Add graphviz to the build requirements (for /usr/bin/dot)
606
-
607
- * Thu Dec 2 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.1-3
608
- - Stop double-packaging files from -native & -native-libs in the base package
609
-
610
- * Tue Nov 30 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.1-2
611
- - Remove (most of) the kludges to remove %%{builddir} from installed files.
612
- - Blessed natively-packaged patch from Hong Li
613
- - Migration to the more static directory structure
614
-
615
- * Mon Nov 29 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.1-1
616
- - Integration into passenger source
617
- - Bump to 3.0.1
618
-
619
- * Mon Nov 15 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-11
620
- - Fix passenger-standalone
621
-
622
- * Fri Nov 12 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-10
623
- - Bump nginx to version 0.8.53 and build it by hand based on the newer
624
- nginx specfile
625
-
626
- * Sun Nov 7 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-9
627
- - Add passenger-analytics directory, so the server doesn't try to create
628
- it. (SELinux violation)
629
-
630
- * Sun Oct 31 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-8
631
- - Fix embedded Perl module
632
-
633
- * Fri Oct 29 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-7
634
- - Add back all the missing directives from nginx.spec (Perl is
635
- untested and may be broken)
636
-
637
- * Fri Oct 29 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-6
638
- - Add upstream-fair load-balancer back to nginx
639
- - Add the original CFLAGS back to nginx (with -Wno-unused kludge for RHEL5)
640
-
641
- * Sat Oct 23 2010 Erik Ogan <erik@cloudshield.com> - 3.0.0-5
642
- - RHEL/CentOS Ruby is too old to support RUBY_PATCHLEVEL
643
-
644
- * Sat Oct 23 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-4
645
- - --define 'only_native_libs 1' to rebuild native_support.so for a
646
- different ruby engine.
647
- - make sure native-libs release includes passenger release and ruby patch level
648
- - remove the macros that rely on %%{_builddir} already being unpacked
649
-
650
- * Fri Oct 22 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-3
651
- - Break the passenger_native_support.so into its own package
652
-
653
- * Thu Oct 21 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-2
654
- - rename rubygem-passenger-apache => mod_passenger
655
-
656
- * Thu Oct 21 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0-1
657
- - Version bump to 3.0.0
658
-
659
- * Wed Oct 18 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0.pre4-2
660
- - use nginx-alternatives
661
-
662
- * Sun Oct 17 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0.pre4-1
663
- - Nginx suport
664
-
665
- * Mon Oct 11 2010 Erik Ogan <erik@stealthymonkeys.com> - 3.0.0.pre4-0
666
- - Test for Gem::Version issues with the version and work around it.
667
- - Initial Spec File