]>
Commit | Line | Data |
---|---|---|
06811060 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_with tests # build without tests | |
4 | ||
a6dd913b | 5 | Summary: A module to bridge Ruby on Rails to Apache |
c9e1f73a | 6 | Name: passenger |
cf570175 | 7 | Version: 3.0.19 |
af9190a1 | 8 | Release: 2 |
cf570175 ER |
9 | # Passenger code uses MIT license. |
10 | # Bundled(Boost) uses Boost Software License | |
11 | # BCrypt and Blowfish files use BSD license. | |
12 | # Documentation is CC-BY-SA | |
13 | # See: https://bugzilla.redhat.com/show_bug.cgi?id=470696#c146 | |
14 | License: Boost and BSD and BSD with advertising and MIT and zlib | |
c3715c90 | 15 | Group: Networking/Daemons/HTTP |
0b769d0f | 16 | Source0: https://github.com/phusion/passenger/archive/release-%{version}.tar.gz |
06811060 | 17 | # Source0-md5: de848f42cb4f83e19d6c8a41a187a4db |
c9e1f73a ER |
18 | Source1: apache-mod_%{name}.conf |
19 | Patch0: nogems.patch | |
20 | Patch1: alias+public.patch | |
21 | Patch2: %{name}_apache_fix_autofoo.patch | |
2423fa08 | 22 | Patch3: progs.patch |
0b769d0f | 23 | URL: https://www.phusionpassenger.com/ |
a6dd913b | 24 | BuildRequires: apache-devel >= 2.0.55-1 |
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 |
2b222840 | 29 | BuildRequires: libev-devel |
76045959 | 30 | BuildRequires: libstdc++-devel |
26446e83 | 31 | BuildRequires: openssl-devel |
76045959 | 32 | BuildRequires: rpm-pythonprov |
fe9ba373 | 33 | BuildRequires: rpmbuild(macros) >= 1.559 |
a6dd913b | 34 | BuildRequires: ruby-devel |
50225bc6 | 35 | BuildRequires: ruby-rake >= 0.8.0 |
2423fa08 | 36 | BuildRequires: ruby-rdoc |
6cb57b65 | 37 | BuildRequires: sed >= 4.0 |
26446e83 | 38 | BuildRequires: zlib-devel |
d833e7f5 | 39 | Requires: apache(modules-api) = %apache_modules_api |
a6dd913b | 40 | Provides: apache(mod_rails) |
4e15a504 | 41 | Obsoletes: apache-mod_rails-rdoc |
a6dd913b | 42 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
43 | ||
d25d580b | 44 | %define apxs /usr/sbin/apxs |
d833e7f5 ER |
45 | %define _pkglibdir %(%{apxs} -q LIBEXECDIR 2>/dev/null) |
46 | %define _sysconfdir %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d | |
47 | ||
a6dd913b | 48 | %description |
49 | Phusion Passenger — a.k.a. mod_rails — makes deployment of | |
50 | applications built on the revolutionary Ruby on Rails web framework a | |
51 | breeze. It follows the usual Ruby on Rails conventions, such as | |
c9e1f73a | 52 | "Don't-Repeat-Yourself". |
a6dd913b | 53 | |
2a03dcd6 | 54 | %package ri |
0a3f766b ER |
55 | Summary: ri documentation for Apache mod_rails |
56 | Summary(pl.UTF-8): Dokumentacja w formacie ri dla Apache mod_rails | |
2a03dcd6 JR |
57 | Group: Documentation |
58 | Requires: ruby | |
59 | ||
60 | %description ri | |
0a3f766b | 61 | ri documentation for Apache mod_rails. |
2a03dcd6 JR |
62 | |
63 | %description ri -l pl.UTF-8 | |
0a3f766b | 64 | Dokumentacji w formacie ri dla Apache mod_rails. |
2a03dcd6 | 65 | |
a6dd913b | 66 | %prep |
c9e1f73a | 67 | %setup -q -n %{name}-release-%{version} |
9ffe5700 | 68 | %patch0 -p1 |
26446e83 | 69 | %patch1 -p0 |
f41b67ce | 70 | %patch2 -p0 |
2423fa08 | 71 | %patch3 -p1 |
2a03dcd6 | 72 | |
06811060 ER |
73 | mv test/config.yml{.example,} |
74 | ||
2b222840 ER |
75 | # Don't use bundled libev |
76 | rm -r ext/libev | |
77 | ||
a6dd913b | 78 | %build |
06811060 ER |
79 | export USE_VENDORED_LIBEV=false |
80 | export CC="%{__cc}" | |
81 | export CXX="%{__cxx}" | |
82 | export CFLAGS="%{rpmcflags}" | |
83 | export CXXFLAGS="%{rpmcxxflags}" | |
84 | export APACHECTL=%{_sbindir}/apachectl | |
8749d44c | 85 | export HTTPD_VERSION=$(rpm -q apache-devel --qf '%{V}') |
c89bf01e JR |
86 | export HTTPD=%{_sbindir}/httpd |
87 | export APXS2=%{apxs} | |
06811060 | 88 | |
d211a771 | 89 | rake apache2 V=1 \ |
26446e83 | 90 | RELEASE=yes \ |
c89bf01e | 91 | OPTIMIZE=yes |
06811060 ER |
92 | |
93 | %if %{with tests} | |
94 | # Run the tests, capture the output, but don't fail the build if the tests fail | |
95 | # | |
96 | # This will make the test failure non-critical, but it should be examined | |
97 | # anyway. | |
98 | sed -i 's|sh "cd test && \./cxx/CxxTestMain"|& rescue true|' build/cxx_tests.rb | |
99 | ||
100 | # adjust for rspec 2 while the test suite seems to require RSpec 1. | |
101 | sed -i \ | |
102 | "s|return locate_ruby_tool('spec')|return locate_ruby_tool('rspec')|" \ | |
103 | lib/phusion_passenger/platform_info/ruby.rb | |
104 | ||
105 | rake test --trace | |
106 | %endif | |
2a03dcd6 | 107 | |
26446e83 JR |
108 | rdoc --ri --op ri lib ext/ruby |
109 | %{__rm} -r ri/{ConditionVariable,Exception,GC,IO,Object,Process,Signal} | |
110 | %{__rm} ri/{cache.ri,created.rid} | |
a6dd913b | 111 | |
112 | %install | |
113 | rm -rf $RPM_BUILD_ROOT | |
d833e7f5 | 114 | install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_mandir}/man{1,8}} \ |
d25d580b | 115 | $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir}} \ |
681e9caf | 116 | $RPM_BUILD_ROOT%{_bindir} \ |
681e9caf | 117 | $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \ |
118 | $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts | |
a6dd913b | 119 | |
d833e7f5 | 120 | install -p ext/apache2/mod_passenger.so $RPM_BUILD_ROOT%{_pkglibdir} |
d25d580b | 121 | install -p ext/ruby/ruby-*/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_vendorarchdir} |
d833e7f5 ER |
122 | install -p bin/passenger-{config,memory-stats,status} bin/passenger $RPM_BUILD_ROOT%{_bindir} |
123 | install -p agents/PassengerLoggingAgent agents/PassengerWatchdog $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents | |
124 | install -p agents/apache2/PassengerHelperAgent $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 | |
125 | install -p helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts | |
d25d580b | 126 | cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir} |
d833e7f5 ER |
127 | cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 |
128 | cp -p man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8 | |
2a03dcd6 | 129 | cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir} |
d833e7f5 | 130 | cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/75_mod_rails.conf |
a6dd913b | 131 | |
e73e14e7 JR |
132 | %{__sed} -i -e 's|#!/usr/bin/env ruby|#!%{_bindir}/ruby|' \ |
133 | $RPM_BUILD_ROOT%{_bindir}/passenger \ | |
134 | $RPM_BUILD_ROOT%{_bindir}/passenger-* \ | |
135 | $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts/* | |
136 | ||
137 | %{__sed} -i -e 's|#!/usr/bin/env python|#!%{_bindir}/python|' \ | |
d25d580b | 138 | $RPM_BUILD_ROOT%{ruby_vendorlibdir}/phusion_passenger/wsgi/request_handler.py |
e73e14e7 | 139 | |
a6dd913b | 140 | %clean |
141 | rm -rf $RPM_BUILD_ROOT | |
142 | ||
143 | %post | |
144 | %service -q httpd restart | |
145 | ||
146 | %postun | |
147 | if [ "$1" = "0" ]; then | |
148 | %service -q httpd restart | |
149 | fi | |
150 | ||
151 | %files | |
152 | %defattr(644,root,root,755) | |
cf570175 ER |
153 | %doc INSTALL README |
154 | #%doc doc/{A*.txt,Security*.txt,*Apache.txt} | |
155 | #%doc doc/{A*.html,Security*.html,*Apache.html,images} | |
d833e7f5 ER |
156 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_rails.conf |
157 | %attr(755,root,root) %{_pkglibdir}/mod_passenger.so | |
e73e14e7 | 158 | %attr(755,root,root) %{_bindir}/passenger |
d833e7f5 ER |
159 | %attr(755,root,root) %{_bindir}/passenger-config |
160 | %attr(755,root,root) %{_bindir}/passenger-memory-stats | |
161 | %attr(755,root,root) %{_bindir}/passenger-status | |
d25d580b ER |
162 | %{_mandir}/man1/passenger-config.1* |
163 | %{_mandir}/man1/passenger-stress-test.1* | |
164 | %{_mandir}/man8/passenger-memory-stats.8* | |
165 | %{_mandir}/man8/passenger-status.8* | |
166 | ||
167 | %attr(755,root,root) %{ruby_vendorarchdir}/passenger_native_support.so | |
168 | %{ruby_vendorlibdir}/phusion_passenger.rb | |
169 | %{ruby_vendorlibdir}/phusion_passenger | |
170 | ||
681e9caf | 171 | %dir %{_libdir}/phusion-passenger |
172 | %dir %{_libdir}/phusion-passenger/agents | |
d833e7f5 ER |
173 | %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerLoggingAgent |
174 | %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerWatchdog | |
681e9caf | 175 | %dir %{_libdir}/phusion-passenger/agents/apache2 |
176 | %attr(755,root,root) %{_libdir}/phusion-passenger/agents/apache2/Passenger* | |
681e9caf | 177 | %dir %{_datadir}/phusion-passenger |
178 | %dir %{_datadir}/phusion-passenger/helper-scripts | |
179 | %attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/* | |
2a03dcd6 | 180 | |
2a03dcd6 JR |
181 | %files ri |
182 | %defattr(644,root,root,755) | |
183 | %{ruby_ridir}/PhusionPassenger |