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