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