]> git.pld-linux.org Git - packages/passenger.git/blob - passenger.spec
36a39f87d03df417eef38eec2e38ed50071c5bb8
[packages/passenger.git] / passenger.spec
1 # TODO
2 # - pass our cppflags
3 #   /usr/include/features.h:341:4: warning: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Wcpp]
4 #   #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
5 # Conditional build:
6 %bcond_with     tests           # build without tests
7
8 Summary:        A module to bridge Ruby on Rails to Apache
9 Name:           passenger
10 Version:        4.0.48
11 Release:        0.1
12 # Passenger code uses MIT license.
13 # Bundled(Boost) uses Boost Software License
14 # BCrypt and Blowfish files use BSD license.
15 # Documentation is CC-BY-SA
16 # See: https://bugzilla.redhat.com/show_bug.cgi?id=470696#c146
17 License:        Boost and BSD and BSD with advertising and MIT and zlib
18 Group:          Networking/Daemons/HTTP
19 Source0:        https://github.com/phusion/passenger/archive/release-%{version}.tar.gz
20 # Source0-md5:  e77d1940f9bc86314d84634236339d1b
21 Source1:        apache-mod_%{name}.conf
22 Patch0:         nogems.patch
23 Patch1:         alias+public.patch
24 Patch2:         %{name}_apache_fix_autofoo.patch
25 Patch3:         progs.patch
26 URL:            https://www.phusionpassenger.com/
27 BuildRequires:  apache-devel >= 2.0.55-1
28 BuildRequires:  apache-tools
29 BuildRequires:  apr-devel >= 1:1.0.0
30 BuildRequires:  apr-util-devel >= 1:1.0.0
31 #BuildRequires: asciidoc
32 BuildRequires:  curl-devel
33 BuildRequires:  libev-devel
34 BuildRequires:  libstdc++-devel
35 BuildRequires:  openssl-devel
36 BuildRequires:  rpm-pythonprov
37 BuildRequires:  rpmbuild(macros) >= 1.559
38 BuildRequires:  ruby-devel
39 BuildRequires:  ruby-rake >= 0.8.0
40 BuildRequires:  ruby-rdoc
41 BuildRequires:  sed >= 4.0
42 BuildRequires:  zlib-devel
43 %if %(locale -a | grep -q '^en_US$'; echo $?)
44 BuildRequires:  glibc-localedb-all
45 %endif
46 Obsoletes:      apache-mod_rails-rdoc
47 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
48
49 %define         apxs            /usr/sbin/apxs
50 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
51 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
52
53 %description
54 Phusion Passenger - a.k.a. mod_passenger - makes deployment of
55 applications built on the revolutionary Ruby on Rails web framework a
56 breeze. It follows the usual Ruby on Rails conventions, such as
57 "Don't-Repeat-Yourself".
58
59 %package -n apache-mod_passenger
60 Summary:        Apache Module for Phusion Passenger
61 License:        Boost and BSD and BSD with advertising and MIT and zlib
62 Group:          Daemons
63 Requires:       %{name} = %{version}-%{release}
64 Requires:       apache(modules-api) = %apache_modules_api
65 Provides:       apache(mod_passenger)
66 Obsoletes:      apache-mod_rails < 4.0
67
68 %description -n apache-mod_passenger
69 This package contains the pluggable Apache server module for Phusion
70 Passenger(tm).
71
72 %package -n ruby-passenger-ri
73 Summary:        ri documentation for Phusion Passenger
74 Summary(pl.UTF-8):      Dokumentacja w formacie ri dla Phusion Passenger
75 Group:          Documentation
76 Requires:       ruby
77 Obsoletes:      apache-mod_rails-ri < 4.0
78
79 %description -n ruby-passenger-ri
80 ri documentation for Phusion Passenger
81
82 %description -n ruby-passenger-ri -l pl.UTF-8
83 Dokumentacji w formacie ri dla Phusion Passenger
84
85 %prep
86 %setup -q -n %{name}-release-%{version}
87 #%patch0 -p1
88 #%patch1 -p0
89 #%patch2 -p0
90 #%patch3 -p1
91
92 %{__sed} -i -e 's|#!/usr/bin/env python|#!%{_bindir}/python|' helper-scripts/*.py
93 %{__sed} -i -e 's|#!/usr/bin/env ruby|#!%{_bindir}/ruby|' helper-scripts/{prespawn,download_binaries/extconf.rb,*.rb} bin/*
94
95 # Don't use bundled libev
96 rm -r ext/libev
97
98 %build
99 export USE_VENDORED_LIBEV=false
100 export CC="%{__cc}"
101 export CXX="%{__cxx}"
102 export CFLAGS="%{rpmcflags}"
103 export CXXFLAGS="%{rpmcxxflags}"
104
105 export APACHECTL=%{_sbindir}/apachectl
106 export HTTPD_VERSION=$(rpm -q apache-devel --qf '%{V}')
107 export HTTPD=%{_sbindir}/httpd
108 export APXS2=%{apxs}
109
110 rake apache2 V=1 \
111         RELEASE=yes \
112         OPTIMIZE=yes
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
128
129 # UTF8 locale needed for doc generation
130 LC_ALL=en_US.UTF-8 \
131 rdoc --ri --op ri lib ext/ruby
132 %{__rm} -r ri/{GC,IO,Object,Signal,CommonLibraryBuilder,Exception,DaemonController}
133 %{__rm} ri/{cache.ri,created.rid}
134
135 %install
136 rm -rf $RPM_BUILD_ROOT
137 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_mandir}/man{1,8}} \
138         $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir}} \
139         $RPM_BUILD_ROOT%{_bindir} \
140         $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \
141         $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
142
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}
147 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
148
149 install -p bin/passenger-{config,memory-stats,status} bin/passenger $RPM_BUILD_ROOT%{_bindir}
150 install -p buildout/agents/{PassengerLoggingAgent,PassengerWatchdog,PassengerHelperAgent} $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents
151 cp -a helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
152
153 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
154 cp -p man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
155 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
156
157 %clean
158 rm -rf $RPM_BUILD_ROOT
159
160 %post -n apache-mod_passenger
161 %service -q httpd restart
162
163 %postun -n apache-mod_passenger
164 if [ "$1" = "0" ]; then
165         %service -q httpd restart
166 fi
167
168 %files
169 %defattr(644,root,root,755)
170 %doc README.md INSTALL.md
171 %attr(755,root,root) %{_bindir}/passenger
172 %attr(755,root,root) %{_bindir}/passenger-config
173 %attr(755,root,root) %{_bindir}/passenger-memory-stats
174 %attr(755,root,root) %{_bindir}/passenger-status
175 %{_mandir}/man1/passenger-config.1*
176 %{_mandir}/man8/passenger-memory-stats.8*
177 %{_mandir}/man8/passenger-status.8*
178
179 %attr(755,root,root) %{ruby_vendorarchdir}/passenger_native_support.so
180 %{ruby_vendorlibdir}/phusion_passenger.rb
181 %{ruby_vendorlibdir}/phusion_passenger
182
183 %dir %{_libdir}/phusion-passenger
184 %dir %{_libdir}/phusion-passenger/agents
185 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerHelperAgent
186 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerLoggingAgent
187 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerWatchdog
188 %dir %{_datadir}/phusion-passenger
189 %dir %{_datadir}/phusion-passenger/helper-scripts
190 %attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/*
191
192 %files -n apache-mod_passenger
193 %defattr(644,root,root,755)
194 %doc doc/Users?guide?Apache.txt
195 %defattr(644,root,root,755)
196 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_passenger.conf
197 %attr(755,root,root) %{_pkglibdir}/mod_passenger.so
198
199 %files -n ruby-passenger-ri
200 %defattr(644,root,root,755)
201 %{ruby_ridir}/PhusionPassenger
This page took 0.058755 seconds and 2 git commands to generate.