]>
Commit | Line | Data |
---|---|---|
b9dbf00f | 1 | # |
06811060 | 2 | # Conditional build: |
b9dbf00f | 3 | %bcond_with tests # test target |
06811060 | 4 | |
a6dd913b | 5 | Summary: A module to bridge Ruby on Rails to Apache |
b9dbf00f | 6 | Summary(pl.UTF-8): Moduł służący za bramkę Ruby on Rails do Apache'a |
c9e1f73a | 7 | Name: passenger |
cf635985 AM |
8 | Version: 6.0.20 |
9 | Release: 0.1 | |
cf570175 ER |
10 | # Passenger code uses MIT license. |
11 | # Bundled(Boost) uses Boost Software License | |
12 | # BCrypt and Blowfish files use BSD license. | |
13 | # Documentation is CC-BY-SA | |
14 | # See: https://bugzilla.redhat.com/show_bug.cgi?id=470696#c146 | |
15 | License: Boost and BSD and BSD with advertising and MIT and zlib | |
c3715c90 | 16 | Group: Networking/Daemons/HTTP |
0b769d0f | 17 | Source0: https://github.com/phusion/passenger/archive/release-%{version}.tar.gz |
cf635985 | 18 | # Source0-md5: 1f94d1264e6fdbe5a202472454e00d88 |
c9e1f73a | 19 | Source1: apache-mod_%{name}.conf |
8f90c771 | 20 | Patch0: alias+public.patch |
cf635985 | 21 | Patch1: no-bundler.patch |
0b769d0f | 22 | URL: https://www.phusionpassenger.com/ |
a6dd913b | 23 | BuildRequires: apache-devel >= 2.0.55-1 |
2be03977 | 24 | BuildRequires: apache-tools |
26446e83 | 25 | BuildRequires: apr-devel >= 1:1.0.0 |
a6dd913b | 26 | BuildRequires: apr-util-devel >= 1:1.0.0 |
4e15a504 | 27 | #BuildRequires: asciidoc |
681e9caf | 28 | BuildRequires: curl-devel |
cf635985 | 29 | BuildRequires: libev-devel >= 4.11 |
76045959 | 30 | BuildRequires: libstdc++-devel |
cf635985 | 31 | BuildRequires: libuv-devel >= 1.4.2 |
26446e83 | 32 | BuildRequires: openssl-devel |
76045959 | 33 | BuildRequires: rpm-pythonprov |
fe9ba373 | 34 | BuildRequires: rpmbuild(macros) >= 1.559 |
a6dd913b | 35 | BuildRequires: ruby-devel |
50225bc6 | 36 | BuildRequires: ruby-rake >= 0.8.0 |
2423fa08 | 37 | BuildRequires: ruby-rdoc |
6cb57b65 | 38 | BuildRequires: sed >= 4.0 |
26446e83 | 39 | BuildRequires: zlib-devel |
bc478f28 ER |
40 | %if %(locale -a | grep -q '^en_US$'; echo $?) |
41 | BuildRequires: glibc-localedb-all | |
42 | %endif | |
4e15a504 | 43 | Obsoletes: apache-mod_rails-rdoc |
a6dd913b | 44 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
45 | ||
d25d580b | 46 | %define apxs /usr/sbin/apxs |
d833e7f5 ER |
47 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
48 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
49 | ||
a6dd913b | 50 | %description |
bc478f28 | 51 | Phusion Passenger - a.k.a. mod_passenger - makes deployment of |
a6dd913b | 52 | applications built on the revolutionary Ruby on Rails web framework a |
53 | breeze. It follows the usual Ruby on Rails conventions, such as | |
c9e1f73a | 54 | "Don't-Repeat-Yourself". |
a6dd913b | 55 | |
b9dbf00f JB |
56 | %description -l pl.UTF-8 |
57 | Phusion Passenger (inaczej mod_passenger) ułatwia wdrażanie aplikacji | |
58 | zbudowanych w oparciu o rewolucyjny szkielet WWW Ruby on Rails. Jest | |
59 | zgodny ze zwyczajowymi konwencjami Ruby on Rails, takimi jak "nie | |
60 | powtarzaj się". | |
61 | ||
bc478f28 ER |
62 | %package -n apache-mod_passenger |
63 | Summary: Apache Module for Phusion Passenger | |
b9dbf00f | 64 | Summary(pl.UTF-8): Moduł Apache'a dla Phusion Passengera |
bc478f28 ER |
65 | License: Boost and BSD and BSD with advertising and MIT and zlib |
66 | Group: Daemons | |
67 | Requires: %{name} = %{version}-%{release} | |
68 | Requires: apache(modules-api) = %apache_modules_api | |
20667242 | 69 | Requires: ruby-bundler |
bc478f28 | 70 | Provides: apache(mod_passenger) |
8f90c771 | 71 | Provides: apache(mod_rails) |
bc478f28 ER |
72 | Obsoletes: apache-mod_rails < 4.0 |
73 | ||
74 | %description -n apache-mod_passenger | |
75 | This package contains the pluggable Apache server module for Phusion | |
b9dbf00f JB |
76 | Passenger. |
77 | ||
78 | %description -n apache-mod_passenger -l pl.UTF-8 | |
79 | Ten pakiet zawiera ładowalny moduł serwera Apache dla Phusion | |
80 | Passengera. | |
bc478f28 ER |
81 | |
82 | %package -n ruby-passenger-ri | |
83 | Summary: ri documentation for Phusion Passenger | |
b9dbf00f | 84 | Summary(pl.UTF-8): Dokumentacja w formacie ri dla Phusion Passengera |
2a03dcd6 JR |
85 | Group: Documentation |
86 | Requires: ruby | |
bc478f28 | 87 | Obsoletes: apache-mod_rails-ri < 4.0 |
2a03dcd6 | 88 | |
bc478f28 | 89 | %description -n ruby-passenger-ri |
b9dbf00f | 90 | ri documentation for Phusion Passenger. |
2a03dcd6 | 91 | |
bc478f28 | 92 | %description -n ruby-passenger-ri -l pl.UTF-8 |
b9dbf00f | 93 | Dokumentacji w formacie ri dla Phusion Passengera. |
2a03dcd6 | 94 | |
a6dd913b | 95 | %prep |
c9e1f73a | 96 | %setup -q -n %{name}-release-%{version} |
bc478f28 | 97 | #%patch0 -p1 |
8f90c771 JR |
98 | %patch1 -p1 |
99 | ||
cf635985 AM |
100 | %{__sed} -i -e 's|#!/usr/bin/env python|#!%{_bindir}/python3|' src/helper-scripts/*.py |
101 | %{__sed} -i -e 's|#!/usr/bin/env ruby|#!%{_bindir}/ruby|' src/helper-scripts/{prespawn,download_binaries/extconf.rb,*.rb} bin/* | |
8f90c771 | 102 | |
cf635985 AM |
103 | # Don't use bundled libs |
104 | %{__rm} -r src/cxx_supportlib/vendor-modified/libev | |
105 | %{__rm} -r src/cxx_supportlib/vendor-copy/libuv | |
2b222840 | 106 | |
a6dd913b | 107 | %build |
cf635985 AM |
108 | export USE_VENDORED_LIBEV=no |
109 | export USE_VENDORED_LIBUV=no | |
06811060 ER |
110 | export CC="%{__cc}" |
111 | export CXX="%{__cxx}" | |
e0e226e5 JR |
112 | export CFLAGS="%{rpmcflags} -fno-strict-aliasing" |
113 | export CXXFLAGS="%{rpmcxxflags} -fno-strict-aliasing" | |
114 | export EXTRA_CFLAGS="%{rpmcflags} -fno-strict-aliasing" | |
115 | export EXTRA_CXXFLAGS="%{rpmcxxflags} -fno-strict-aliasing" | |
b9dbf00f | 116 | export EXTRA_PRE_LDFLAGS="%{rpmldflags}" |
bc478f28 | 117 | |
06811060 | 118 | export APACHECTL=%{_sbindir}/apachectl |
8749d44c | 119 | export HTTPD_VERSION=$(rpm -q apache-devel --qf '%{V}') |
c89bf01e JR |
120 | export HTTPD=%{_sbindir}/httpd |
121 | export APXS2=%{apxs} | |
06811060 | 122 | |
d211a771 | 123 | rake apache2 V=1 \ |
cf635985 AM |
124 | NATIVE_PACKAGING_METHOD=rpm \ |
125 | FS_PREFIX=%{_prefix} \ | |
126 | FS_BINDIR=%{_bindir} \ | |
127 | FS_SBINDIR=%{_sbindir} \ | |
128 | FS_DATADIR=%{_datadir} \ | |
129 | FS_LIBDIR=%{_libdir} \ | |
130 | RUBYLIBDIR=%{ruby_vendorlibdir} \ | |
131 | RUBYARCHDIR=%{_libdir}/%{name} \ | |
132 | APACHE2_MODULE_PATH=%{_libdir}/apache/mod_passenger.so | |
26446e83 | 133 | RELEASE=yes \ |
c89bf01e | 134 | OPTIMIZE=yes |
06811060 ER |
135 | |
136 | %if %{with tests} | |
137 | # Run the tests, capture the output, but don't fail the build if the tests fail | |
138 | # | |
139 | # This will make the test failure non-critical, but it should be examined | |
140 | # anyway. | |
b9dbf00f | 141 | %{__sed} -i 's|sh "cd test && \./cxx/CxxTestMain"|& rescue true|' build/cxx_tests.rb |
06811060 ER |
142 | |
143 | # adjust for rspec 2 while the test suite seems to require RSpec 1. | |
b9dbf00f | 144 | %{__sed} -i \ |
06811060 ER |
145 | "s|return locate_ruby_tool('spec')|return locate_ruby_tool('rspec')|" \ |
146 | lib/phusion_passenger/platform_info/ruby.rb | |
147 | ||
148 | rake test --trace | |
149 | %endif | |
2a03dcd6 | 150 | |
bc478f28 ER |
151 | # UTF8 locale needed for doc generation |
152 | LC_ALL=en_US.UTF-8 \ | |
26446e83 | 153 | rdoc --ri --op ri lib ext/ruby |
cec5cf62 | 154 | %{__rm} -r ri/{GC,IO,Object,Signal,CommonLibraryBuilder,Exception} |
26446e83 | 155 | %{__rm} ri/{cache.ri,created.rid} |
a6dd913b | 156 | |
157 | %install | |
158 | rm -rf $RPM_BUILD_ROOT | |
d833e7f5 | 159 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_mandir}/man{1,8}} \ |
cf635985 | 160 | $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir}/PhusionPassenger} \ |
681e9caf | 161 | $RPM_BUILD_ROOT%{_bindir} \ |
681e9caf | 162 | $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \ |
cf635985 | 163 | $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/{node_lib,helper-scripts} |
a6dd913b | 164 | |
bc478f28 ER |
165 | install -p buildout/apache2/mod_passenger.so $RPM_BUILD_ROOT%{_pkglibdir} |
166 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/75_mod_passenger.conf | |
167 | ||
168 | install -p buildout/ruby/ruby-*/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_vendorarchdir} | |
cf635985 | 169 | cp -a src/ruby_supportlib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} |
bc478f28 ER |
170 | |
171 | install -p bin/passenger-{config,memory-stats,status} bin/passenger $RPM_BUILD_ROOT%{_bindir} | |
cf635985 AM |
172 | #install -p buildout/agents/{PassengerLoggingAgent,PassengerWatchdog,PassengerHelperAgent,SpawnPreparer,TempDirToucher} $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents |
173 | cp -a src/helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts | |
174 | cp -a resources $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/ | |
175 | # does that make any sense? | |
176 | cp -a src/nodejs_supportlib/phusion_passenger/*.js $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/node_lib | |
bc478f28 | 177 | |
d833e7f5 ER |
178 | cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
179 | cp -p man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
cf635985 | 180 | cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}/PhusionPassenger |
e73e14e7 | 181 | |
a6dd913b | 182 | %clean |
183 | rm -rf $RPM_BUILD_ROOT | |
184 | ||
bc478f28 | 185 | %post -n apache-mod_passenger |
a6dd913b | 186 | %service -q httpd restart |
187 | ||
bc478f28 | 188 | %postun -n apache-mod_passenger |
a6dd913b | 189 | if [ "$1" = "0" ]; then |
190 | %service -q httpd restart | |
191 | fi | |
192 | ||
193 | %files | |
194 | %defattr(644,root,root,755) | |
bc478f28 | 195 | %doc README.md INSTALL.md |
e73e14e7 | 196 | %attr(755,root,root) %{_bindir}/passenger |
d833e7f5 ER |
197 | %attr(755,root,root) %{_bindir}/passenger-config |
198 | %attr(755,root,root) %{_bindir}/passenger-memory-stats | |
199 | %attr(755,root,root) %{_bindir}/passenger-status | |
d25d580b | 200 | %{_mandir}/man1/passenger-config.1* |
d25d580b ER |
201 | %{_mandir}/man8/passenger-memory-stats.8* |
202 | %{_mandir}/man8/passenger-status.8* | |
d25d580b ER |
203 | %attr(755,root,root) %{ruby_vendorarchdir}/passenger_native_support.so |
204 | %{ruby_vendorlibdir}/phusion_passenger.rb | |
205 | %{ruby_vendorlibdir}/phusion_passenger | |
206 | ||
681e9caf | 207 | %dir %{_libdir}/phusion-passenger |
208 | %dir %{_libdir}/phusion-passenger/agents | |
cf635985 AM |
209 | #%attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerHelperAgent |
210 | #%attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerLoggingAgent | |
211 | #%attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerWatchdog | |
212 | #%attr(755,root,root) %{_libdir}/phusion-passenger/agents/SpawnPreparer | |
213 | #%attr(755,root,root) %{_libdir}/phusion-passenger/agents/TempDirToucher | |
681e9caf | 214 | %dir %{_datadir}/phusion-passenger |
215 | %dir %{_datadir}/phusion-passenger/helper-scripts | |
216 | %attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/* | |
8f90c771 JR |
217 | %{_datadir}/phusion-passenger/resources |
218 | %{_datadir}/phusion-passenger/node_lib | |
2a03dcd6 | 219 | |
bc478f28 ER |
220 | %files -n apache-mod_passenger |
221 | %defattr(644,root,root,755) | |
bc478f28 ER |
222 | %defattr(644,root,root,755) |
223 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_passenger.conf | |
224 | %attr(755,root,root) %{_pkglibdir}/mod_passenger.so | |
225 | ||
226 | %files -n ruby-passenger-ri | |
2a03dcd6 JR |
227 | %defattr(644,root,root,755) |
228 | %{ruby_ridir}/PhusionPassenger |