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