1 # Obsolete: see passenger.spec instead
4 %bcond_with tests # build without tests
6 %define gem_name passenger
7 Summary: A module to bridge Ruby on Rails to Apache
11 # Passenger code uses MIT license.
12 # Bundled(Boost) uses Boost Software License
13 # BCrypt and Blowfish files use BSD license.
14 # Documentation is CC-BY-SA
15 # See: https://bugzilla.redhat.com/show_bug.cgi?id=470696#c146
16 License: Boost and BSD and BSD with advertising and MIT and zlib
17 Group: Networking/Daemons/HTTP
18 Source0: https://github.com/phusion/passenger/archive/release-%{version}.tar.gz
19 # Source0-md5: de848f42cb4f83e19d6c8a41a187a4db
21 Patch0: %{name}-nogems.patch
22 Patch1: %{name}-alias+public.patch
23 Patch2: passenger_apache_fix_autofoo.patch
25 URL: https://www.phusionpassenger.com/
26 BuildRequires: apache-devel >= 2.0.55-1
27 BuildRequires: apr-devel >= 1:1.0.0
28 BuildRequires: apr-util-devel >= 1:1.0.0
29 #BuildRequires: asciidoc
30 BuildRequires: curl-devel
31 BuildRequires: libev-devel
32 BuildRequires: libstdc++-devel
33 BuildRequires: openssl-devel
34 BuildRequires: rpm-pythonprov
35 BuildRequires: rpmbuild(macros) >= 1.559
36 BuildRequires: ruby-devel
37 BuildRequires: ruby-rake >= 0.8.0
38 BuildRequires: ruby-rdoc
39 BuildRequires: sed >= 4.0
40 BuildRequires: zlib-devel
41 Requires: apache(modules-api) = %apache_modules_api
42 Provides: apache(mod_rails)
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_rails — 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".
57 Summary: ri documentation for Apache mod_rails
58 Summary(pl.UTF-8): Dokumentacja w formacie ri dla Apache mod_rails
63 ri documentation for Apache mod_rails.
65 %description ri -l pl.UTF-8
66 Dokumentacji w formacie ri dla Apache mod_rails.
69 %setup -q -n %{gem_name}-release-%{version}
75 mv test/config.yml{.example,}
77 # Don't use bundled libev
81 export USE_VENDORED_LIBEV=false
84 export CFLAGS="%{rpmcflags}"
85 export CXXFLAGS="%{rpmcxxflags}"
86 export APACHECTL=%{_sbindir}/apachectl
87 export HTTPD_VERSION=$(rpm -q apache-devel --qf '%{V}')
88 export HTTPD=%{_sbindir}/httpd
96 # Run the tests, capture the output, but don't fail the build if the tests fail
98 # This will make the test failure non-critical, but it should be examined
100 sed -i 's|sh "cd test && \./cxx/CxxTestMain"|& rescue true|' build/cxx_tests.rb
102 # adjust for rspec 2 while the test suite seems to require RSpec 1.
104 "s|return locate_ruby_tool('spec')|return locate_ruby_tool('rspec')|" \
105 lib/phusion_passenger/platform_info/ruby.rb
110 rdoc --ri --op ri lib ext/ruby
111 %{__rm} -r ri/{ConditionVariable,Exception,GC,IO,Object,Process,Signal}
112 %{__rm} ri/{cache.ri,created.rid}
115 rm -rf $RPM_BUILD_ROOT
116 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_mandir}/man{1,8}} \
117 $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir}} \
118 $RPM_BUILD_ROOT%{_bindir} \
119 $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \
120 $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
122 install -p ext/apache2/mod_passenger.so $RPM_BUILD_ROOT%{_pkglibdir}
123 install -p ext/ruby/ruby-*/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
124 install -p bin/passenger-{config,memory-stats,status} bin/passenger $RPM_BUILD_ROOT%{_bindir}
125 install -p agents/PassengerLoggingAgent agents/PassengerWatchdog $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents
126 install -p agents/apache2/PassengerHelperAgent $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2
127 install -p helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
128 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
129 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
130 cp -p man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
131 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
132 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/75_mod_rails.conf
134 %{__sed} -i -e 's|#!/usr/bin/env ruby|#!%{_bindir}/ruby|' \
135 $RPM_BUILD_ROOT%{_bindir}/passenger \
136 $RPM_BUILD_ROOT%{_bindir}/passenger-* \
137 $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts/*
139 %{__sed} -i -e 's|#!/usr/bin/env python|#!%{_bindir}/python|' \
140 $RPM_BUILD_ROOT%{ruby_vendorlibdir}/phusion_passenger/wsgi/request_handler.py
143 rm -rf $RPM_BUILD_ROOT
146 %service -q httpd restart
149 if [ "$1" = "0" ]; then
150 %service -q httpd restart
154 %defattr(644,root,root,755)
156 #%doc doc/{A*.txt,Security*.txt,*Apache.txt}
157 #%doc doc/{A*.html,Security*.html,*Apache.html,images}
158 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_rails.conf
159 %attr(755,root,root) %{_pkglibdir}/mod_passenger.so
160 %attr(755,root,root) %{_bindir}/passenger
161 %attr(755,root,root) %{_bindir}/passenger-config
162 %attr(755,root,root) %{_bindir}/passenger-memory-stats
163 %attr(755,root,root) %{_bindir}/passenger-status
164 %{_mandir}/man1/passenger-config.1*
165 %{_mandir}/man1/passenger-stress-test.1*
166 %{_mandir}/man8/passenger-memory-stats.8*
167 %{_mandir}/man8/passenger-status.8*
169 %attr(755,root,root) %{ruby_vendorarchdir}/passenger_native_support.so
170 %{ruby_vendorlibdir}/phusion_passenger.rb
171 %{ruby_vendorlibdir}/phusion_passenger
173 %dir %{_libdir}/phusion-passenger
174 %dir %{_libdir}/phusion-passenger/agents
175 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerLoggingAgent
176 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerWatchdog
177 %dir %{_libdir}/phusion-passenger/agents/apache2
178 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/apache2/Passenger*
179 %dir %{_datadir}/phusion-passenger
180 %dir %{_datadir}/phusion-passenger/helper-scripts
181 %attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/*
184 %defattr(644,root,root,755)
185 %{ruby_ridir}/PhusionPassenger