ruby(abi) dep is autofilled by rpm5 dependency generator
[packages/passenger.git] / apache-mod_rails.spec
1 %define         gem_name        passenger
2 Summary:        A module to bridge Ruby on Rails to Apache
3 Name:           apache-mod_rails
4 Version:        3.0.19
5 Release:        0.4
6 # Passenger code uses MIT license.
7 # Bundled(Boost) uses Boost Software License
8 # BCrypt and Blowfish files use BSD license.
9 # Documentation is CC-BY-SA
10 # See: https://bugzilla.redhat.com/show_bug.cgi?id=470696#c146
11 License:        Boost and BSD and BSD with advertising and MIT and zlib
12 Group:          Networking/Daemons/HTTP
13 Source0:        https://github.com/FooBarWidget/passenger/archive/release-%{version}.tar.gz
14 Source1:        %{name}.conf
15 Patch0:         %{name}-nogems.patch
16 Patch1:         %{name}-alias+public.patch
17 Patch2:         passenger_apache_fix_autofoo.patch
18 Patch3:         progs.patch
19 URL:            http://www.modrails.com/
20 BuildRequires:  apache-devel >= 2.0.55-1
21 BuildRequires:  apr-devel >= 1:1.0.0
22 BuildRequires:  apr-util-devel >= 1:1.0.0
23 #BuildRequires: asciidoc
24 BuildRequires:  curl-devel
25 BuildRequires:  libev-devel
26 BuildRequires:  libstdc++-devel
27 BuildRequires:  openssl-devel
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  rpmbuild(macros) >= 1.559
30 BuildRequires:  ruby-devel
31 BuildRequires:  ruby-rake >= 0.8.0
32 BuildRequires:  ruby-rdoc
33 BuildRequires:  sed >= 4.0
34 BuildRequires:  zlib-devel
35 Requires:       apache(modules-api) = %apache_modules_api
36 Provides:       apache(mod_rails)
37 Obsoletes:      apache-mod_rails-rdoc
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %define         apxs            /usr/sbin/apxs
41 %define         _pkglibdir      %(%{apxs} -q LIBEXECDIR 2>/dev/null)
42 %define         _sysconfdir     %(%{apxs} -q SYSCONFDIR 2>/dev/null)/conf.d
43
44 %description
45 Phusion Passenger — a.k.a. mod_rails — makes deployment of
46 applications built on the revolutionary Ruby on Rails web framework a
47 breeze. It follows the usual Ruby on Rails conventions, such as
48 "Don’t-Repeat-Yourself".
49
50 %package ri
51 Summary:        ri documentation for Apache mod_rails
52 Summary(pl.UTF-8):      Dokumentacja w formacie ri dla Apache mod_rails
53 Group:          Documentation
54 Requires:       ruby
55
56 %description ri
57 ri documentation for Apache mod_rails.
58
59 %description ri -l pl.UTF-8
60 Dokumentacji w formacie ri dla Apache mod_rails.
61
62 %prep
63 %setup -q -n %{gem_name}-release-%{version}
64 %patch0 -p1
65 %patch1 -p0
66 %patch2 -p0
67 %patch3 -p1
68
69 # Don't use bundled libev
70 rm -r ext/libev
71
72 %build
73 USE_VENDORED_LIBEV=false \
74 rake apache2 V=1 \
75         RELEASE=yes \
76         OPTIMIZE=yes \
77         APACHECTL=%{_sbindir}/apachectl \
78         APXS2=%{apxs} \
79         HTTPD=foo \
80         HTTPD_VERSION=$(rpm -q apache-devel --qf '%{V}') \
81         CC="%{__cc}" \
82         CXX="%{__cxx}" \
83         CFLAGS="%{rpmcflags}" \
84         CXXFLAGS="%{rpmcxxflags}"
85
86 rdoc --ri --op ri lib ext/ruby
87 %{__rm} -r ri/{ConditionVariable,Exception,GC,IO,Object,Process,Signal}
88 %{__rm} ri/{cache.ri,created.rid}
89
90 %install
91 rm -rf $RPM_BUILD_ROOT
92 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_mandir}/man{1,8}} \
93         $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir}} \
94         $RPM_BUILD_ROOT%{_bindir} \
95         $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \
96         $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
97
98 install -p ext/apache2/mod_passenger.so $RPM_BUILD_ROOT%{_pkglibdir}
99 install -p ext/ruby/ruby-*/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
100 install -p bin/passenger-{config,memory-stats,status} bin/passenger $RPM_BUILD_ROOT%{_bindir}
101 install -p agents/PassengerLoggingAgent agents/PassengerWatchdog $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents
102 install -p agents/apache2/PassengerHelperAgent $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2
103 install -p helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
104 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
105 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
106 cp -p man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
107 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
108 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/75_mod_rails.conf
109
110 %{__sed} -i -e 's|#!/usr/bin/env ruby|#!%{_bindir}/ruby|' \
111         $RPM_BUILD_ROOT%{_bindir}/passenger \
112         $RPM_BUILD_ROOT%{_bindir}/passenger-* \
113         $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts/*
114
115 %{__sed} -i -e 's|#!/usr/bin/env python|#!%{_bindir}/python|' \
116         $RPM_BUILD_ROOT%{ruby_vendorlibdir}/phusion_passenger/wsgi/request_handler.py
117
118 %clean
119 rm -rf $RPM_BUILD_ROOT
120
121 %post
122 %service -q httpd restart
123
124 %postun
125 if [ "$1" = "0" ]; then
126         %service -q httpd restart
127 fi
128
129 %files
130 %defattr(644,root,root,755)
131 %doc INSTALL README
132 #%doc doc/{A*.txt,Security*.txt,*Apache.txt}
133 #%doc doc/{A*.html,Security*.html,*Apache.html,images}
134 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_rails.conf
135 %attr(755,root,root) %{_pkglibdir}/mod_passenger.so
136 %attr(755,root,root) %{_bindir}/passenger
137 %attr(755,root,root) %{_bindir}/passenger-config
138 %attr(755,root,root) %{_bindir}/passenger-memory-stats
139 %attr(755,root,root) %{_bindir}/passenger-status
140 %{_mandir}/man1/passenger-config.1*
141 %{_mandir}/man1/passenger-stress-test.1*
142 %{_mandir}/man8/passenger-memory-stats.8*
143 %{_mandir}/man8/passenger-status.8*
144
145 %attr(755,root,root) %{ruby_vendorarchdir}/passenger_native_support.so
146 %{ruby_vendorlibdir}/phusion_passenger.rb
147 %{ruby_vendorlibdir}/phusion_passenger
148
149 %dir %{_libdir}/phusion-passenger
150 %dir %{_libdir}/phusion-passenger/agents
151 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerLoggingAgent
152 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerWatchdog
153 %dir %{_libdir}/phusion-passenger/agents/apache2
154 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/apache2/Passenger*
155 %dir %{_datadir}/phusion-passenger
156 %dir %{_datadir}/phusion-passenger/helper-scripts
157 %attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/*
158
159 %files ri
160 %defattr(644,root,root,755)
161 %{ruby_ridir}/PhusionPassenger
This page took 0.063203 seconds and 3 git commands to generate.