2 # - /etc/sysconfig/nginx file
3 # - missing perl build/install requires
4 # - mod_spdy build http://mailman.nginx.org/pipermail/nginx-devel/2012-June/002343.html patch from http://nginx.org/patches/attic/spdy/
5 # http://nginx.org/en/docs/http/ngx_http_spdy_module.html
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 ipv6 # build without ipv6 support
15 %bcond_without sub # ngx_http_sub_module
16 %bcond_without poll # poll
17 %bcond_without realip # real ip (behind proxy)
18 %bcond_without rtsig # rtsig
19 %bcond_without select # select
20 %bcond_without status # stats module
21 %bcond_without ssl # ssl support
22 %bcond_with http_browser # header "User-agent" parser
23 %bcond_with rtmp # rtmp support
24 %bcond_without auth_request # auth_request module
26 %define rtmp_version 1.1.5
27 Summary: High perfomance HTTP and reverse proxy server
28 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
30 # - stable: production quality with stable API
31 # - mainline: production quality but API can change
36 Group: Networking/Daemons/HTTP
37 Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
38 # Source0-md5: a4debbe0ce0dd12b9c8f520bc3b66355
39 Source1: http://nginx.net/favicon.ico
40 # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
42 Source3: %{name}.logrotate
44 Source5: %{name}-light.conf
45 Source6: %{name}-light.monitrc
46 Source7: %{name}-light.init
47 Source8: %{name}-mail.conf
48 Source9: %{name}-mail.monitrc
49 Source10: %{name}-mail.init
50 Source11: %{name}-perl.conf
51 Source12: %{name}-perl.monitrc
52 Source13: %{name}-perl.init
53 Source14: %{name}-standard.conf
54 Source15: %{name}-standard.monitrc
55 Source16: %{name}-standard.init
56 Source17: %{name}-mime.types.sh
57 Source18: %{name}-standard.service
58 Source19: %{name}-light.service
59 Source20: %{name}-perl.service
60 Source21: %{name}-mail.service
61 # when updating rtmp version, use this url:
62 #Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
63 Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}.tar.gz
64 # Source101-md5: a85f8201c01b7c229b01a5e0fc87b374
65 Patch0: %{name}-no-Werror.patch
66 Patch1: nginx-rtmp-module-build.patch
67 URL: http://nginx.net/
68 BuildRequires: mailcap
69 BuildRequires: openssl-devel
70 BuildRequires: pcre-devel
71 %{?with_perl:BuildRequires: perl-CGI}
72 %{?with_perl:BuildRequires: perl-devel}
73 %{?with_perl:BuildRequires: python}
74 %{?with_perl:BuildRequires: rpm-perlprov}
75 BuildRequires: rpmbuild(macros) >= 1.644
76 BuildRequires: zlib-devel
77 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
79 %define _sysconfdir /etc/%{name}
80 %define _nginxdir /home/services/%{name}
83 nginx ("engine x") is a high-performance HTTP server and reverse
84 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
85 Sysoev for Rambler.ru, Russia's second-most visited website, where it
86 has been running in production for over two and a half years. Igor has
87 released the source code under a BSD-like license. Although still in
88 beta, nginx is known for its stability, rich feature set, simple
89 configuration, and low resource consumption.
91 %description -l pl.UTF-8
92 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
93 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
94 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
95 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
96 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
97 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
98 prostej konfiguracji oraz małej "zasobożerności".
101 Summary: nginx - common files
102 Summary(pl.UTF-8): nginx - pliki wspólne
103 Group: Networking/Daemons/HTTP
104 Requires(postun): /usr/sbin/groupdel
105 Requires(postun): /usr/sbin/userdel
106 Requires(pre): /bin/id
107 Requires(pre): /usr/bin/getgid
108 Requires(pre): /usr/sbin/groupadd
109 Requires(pre): /usr/sbin/useradd
112 Requires: rc-scripts >= 0.2.0
113 Requires: systemd-units >= 38
115 Provides: group(http)
116 Provides: group(nginx)
117 Provides: user(nginx)
119 Obsoletes: nginx < 1.4.1-4.1
120 Conflicts: logrotate < 3.8.0
123 Common files for the nginx daemon.
125 %description common -l pl.UTF-8
126 Niezbędne pliki dla nginx.
129 Summary: High perfomance HTTP and reverse proxy server
130 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
131 Group: Networking/Daemons/HTTP
132 Requires(post,preun): /sbin/chkconfig
133 Requires(post,preun,postun): systemd-units >= 38
134 Requires: %{name}-common = %{version}-%{release}
138 Provides: nginx-daemon
142 nginx ("engine x") is a high-performance HTTP server and reverse
143 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
144 Sysoev for Rambler.ru, Russia's second-most visited website, where it
145 has been running in production for over two and a half years. Igor has
146 released the source code under a BSD-like license. Although still in
147 beta, nginx is known for its stability, rich feature set, simple
148 configuration, and low resource consumption.
150 The smallest, but also the fastest nginx edition. No additional
151 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
153 %description light -l pl.UTF-8
154 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
155 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
156 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
157 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
158 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
159 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
160 prostej konfiguracji oraz małej "zasobożerności".
162 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
163 FLV oraz IMAP, POP3, SMTP proxy.
166 Summary: High perfomance HTTP and reverse proxy server
167 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
168 Group: Networking/Daemons/HTTP
169 Requires(post,preun): /sbin/chkconfig
170 Requires(post,preun,postun): systemd-units >= 38
171 Requires: %{name}-common = %{version}-%{release}
173 Provides: nginx-daemon
177 nginx ("engine x") is a high-performance HTTP server and reverse
178 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
179 Sysoev for Rambler.ru, Russia's second-most visited website, where it
180 has been running in production for over two and a half years. Igor has
181 released the source code under a BSD-like license. Although still in
182 beta, nginx is known for its stability, rich feature set, simple
183 configuration, and low resource consumption.
185 nginx with Perl support. Mail modules not included.
187 %description perl -l pl.UTF-8
188 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
189 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
190 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
191 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
192 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
193 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
194 prostej konfiguracji oraz małej "zasobożerności".
196 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
199 Summary: High perfomance IMAP, POP3, SMTP proxy server
200 Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
201 Group: Networking/Daemons/HTTP
202 Requires(post,preun): /sbin/chkconfig
203 Requires(post,preun,postun): systemd-units >= 38
204 Requires: %{name}-common = %{version}-%{release}
208 Provides: nginx-daemon
211 nginx ("engine x") is a high-performance HTTP server and reverse
212 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
213 Sysoev for Rambler.ru, Russia's second-most visited website, where it
214 has been running in production for over two and a half years. Igor has
215 released the source code under a BSD-like license. Although still in
216 beta, nginx is known for its stability, rich feature set, simple
217 configuration, and low resource consumption.
219 nginx with mail support. Only mail modules included.
221 %description mail -l pl.UTF-8
222 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
223 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
224 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
225 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
226 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
227 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
228 prostej konfiguracji oraz małej "zasobożerności".
230 nginx ze wsparciem tylko dla modułów poczty.
233 Summary: High perfomance HTTP and reverse proxy server
234 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
235 Group: Networking/Daemons/HTTP
236 Requires(post,preun): /sbin/chkconfig
237 Requires(post,preun,postun): systemd-units >= 38
238 Requires: %{name}-common = %{version}-%{release}
241 Provides: nginx-daemon
242 Conflicts: logrotate < 3.7-4
244 %description standard
245 nginx ("engine x") is a high-performance HTTP server and reverse
246 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
247 Sysoev for Rambler.ru, Russia's second-most visited website, where it
248 has been running in production for over two and a half years. Igor has
249 released the source code under a BSD-like license. Although still in
250 beta, nginx is known for its stability, rich feature set, simple
251 configuration, and low resource consumption.
253 This is standard nginx version, without Perl support and IMAP, POP3,
256 %description standard -l pl.UTF-8
257 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
258 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
259 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
260 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
261 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
262 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
263 prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x")
264 jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3
265 proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu
266 Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji
267 i działa od ponad dwóch i pół roku. Igor opublikował źródła na
268 licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął
269 dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej
272 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
275 %package -n monit-rc-nginx
276 Summary: nginx support for monit
277 Summary(pl.UTF-8): Wsparcie nginx dla monit
278 Group: Applications/System
279 URL: http://nginx.eu/
280 Requires: %{name}-common = %{version}-%{release}
283 %description -n monit-rc-nginx
284 monitrc file for monitoring nginx webserver.
286 %description -n monit-rc-nginx -l pl.UTF-8
287 Plik monitrc do monitorowania serwera WWW nginx.
290 %setup -q %{?with_rtmp:-a101}
294 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
300 # build mime.types.conf
301 #sh %{SOURCE17} /etc/mime.types
304 # NB: not autoconf generated configure
305 cp -f configure auto/
309 --prefix=%{_prefix} \
310 --sbin-path=%{_sbindir}/%{name}-perl \
311 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
312 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
313 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
314 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
315 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
318 --with-http_perl_module \
319 --without-mail_pop3_module \
320 --without-mail_imap_module \
321 --without-mail_smtp_module \
322 %{?with_addition:--with-http_addition_module} \
323 %{?with_dav:--with-http_dav_module} \
324 %{?with_flv:--with-http_flv_module} \
325 %{?with_ipv6:--with-ipv6} \
326 %{?with_sub:--with-http_sub_module} \
327 %{?with_poll:--with-poll_module} \
328 %{?with_realip:--with-http_realip_module} \
329 %{?with_rtsig:--with-rtsig_module} \
330 %{?with_select:--with-select_module} \
331 %{?with_status:--with-http_stub_status_module} \
332 %{?with_ssl:--with-http_ssl_module} \
333 %{!?with_http_browser:--without-http_browser_module} \
334 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
335 %{?with_auth_request:--with-http_auth_request_module} \
336 --with-http_secure_link_module \
337 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
338 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
339 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
340 --with-cc="%{__cc}" \
341 --with-cc-opt="%{rpmcflags}" \
342 --with-ld-opt="%{rpmldflags}"
344 mv -f objs/nginx contrib/nginx-perl
345 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
346 mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
351 --prefix=%{_prefix} \
352 --sbin-path=%{_sbindir}/%{name}-mail \
353 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
354 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
355 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
356 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
357 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
362 --with-mail_ssl_module \
364 %{?with_ipv6:--with-ipv6} \
365 %{?with_poll:--with-poll_module} \
366 %{?with_rtsig:--with-rtsig_module} \
367 %{?with_select:--with-select_module} \
368 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
369 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
370 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
371 --with-cc="%{__cc}" \
372 --with-cc-opt="%{rpmcflags}" \
373 --with-ld-opt="%{rpmldflags}" \
374 %{?debug:--with-debug}
376 mv -f objs/nginx contrib/nginx-mail
381 --prefix=%{_prefix} \
382 --sbin-path=%{_sbindir}/%{name}-light \
383 --conf-path=%{_sysconfdir}/%{name}-light.conf \
384 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
385 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
386 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
387 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
390 %{?with_ipv6:--with-ipv6} \
391 %{?with_poll:--with-poll_module} \
392 %{?with_realip:--with-http_realip_module} \
393 %{?with_rtsig:--with-rtsig_module} \
394 %{?with_select:--with-select_module} \
395 %{?with_status:--with-http_stub_status_module} \
396 %{?with_ssl:--with-http_ssl_module} \
397 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
398 %{?with_auth_request:--with-http_auth_request_module} \
399 --without-http_browser_module \
400 --without-mail_pop3_module \
401 --without-mail_imap_module \
402 --without-mail_smtp_module \
403 --with-http_secure_link_module \
404 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
405 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
406 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
407 --with-cc="%{__cc}" \
408 --with-cc-opt="%{rpmcflags}" \
409 --with-ld-opt="%{rpmldflags}" \
410 %{?debug:--with-debug}
412 mv -f objs/nginx contrib/nginx-light
416 --prefix=%{_prefix} \
417 --sbin-path=%{_sbindir}/%{name}-standard \
418 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
419 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
420 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
421 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
422 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
425 %{?with_addition:--with-http_addition_module} \
426 %{?with_dav:--with-http_dav_module} \
427 %{?with_flv:--with-http_flv_module} \
428 %{?with_ipv6:--with-ipv6} \
429 %{?with_sub:--with-http_sub_module} \
430 %{?with_poll:--with-poll_module} \
431 %{?with_realip:--with-http_realip_module} \
432 %{?with_rtsig:--with-rtsig_module} \
433 %{?with_select:--with-select_module} \
434 %{?with_status:--with-http_stub_status_module} \
435 %{?with_ssl:--with-http_ssl_module} \
436 %{!?with_http_browser:--without-http_browser_module} \
437 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
438 %{?with_auth_request:--with-http_auth_request_module} \
439 --with-http_secure_link_module \
440 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
441 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
442 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
443 --with-cc="%{__cc}" \
444 --with-cc-opt="%{rpmcflags}" \
445 --with-ld-opt="%{rpmldflags}" \
446 %{?debug:--with-debug}
451 rm -rf $RPM_BUILD_ROOT
452 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
453 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
454 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
455 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
456 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
457 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
458 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
459 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
461 cp -p conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
462 cp -p conf/scgi_params $RPM_BUILD_ROOT%{_sysconfdir}/scgi.params
463 cp -p conf/uwsgi_params $RPM_BUILD_ROOT%{_sysconfdir}/uwsgi.params
464 cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
465 cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
466 cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
467 cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
468 cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
469 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
470 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
471 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
472 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
473 cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
474 cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
475 install -p %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
476 cp -p %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
477 install -p objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
478 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
481 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
482 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
483 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
484 cp -p %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
485 install -p contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
489 cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
490 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
491 install -p contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
492 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
493 cp -p %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
497 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
498 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
499 cp -p %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
500 install -p %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
501 cp -p %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
502 cp -p contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
503 install -p contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
504 install -p contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
507 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
508 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
511 rm -rf $RPM_BUILD_ROOT
514 %groupadd -r -g 213 %{name}
516 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
517 %addusertogroup %{name} http
520 for a in access.log error.log; do
521 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
523 touch /var/log/%{name}/nginx-standard_$a
524 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
525 chmod 644 /var/log/%{name}/nginx-standard_$a
528 /sbin/chkconfig --add %{name}-standard
529 %systemd_post %{name}-standard.service
530 %service %{name}-standard restart
531 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
532 if ! [ -L /etc/systemd/system/nginx.service ] ; then
533 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
537 for a in access.log error.log; do
538 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
540 touch /var/log/%{name}/nginx-light_$a
541 chown nginx:nginx /var/log/%{name}/nginx-light_$a
542 chmod 644 /var/log/%{name}/nginx-light_$a
545 /sbin/chkconfig --add %{name}-light
546 %systemd_post %{name}-light.service
547 %service %{name}-light restart
548 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
551 for a in access.log error.log; do
552 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
554 touch /var/log/%{name}/nginx-perl_$a
555 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
556 chmod 644 /var/log/%{name}/nginx-perl_$a
559 /sbin/chkconfig --add %{name}-perl
560 %systemd_post %{name}-perl.service
561 %service %{name}-perl restart
562 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
565 for a in access.log error.log; do
566 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
568 touch /var/log/%{name}/nginx-mail_$a
569 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
570 chmod 644 /var/log/%{name}/nginx-mail_$a
573 /sbin/chkconfig --add %{name}-mail
574 %systemd_post %{name}-mail.service
575 %service %{name}-mail restart
576 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
579 if [ "$1" = "0" ];then
580 %service %{name}-standard stop
581 /sbin/chkconfig --del %{name}-standard
583 %systemd_preun %{name}-standard.service
586 if [ "$1" = "0" ]; then
587 %service %{name}-light stop
588 /sbin/chkconfig --del %{name}-light
590 %systemd_preun %{name}-light.service
593 if [ "$1" = "0" ]; then
594 %service %{name}-perl stop
595 /sbin/chkconfig --del %{name}-perl
597 %systemd_preun %{name}-perl.service
600 if [ "$1" = "0" ]; then
601 %service %{name}-mail stop
602 /sbin/chkconfig --del %{name}-mail
604 %systemd_preun %{name}-mail.service
607 if [ "$1" = "0" ]; then
624 %triggerpostun -- %{name}-standard < 1.4.1-4
625 %systemd_trigger %{name}-standard.service
627 %triggerpostun -- %{name}-light < 1.4.1-4
628 %systemd_trigger %{name}-light.service
630 %triggerpostun -- %{name}-perl < 1.4.1-4
631 %systemd_trigger %{name}-perl.service
633 %triggerpostun -- %{name}-mail < 1.4.1-4
634 %systemd_trigger %{name}-mail.service
637 %defattr(644,root,root,755)
638 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
639 %doc %lang(ru) CHANGES.ru
640 %dir %attr(754,root,root) %{_sysconfdir}
642 %dir %{_nginxdir}/cgi-bin
643 %dir %{_nginxdir}/html
644 %dir %{_nginxdir}/errors
645 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
646 # XXX: duplicates, don't use such glob here
647 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
648 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
649 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
650 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi.params
651 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi.params
652 %attr(640,root,root) %{_sysconfdir}/mime.types
653 %attr(640,root,root) %{_sysconfdir}/koi-utf
654 %attr(640,root,root) %{_sysconfdir}/koi-win
655 %attr(640,root,root) %{_sysconfdir}/win-utf
656 %dir %{_sysconfdir}/webapps.d
657 %dir %{_sysconfdir}/vhosts.d
658 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
659 %attr(750,nginx,logs) /var/log/%{name}
660 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
661 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
662 %ghost /etc/systemd/system/nginx.service
665 %defattr(644,root,root,755)
666 %attr(755,root,root) %{_sbindir}/%{name}-standard
667 %attr(770,root,%{name}) /var/cache/%{name}-standard
668 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
669 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
670 %{systemdunitdir}/%{name}-standard.service
674 %defattr(644,root,root,755)
675 %attr(755,root,root) %{_sbindir}/%{name}-mail
676 %attr(770,root,%{name}) /var/cache/%{name}-mail
677 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
678 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
679 %{systemdunitdir}/%{name}-mail.service
684 %defattr(644,root,root,755)
685 %attr(755,root,root) %{_sbindir}/%{name}-light
686 %attr(770,root,%{name}) /var/cache/%{name}-light
687 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
688 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
689 %{systemdunitdir}/%{name}-light.service
694 %defattr(644,root,root,755)
695 %attr(755,root,root) %{_sbindir}/%{name}-perl
696 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
697 %attr(770,root,%{name}) /var/cache/%{name}-perl
698 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
699 %dir %{perl_vendorarch}/auto/%{name}
700 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
701 %{perl_vendorarch}/%{name}.pm
702 %{systemdunitdir}/%{name}-perl.service
705 %files -n monit-rc-nginx
706 %defattr(644,root,root,755)
707 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
709 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
712 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
715 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc