2 # - /etc/sysconfig/nginx file
3 # - missing perl build/install requires
4 # - prepare pld style like nginx.conf
5 # - split into nginx-common, nginx, nginx-perl packages
7 # Conditional build for nginx:
8 %bcond_without light # don't build light version
9 %bcond_without mail # don't build imap/mail proxy
10 %bcond_without perl # don't build with perl module
11 %bcond_without addition # adds module
12 %bcond_without dav # WebDAV
13 %bcond_without flv # FLV stream
14 %bcond_without poll # poll
15 %bcond_without realip # real ip (behind proxy)
16 %bcond_without rtsig # rtsig
17 %bcond_without select # select
18 %bcond_without status # stats module
19 %bcond_without ssl # ssl support
20 %bcond_with http_browser # header "User-agent" parser
22 Summary: High perfomance HTTP and reverse proxy server
23 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
28 Group: Networking/Daemons
29 Source0: http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
30 # Source0-md5: a78be74b4fd8e009545ef02488fcac86
32 Source2: %{name}-mime.types.sh
33 Source3: http://www.nginx.eu/favicon.ico
34 # Source3-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
35 Source4: http://www.nginx.eu/download/proxy.conf
36 # Source4-md5: f5263ae01c2edb18f46d5d1df2d3a5cd
37 Source5: http://www.nginx.eu/download/%{name}.monitrc
38 # Source5-md5: 1d3f5eedfd34fe95213f9e0fc19daa88
39 Source6: http://www.nginx.eu/download/%{name}.conf
40 # Source6-md5: 1c112d6f03d0f365e4acc98c1d96261a
41 Source7: %{name}.logrotate
42 Patch0: %{name}-config.patch
43 URL: http://nginx.net/
44 BuildRequires: mailcap
45 BuildRequires: openssl-devel
46 BuildRequires: pcre-devel
47 %{?with_perl:BuildRequires: perl-CGI}
48 %{?with_perl:BuildRequires: perl-devel}
49 %{?with_perl:BuildRequires: rpm-perlprov}
50 BuildRequires: rpmbuild(macros) >= 1.268
51 BuildRequires: zlib-devel
52 Requires(post,preun): /sbin/chkconfig
53 Requires(postun): /usr/sbin/groupdel
54 Requires(postun): /usr/sbin/userdel
55 Requires(pre): /bin/id
56 Requires(pre): /usr/bin/getgid
57 Requires(pre): /usr/sbin/groupadd
58 Requires(pre): /usr/sbin/useradd
61 Requires: rc-scripts >= 0.2.0
64 Provides: group(nginx)
67 Conflicts: logrotate < 3.7-4
68 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
70 %define _sysconfdir /etc/%{name}
71 %define _nginxdir /home/services/%{name}
74 Nginx ("engine x") is a high-performance HTTP server and reverse
75 proxy, as well as an IMAP/POP3 proxy server. Nginx was written by Igor
76 Sysoev for Rambler.ru, Russia's second-most visited website, where it
77 has been running in production for over two and a half years. Igor has
78 released the source code under a BSD-like license. Although still in
79 beta, Nginx is known for its stability, rich feature set, simple
80 configuration, and low resource consumption.
82 %description -l pl.UTF-8
83 Nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
84 a także IMAP/POP3 proxy. Nginx został napisany przez Igora Sysoev'a
85 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
86 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
87 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
88 w fazie beta, już zasÅynÄÅ dzieki stabilnoÅi, bogactwu dodatków,
89 prostej konfiguracji oraz maÅej "zasobożernoÅi".
92 Summary: High perfomance HTTP and reverse proxy server
93 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
94 Group: Applications/System
95 Requires: nginx-common
97 Provides: group(nginx)
102 The smallest, but also the fastest nginx edition. No additional
103 modules, no perl support, no imap, pop3, smtp proxy
105 %description light -l pl.UTF-8
106 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla perla,
107 dodatkowych modulow oraz imap, pop3, smtp proxy
110 Summary: High perfomance HTTP and reverse proxy server
111 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
112 Group: Applications/System
113 Requires: nginx-common
114 Requires: perl-mod_%{mod_name} = %{epoch}:%{version}-%{release}
115 Provides: group(http)
116 Provides: group(nginx)
117 Provides: user(nginx)
121 Nginx with perl support. Mail modules not included.
123 %description perl -l pl.UTF-8
124 Nignx z obsluga perla. Bez wsparcia dla modulow poczty.
127 Summary: High perfomance HTTP and reverse proxy server
128 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajno�~[ci
129 Group: Applications/System
130 Requires: nginx-common
131 Provides: group(http)
132 Provides: group(nginx)
133 Provides: user(nginx)
137 Nginx with mail support. Only mail modules included.
139 %description mail -l pl.UTF-8
140 Nignx ze wsparciem tylko dla modulow poczty.
144 Summary: Configuration files and documentation for Nginx
145 Summary(pl.UTF-8): Pliki konfiguracyjne i dokumentacja dla Nginx
146 Group: Networking/Daemons
149 Common files for nginx daemon
151 %description common -l pl.UTF-8
152 Niezbedne pliki dla nginx
153 %package -n monit-rc-nginx
154 Summary: Nginx support for monit
155 Summary(pl.UTF-8): Wsparcie nginx dla monit
156 Group: Applications/System
157 Requires: %{name} = %{version}-%{release}
160 %description -n monit-rc-nginx
161 monitrc file for monitoring nginx webserver server.
163 %description -n monit-rc-nginx -l pl.UTF-8
164 Plik monitrc do monitorowania serwera www nginx.
171 # build mime.types.conf
172 sh %{SOURCE2} /etc/mime.types
175 # NB: not autoconf generated configure
176 cp -f configure auto/
180 --prefix=%{_prefix} \
181 --sbin-path=%{_sbindir}/%{name} \
182 --conf-path=%{_sysconfdir}/%{name}.conf \
183 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
184 --pid-path=%{_localstatedir}/run/%{name}.pid \
185 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
189 --with-http_perl_module \
190 --without-mail_pop3_module \
191 --without-mail_imap_module \
192 --without-mail_smtp_module \
193 %{?with_addition:--with-http_addition_module} \
194 %{?with_dav:--with-http_dav_module} \
195 %{?with_flv:--with-http_flv_module} \
196 %{?with_poll:--with-poll_module} \
197 %{?with_realip:--with-http_realip_module} \
198 %{?with_rtsig:--with-rtsig_module} \
199 %{?with_select:--with-select_module} \
200 %{?with_status:--with-http_stub_status_module} \
201 %{?with_ssl:--with-http_ssl_module} \
202 %{!?with_http_browser:--without-http_browser_module} \
203 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
204 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
205 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
206 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
207 --with-cc="%{__cc}" \
208 --with-cc-opt="%{rpmcflags}" \
209 --with-ld-opt="%{rpmldflags}"
211 mv -f objs/nginx contrib/nginx.perl
217 --prefix=%{_prefix} \
218 --sbin-path=%{_sbindir}/%{name} \
219 --conf-path=%{_sysconfdir}/%{name}.conf \
220 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
221 --pid-path=%{_localstatedir}/run/%{name}.pid \
222 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
227 --with-mail_ssl_module \
228 %{?with_addition:--with-http_addition_module} \
229 %{?with_poll:--with-poll_module} \
230 %{?with_realip:--with-http_realip_module} \
231 %{?with_rtsig:--with-rtsig_module} \
232 %{?with_select:--with-select_module} \
233 %{!?with_http_browser:--without-http_browser_module} \
234 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
235 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
236 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
237 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
238 --with-cc="%{__cc}" \
239 --with-cc-opt="%{rpmcflags}" \
240 --with-ld-opt="%{rpmldflags}" \
241 %{?debug:--with-debug}
243 mv -f objs/nginx contrib/nginx.mail
249 --prefix=%{_prefix} \
250 --sbin-path=%{_sbindir}/%{name} \
251 --conf-path=%{_sysconfdir}/%{name}.conf \
252 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
253 --pid-path=%{_localstatedir}/run/%{name}.pid \
254 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
257 %{?with_poll:--with-poll_module} \
258 %{?with_realip:--with-http_realip_module} \
259 %{?with_rtsig:--with-rtsig_module} \
260 %{?with_select:--with-select_module} \
261 %{?with_status:--with-http_stub_status_module} \
262 %{?with_ssl:--with-http_ssl_module} \
263 --without-http_browser_module \
264 --without-mail_pop3_module \
265 --without-mail_imap_module \
266 --without-mail_smtp_module \
267 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
268 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
269 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
270 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
271 --with-cc="%{__cc}" \
272 --with-cc-opt="%{rpmcflags}" \
273 --with-ld-opt="%{rpmldflags}" \
274 %{?debug:--with-debug}
276 mv -f objs/nginx contrib/nginx.light
281 --prefix=%{_prefix} \
282 --sbin-path=%{_sbindir}/%{name} \
283 --conf-path=%{_sysconfdir}/%{name}.conf \
284 --error-log-path=%{_localstatedir}/log/%{name}/error.log \
285 --pid-path=%{_localstatedir}/run/%{name}.pid \
286 --lock-path=%{_localstatedir}/lock/subsys/%{name} \
289 %{?with_addition:--with-http_addition_module} \
290 %{?with_dav:--with-http_dav_module} \
291 %{?with_flv:--with-http_flv_module} \
292 %{?with_imap:--with-imap} \
293 %{?with_mail:--with-mail} \
294 %{?with_mail:--with-mail_ssl_module} \
295 %{?with_perl:--with-http_perl_module} \
296 %{?with_poll:--with-poll_module} \
297 %{?with_realip:--with-http_realip_module} \
298 %{?with_rtsig:--with-rtsig_module} \
299 %{?with_select:--with-select_module} \
300 %{?with_status:--with-http_stub_status_module} \
301 %{?with_ssl:--with-http_ssl_module} \
302 %{!?with_http_browser:--without-http_browser_module} \
303 --http-log-path=%{_localstatedir}/log/%{name}/access.log \
304 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}/client_body_temp \
305 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}/proxy_temp \
306 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}/fastcgi_temp \
307 --with-cc="%{__cc}" \
308 --with-cc-opt="%{rpmcflags}" \
309 --with-ld-opt="%{rpmldflags}" \
310 %{?debug:--with-debug}
315 rm -rf $RPM_BUILD_ROOT
316 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
317 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
318 $RPM_BUILD_ROOT{%{_localstatedir}/log/{%{name},archive/%{name}},%{_localstatedir}/cache/%{name}} \
319 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/%{name} \
320 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
321 $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}} \
322 $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
324 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
325 install mime.types $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
326 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
327 install %{SOURCE3} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
328 install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
329 install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
330 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
331 install %{SOURCE5} $RPM_BUILD_ROOT/etc/monit/%{name}.monitrc
332 install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/nginx.conf
333 install %{SOURCE7} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
334 install objs/src/http/modules/perl/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
335 install objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
336 install objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
337 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}
339 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
340 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
343 rm -rf $RPM_BUILD_ROOT
346 %groupadd -r -g 213 %{name}
348 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
349 %addusertogroup %{name} http
352 for a in access.log error.log; do
353 if [ ! -f /var/log/%{name}/$a ]; then
354 touch /var/log/%{name}/$a
355 chown nginx:nginx /var/log/%{name}/$a
356 chmod 644 /var/log/%{name}/$a
359 /sbin/chkconfig --add %{name}
360 %service %{name} restart
363 if [ "$1" = "0" ]; then
364 %service -q %{name} stop
365 /sbin/chkconfig --del %{name}
369 if [ "$1" = "0" ]; then
375 %defattr(644,root,root,755)
376 %doc CHANGES LICENSE README html/index.html conf/nginx.conf objs/src/http/modules/perl/blib/man3/nginx.3pm
377 %doc %lang(ru) CHANGES.ru
378 %attr(754,root,root) /etc/rc.d/init.d/%{name}
379 %dir %attr(754,root,root) %{_sysconfdir}
381 %dir %{_nginxdir}/cgi-bin
382 %dir %{_nginxdir}/html
383 %dir %{_nginxdir}/errors
384 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
385 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
386 %attr(640,root,root) %{_sysconfdir}/*[_-]*
387 %attr(640,root,root) %{_sysconfdir}/proxy.conf
388 %attr(640,root,root) %{_sysconfdir}/mime.types
389 %attr(755,root,root) %{_sbindir}/%{name}
390 %dir %{perl_vendorarch}/auto/%{name}
391 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
392 %attr(700,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.bs
393 %attr(700,root,root) %{perl_vendorarch}/%{name}.pm
394 %attr(770,root,%{name}) /var/cache/%{name}
395 %attr(750,root,root) %dir /var/log/archive/%{name}
396 %attr(750,%{name},logs) /var/log/%{name}
397 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
398 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
400 %files -n monit-rc-nginx
401 %defattr(644,root,root,755)
402 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}.monitrc