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