26b66fb6381686687f03447d0a3f69f9dde803a3
[packages/passenger.git] / apache-mod_rails.spec
1 #
2 # TODO:
3 # - separate -devel with ExtUtils::Embed and friends?
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:        0.4
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 Source1:        %{name}.conf
19 Patch0:         %{name}-nogems.patch
20 Patch1:         %{name}-alias+public.patch
21 Patch2:         passenger_apache_fix_autofoo.patch
22 Patch3:         progs.patch
23 URL:            http://www.modrails.com/
24 BuildRequires:  apache-devel >= 2.0.55-1
25 BuildRequires:  apr-devel >= 1:1.0.0
26 BuildRequires:  apr-util-devel >= 1:1.0.0
27 #BuildRequires: asciidoc
28 BuildRequires:  curl-devel
29 BuildRequires:  libev-devel
30 BuildRequires:  libstdc++-devel
31 BuildRequires:  openssl-devel
32 BuildRequires:  rpm-pythonprov
33 BuildRequires:  rpmbuild(macros) >= 1.559
34 BuildRequires:  ruby-devel
35 BuildRequires:  ruby-rake >= 0.8.0
36 BuildRequires:  ruby-rdoc
37 BuildRequires:  sed >= 4.0
38 BuildRequires:  zlib-devel
39 %requires_ge_to ruby ruby-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 # Don't use bundled libev
75 rm -r ext/libev
76
77 %build
78 USE_VENDORED_LIBEV=false \
79 rake apache2 V=1 \
80         RELEASE=yes \
81         OPTIMIZE=yes \
82         APACHECTL=%{_sbindir}/apachectl \
83         APXS2=%{apxs} \
84         HTTPD=foo \
85         HTTPD_VERSION=$(rpm -q apache-devel --qf '%{V}') \
86         CC="%{__cc}" \
87         CXX="%{__cxx}" \
88         CFLAGS="%{rpmcflags}" \
89         CXXFLAGS="%{rpmcxxflags}"
90
91 rdoc --ri --op ri lib ext/ruby
92 %{__rm} -r ri/{ConditionVariable,Exception,GC,IO,Object,Process,Signal}
93 %{__rm} ri/{cache.ri,created.rid}
94
95 %install
96 rm -rf $RPM_BUILD_ROOT
97 install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir},%{_mandir}/man{1,8}} \
98         $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir},%{ruby_ridir}} \
99         $RPM_BUILD_ROOT%{_bindir} \
100         $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2 \
101         $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
102
103 install -p ext/apache2/mod_passenger.so $RPM_BUILD_ROOT%{_pkglibdir}
104 install -p ext/ruby/ruby-*/passenger_native_support.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}
105 install -p bin/passenger-{config,memory-stats,status} bin/passenger $RPM_BUILD_ROOT%{_bindir}
106 install -p agents/PassengerLoggingAgent agents/PassengerWatchdog $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents
107 install -p agents/apache2/PassengerHelperAgent $RPM_BUILD_ROOT%{_libdir}/phusion-passenger/agents/apache2
108 install -p helper-scripts/* $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts
109 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
110 cp -p man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
111 cp -p man/*.8 $RPM_BUILD_ROOT%{_mandir}/man8
112 cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
113 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/75_mod_rails.conf
114
115 %{__sed} -i -e 's|#!/usr/bin/env ruby|#!%{_bindir}/ruby|' \
116         $RPM_BUILD_ROOT%{_bindir}/passenger \
117         $RPM_BUILD_ROOT%{_bindir}/passenger-* \
118         $RPM_BUILD_ROOT%{_datadir}/phusion-passenger/helper-scripts/*
119
120 %{__sed} -i -e 's|#!/usr/bin/env python|#!%{_bindir}/python|' \
121         $RPM_BUILD_ROOT%{ruby_vendorlibdir}/phusion_passenger/wsgi/request_handler.py
122
123 %clean
124 rm -rf $RPM_BUILD_ROOT
125
126 %post
127 %service -q httpd restart
128
129 %postun
130 if [ "$1" = "0" ]; then
131         %service -q httpd restart
132 fi
133
134 %files
135 %defattr(644,root,root,755)
136 %doc INSTALL README
137 #%doc doc/{A*.txt,Security*.txt,*Apache.txt}
138 #%doc doc/{A*.html,Security*.html,*Apache.html,images}
139 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/*_mod_rails.conf
140 %attr(755,root,root) %{_pkglibdir}/mod_passenger.so
141 %attr(755,root,root) %{_bindir}/passenger
142 %attr(755,root,root) %{_bindir}/passenger-config
143 %attr(755,root,root) %{_bindir}/passenger-memory-stats
144 %attr(755,root,root) %{_bindir}/passenger-status
145 %{_mandir}/man1/passenger-config.1*
146 %{_mandir}/man1/passenger-stress-test.1*
147 %{_mandir}/man8/passenger-memory-stats.8*
148 %{_mandir}/man8/passenger-status.8*
149
150 %attr(755,root,root) %{ruby_vendorarchdir}/passenger_native_support.so
151 %{ruby_vendorlibdir}/phusion_passenger.rb
152 %{ruby_vendorlibdir}/phusion_passenger
153
154 %dir %{_libdir}/phusion-passenger
155 %dir %{_libdir}/phusion-passenger/agents
156 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerLoggingAgent
157 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/PassengerWatchdog
158 %dir %{_libdir}/phusion-passenger/agents/apache2
159 %attr(755,root,root) %{_libdir}/phusion-passenger/agents/apache2/Passenger*
160 %dir %{_datadir}/phusion-passenger
161 %dir %{_datadir}/phusion-passenger/helper-scripts
162 %attr(755,root,root) %{_datadir}/phusion-passenger/helper-scripts/*
163
164 %files ri
165 %defattr(644,root,root,755)
166 %{ruby_ridir}/PhusionPassenger
This page took 0.087635 seconds and 2 git commands to generate.