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