3 %bcond_with tests # test target
5 Summary: A module to bridge Ruby on Rails to Apache
6 Summary(pl.UTF-8): Moduł służący za bramkę Ruby on Rails do Apache'a
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
16 Group: Networking/Daemons/HTTP
17 Source0: https://github.com/phusion/passenger/archive/release-%{version}.tar.gz
18 # Source0-md5: 69c6ade41d870782ae12c3f49d79ce20
19 Source1: apache-mod_%{name}.conf
20 Patch0: alias+public.patch
22 Patch2: no-bundler.patch
23 URL: https://www.phusionpassenger.com/
24 BuildRequires: apache-devel >= 2.0.55-1
25 BuildRequires: apache-tools
26 BuildRequires: apr-devel >= 1:1.0.0
27 BuildRequires: apr-util-devel >= 1:1.0.0
28 #BuildRequires: asciidoc
29 BuildRequires: curl-devel
30 BuildRequires: libev-devel
31 BuildRequires: libstdc++-devel
32 BuildRequires: openssl-devel
33 BuildRequires: rpm-pythonprov
34 BuildRequires: rpmbuild(macros) >= 1.559
35 BuildRequires: ruby-devel
36 BuildRequires: ruby-rake >= 0.8.0
37 BuildRequires: ruby-rdoc
38 BuildRequires: sed >= 4.0
39 BuildRequires: zlib-devel
40 %if %(locale -a | grep -q '^en_US$'; echo $?)
41 BuildRequires: glibc-localedb-all
43 Obsoletes: apache-mod_rails-rdoc
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
46 %define apxs /usr/sbin/apxs
47 %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null)
48 %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
51 Phusion Passenger - a.k.a. mod_passenger - makes deployment of
52 applications built on the revolutionary Ruby on Rails web framework a
53 breeze. It follows the usual Ruby on Rails conventions, such as
54 "Don't-Repeat-Yourself".
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
62 %package -n apache-mod_passenger
63 Summary: Apache Module for Phusion Passenger
64 Summary(pl.UTF-8): Moduł Apache'a dla Phusion Passengera
65 License: Boost and BSD and BSD with advertising and MIT and zlib
67 Requires: %{name} = %{version}-%{release}
68 Requires: apache(modules-api) = %apache_modules_api
69 Requires: ruby-bundler
70 Provides: apache(mod_passenger)
71 Provides: apache(mod_rails)
72 Obsoletes: apache-mod_rails < 4.0
74 %description -n apache-mod_passenger
75 This package contains the pluggable Apache server module for Phusion
78 %description -n apache-mod_passenger -l pl.UTF-8
79 Ten pakiet zawiera ładowalny moduł serwera Apache dla Phusion
82 %package -n ruby-passenger-ri
83 Summary: ri documentation for Phusion Passenger
84 Summary(pl.UTF-8): Dokumentacja w formacie ri dla Phusion Passengera
87 Obsoletes: apache-mod_rails-ri < 4.0
89 %description -n ruby-passenger-ri
90 ri documentation for Phusion Passenger.
92 %description -n ruby-passenger-ri -l pl.UTF-8
93 Dokumentacji w formacie ri dla Phusion Passengera.
96 %setup -q -n %{name}-release-%{version}
101 __rubydir=$(echo %{ruby_vendorlibdir} | %{__sed} -e 's|/usr||')
103 %{__sed} -i -e "s|@@LIB@@|%{_lib}|g" \
104 -e "s|@@RUBYLIBDIR@@|$__rubydir|g" ext/common/ResourceLocator.h
106 %{__sed} -i -e 's|#!/usr/bin/env python|#!%{_bindir}/python|' helper-scripts/*.py
107 %{__sed} -i -e 's|#!/usr/bin/env ruby|#!%{_bindir}/ruby|' helper-scripts/{prespawn,download_binaries/extconf.rb,*.rb} bin/*
109 # Don't use bundled libev
113 export USE_VENDORED_LIBEV=false
115 export CXX="%{__cxx}"
116 export CFLAGS="%{rpmcflags} -fno-strict-aliasing"
117 export CXXFLAGS="%{rpmcxxflags} -fno-strict-aliasing"
118 export EXTRA_CFLAGS="%{rpmcflags} -fno-strict-aliasing"
119 export EXTRA_CXXFLAGS="%{rpmcxxflags} -fno-strict-aliasing"
120 export EXTRA_PRE_LDFLAGS="%{rpmldflags}"
122 export APACHECTL=%{_sbindir}/apachectl
123 export HTTPD_VERSION=$(rpm -q apache-devel --qf '%{V}')
124 export HTTPD=%{_sbindir}/httpd
132 # Run the tests, capture the output, but don't fail the build if the tests fail
134 # This will make the test failure non-critical, but it should be examined
136 %{__sed} -i 's|sh "cd test && \./cxx/CxxTestMain"|& rescue true|' build/cxx_tests.rb
138 # adjust for rspec 2 while the test suite seems to require RSpec 1.
140 "s|return locate_ruby_tool('spec')|return locate_ruby_tool('rspec')|" \
141 lib/phusion_passenger/platform_info/ruby.rb
146 # UTF8 locale needed for doc generation
148 rdoc --ri --op ri lib ext/ruby
149 %{__rm} -r ri/{GC,IO,Object,Signal,CommonLibraryBuilder,Exception,DaemonController}
150 %{__rm} ri/{cache.ri,created.rid}
153 rm -rf $RPM_BUILD_ROOT
154 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_mandir}/man{1,8}} \
155 $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir}} \
156 $RPM_BUILD_ROOT%{_bindir} \
157 $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \
158 $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
160 install -p buildout/apache2/mod_passenger.so $RPM_BUILD_ROOT%{_pkglibdir}
161 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/75_mod_passenger.conf
163 install -p buildout/ruby/ruby-*/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
164 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
166 install -p bin/passenger-{config,memory-stats,status} bin/passenger $RPM_BUILD_ROOT%{_bindir}
167 install -p buildout/agents/{PassengerLoggingAgent,PassengerWatchdog,PassengerHelperAgent,SpawnPreparer,TempDirToucher} $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents
168 cp -a helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
169 cp -a resources node_lib $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/
171 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
172 cp -p man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
173 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
176 rm -rf $RPM_BUILD_ROOT
178 %post -n apache-mod_passenger
179 %service -q httpd restart
181 %postun -n apache-mod_passenger
182 if [ "$1" = "0" ]; then
183 %service -q httpd restart
187 %defattr(644,root,root,755)
188 %doc README.md INSTALL.md
189 %attr(755,root,root) %{_bindir}/passenger
190 %attr(755,root,root) %{_bindir}/passenger-config
191 %attr(755,root,root) %{_bindir}/passenger-memory-stats
192 %attr(755,root,root) %{_bindir}/passenger-status
193 %{_mandir}/man1/passenger-config.1*
194 %{_mandir}/man8/passenger-memory-stats.8*
195 %{_mandir}/man8/passenger-status.8*
197 %attr(755,root,root) %{ruby_vendorarchdir}/passenger_native_support.so
198 %{ruby_vendorlibdir}/phusion_passenger.rb
199 %{ruby_vendorlibdir}/phusion_passenger
201 %dir %{_libdir}/phusion-passenger
202 %dir %{_libdir}/phusion-passenger/agents
203 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerHelperAgent
204 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerLoggingAgent
205 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerWatchdog
206 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/SpawnPreparer
207 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/TempDirToucher
208 %dir %{_datadir}/phusion-passenger
209 %dir %{_datadir}/phusion-passenger/helper-scripts
210 %attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/*
211 %{_datadir}/phusion-passenger/resources
212 %{_datadir}/phusion-passenger/node_lib
214 %files -n apache-mod_passenger
215 %defattr(644,root,root,755)
216 %doc doc/Users?guide?Apache.txt
217 %defattr(644,root,root,755)
218 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_passenger.conf
219 %attr(755,root,root) %{_pkglibdir}/mod_passenger.so
221 %files -n ruby-passenger-ri
222 %defattr(644,root,root,755)
223 %{ruby_ridir}/PhusionPassenger