2 # - /etc/sysconfig/nginx file
3 # - missing perl build/install requires
5 # Conditional build for nginx:
6 %bcond_without light # don't build light version
7 %bcond_without mail # don't build imap/mail proxy
8 %bcond_without perl # don't build with perl module
9 %bcond_without addition # adds module
10 %bcond_without dav # WebDAV
11 %bcond_without flv # FLV stream
12 %bcond_without ipv6 # build without ipv6 support
13 %bcond_without sub # ngx_http_sub_module
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 spdy # spdy module
19 %bcond_without status # stats module
20 %bcond_without ssl # ssl support
21 %bcond_with http_browser # header "User-agent" parser
22 %bcond_with rtmp # rtmp support
23 %bcond_with threads # thread pool support
24 %bcond_without auth_request # auth_request module
30 %define rtmp_version 1.1.7
31 Summary: High perfomance HTTP and reverse proxy server
32 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
34 # - stable: production quality with stable API
35 # - mainline: production quality but API can change
40 Group: Networking/Daemons/HTTP
41 Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
42 # Source0-md5: 9120b06539e7acb25712a9c5e4711d22
43 Source1: http://nginx.net/favicon.ico
44 # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
46 Source3: %{name}.logrotate
48 Source5: %{name}-light.conf
49 Source6: %{name}-light.monitrc
50 Source7: %{name}-light.init
51 Source8: %{name}-mail.conf
52 Source9: %{name}-mail.monitrc
53 Source10: %{name}-mail.init
54 Source11: %{name}-perl.conf
55 Source12: %{name}-perl.monitrc
56 Source13: %{name}-perl.init
57 Source14: %{name}-standard.conf
58 Source15: %{name}-standard.monitrc
59 Source16: %{name}-standard.init
60 Source17: %{name}-mime.types.sh
61 Source18: %{name}-standard.service
62 Source19: %{name}-light.service
63 Source20: %{name}-perl.service
64 Source21: %{name}-mail.service
65 Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
66 # Source101-md5: 8006de2560db3e55bb15d110220076ac
67 Patch0: %{name}-no-Werror.patch
68 URL: http://nginx.net/
69 BuildRequires: mailcap
70 BuildRequires: openssl-devel
71 BuildRequires: pcre-devel
72 %{?with_perl:BuildRequires: perl-CGI}
73 %{?with_perl:BuildRequires: perl-devel}
74 %{?with_perl:BuildRequires: python}
75 %{?with_perl:BuildRequires: rpm-perlprov}
76 BuildRequires: rpmbuild(macros) >= 1.644
77 BuildRequires: zlib-devel
78 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
80 %define _sysconfdir /etc/%{name}
81 %define _nginxdir /home/services/%{name}
84 nginx ("engine x") is a high-performance HTTP server and reverse
85 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
86 Sysoev for Rambler.ru, Russia's second-most visited website, where it
87 has been running in production for over two and a half years. Igor has
88 released the source code under a BSD-like license. Although still in
89 beta, nginx is known for its stability, rich feature set, simple
90 configuration, and low resource consumption.
92 %description -l pl.UTF-8
93 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
94 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
95 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
96 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
97 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
98 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
99 prostej konfiguracji oraz małej "zasobożerności".
102 Summary: nginx - common files
103 Summary(pl.UTF-8): nginx - pliki wspólne
104 Group: Networking/Daemons/HTTP
105 Requires(postun): /usr/sbin/groupdel
106 Requires(postun): /usr/sbin/userdel
107 Requires(pre): /bin/id
108 Requires(pre): /usr/bin/getgid
109 Requires(pre): /usr/sbin/groupadd
110 Requires(pre): /usr/sbin/useradd
113 Requires: rc-scripts >= 0.2.0
114 Requires: systemd-units >= 38
116 Provides: group(http)
117 Provides: group(nginx)
118 Provides: user(nginx)
120 Obsoletes: nginx < 1.4.1-4.1
121 Conflicts: logrotate < 3.8.0
124 Common files for the nginx daemon.
126 %description common -l pl.UTF-8
127 Niezbędne pliki dla nginx.
130 Summary: High perfomance HTTP and reverse proxy server
131 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
132 Group: Networking/Daemons/HTTP
133 Requires(post,preun): /sbin/chkconfig
134 Requires(post,preun,postun): systemd-units >= 38
135 Requires: %{name}-common = %{version}-%{release}
139 Provides: nginx-daemon
143 nginx ("engine x") is a high-performance HTTP server and reverse
144 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
145 Sysoev for Rambler.ru, Russia's second-most visited website, where it
146 has been running in production for over two and a half years. Igor has
147 released the source code under a BSD-like license. Although still in
148 beta, nginx is known for its stability, rich feature set, simple
149 configuration, and low resource consumption.
151 The smallest, but also the fastest nginx edition. No additional
152 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
154 %description light -l pl.UTF-8
155 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
156 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
157 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
158 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
159 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
160 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
161 prostej konfiguracji oraz małej "zasobożerności".
163 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
164 FLV oraz IMAP, POP3, SMTP proxy.
167 Summary: High perfomance HTTP and reverse proxy server
168 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
169 Group: Networking/Daemons/HTTP
170 Requires(post,preun): /sbin/chkconfig
171 Requires(post,preun,postun): systemd-units >= 38
172 Requires: %{name}-common = %{version}-%{release}
174 Provides: nginx-daemon
178 nginx ("engine x") is a high-performance HTTP server and reverse
179 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
180 Sysoev for Rambler.ru, Russia's second-most visited website, where it
181 has been running in production for over two and a half years. Igor has
182 released the source code under a BSD-like license. Although still in
183 beta, nginx is known for its stability, rich feature set, simple
184 configuration, and low resource consumption.
186 nginx with Perl support. Mail modules not included.
188 %description perl -l pl.UTF-8
189 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
190 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
191 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
192 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
193 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
194 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
195 prostej konfiguracji oraz małej "zasobożerności".
197 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
200 Summary: High perfomance IMAP, POP3, SMTP proxy server
201 Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
202 Group: Networking/Daemons/HTTP
203 Requires(post,preun): /sbin/chkconfig
204 Requires(post,preun,postun): systemd-units >= 38
205 Requires: %{name}-common = %{version}-%{release}
209 Provides: nginx-daemon
212 nginx ("engine x") is a high-performance HTTP server and reverse
213 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
214 Sysoev for Rambler.ru, Russia's second-most visited website, where it
215 has been running in production for over two and a half years. Igor has
216 released the source code under a BSD-like license. Although still in
217 beta, nginx is known for its stability, rich feature set, simple
218 configuration, and low resource consumption.
220 nginx with mail support. Only mail modules included.
222 %description mail -l pl.UTF-8
223 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
224 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
225 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
226 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
227 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
228 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
229 prostej konfiguracji oraz małej "zasobożerności".
231 nginx ze wsparciem tylko dla modułów poczty.
234 Summary: High perfomance HTTP and reverse proxy server
235 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
236 Group: Networking/Daemons/HTTP
237 Requires(post,preun): /sbin/chkconfig
238 Requires(post,preun,postun): systemd-units >= 38
239 Requires: %{name}-common = %{version}-%{release}
242 Provides: nginx-daemon
243 Conflicts: logrotate < 3.7-4
245 %description standard
246 nginx ("engine x") is a high-performance HTTP server and reverse
247 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
248 Sysoev for Rambler.ru, Russia's second-most visited website, where it
249 has been running in production for over two and a half years. Igor has
250 released the source code under a BSD-like license. Although still in
251 beta, nginx is known for its stability, rich feature set, simple
252 configuration, and low resource consumption.
254 This is standard nginx version, without Perl support and IMAP, POP3,
257 %description standard -l pl.UTF-8
258 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
259 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
260 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
261 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
262 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
263 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
264 prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x")
265 jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3
266 proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu
267 Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji
268 i działa od ponad dwóch i pół roku. Igor opublikował źródła na
269 licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął
270 dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej
273 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
276 %package -n monit-rc-nginx
277 Summary: nginx support for monit
278 Summary(pl.UTF-8): Wsparcie nginx dla monit
279 Group: Applications/System
280 URL: http://nginx.eu/
281 Requires: %{name}-common = %{version}-%{release}
284 %description -n monit-rc-nginx
285 monitrc file for monitoring nginx webserver.
287 %description -n monit-rc-nginx -l pl.UTF-8
288 Plik monitrc do monitorowania serwera WWW nginx.
291 %setup -q %{?with_rtmp:-a101}
295 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
298 # build mime.types.conf
299 #sh %{SOURCE17} /etc/mime.types
302 # NB: not autoconf generated configure
303 cp -f configure auto/
307 --prefix=%{_prefix} \
308 --sbin-path=%{_sbindir}/%{name}-perl \
309 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
310 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
311 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
312 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
313 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
316 --with-http_perl_module \
317 --without-mail_pop3_module \
318 --without-mail_imap_module \
319 --without-mail_smtp_module \
320 %{?with_addition:--with-http_addition_module} \
321 %{?with_dav:--with-http_dav_module} \
322 %{?with_flv:--with-http_flv_module} \
323 %{?with_ipv6:--with-ipv6} \
324 %{?with_sub:--with-http_sub_module} \
325 %{?with_poll:--with-poll_module} \
326 %{?with_realip:--with-http_realip_module} \
327 %{?with_rtsig:--with-rtsig_module} \
328 %{?with_select:--with-select_module} \
329 %{?with_status:--with-http_stub_status_module} \
330 %{?with_ssl:--with-http_ssl_module} \
331 %{!?with_http_browser:--without-http_browser_module} \
332 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
333 %{?with_auth_request:--with-http_auth_request_module} \
334 %{?with_threads:--with-threads} \
335 %{?with_spdy:--with-http_spdy_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 %{?with_threads:--with-threads} \
400 %{?with_spdy:--with-http_spdy_module} \
401 --without-http_browser_module \
402 --without-mail_pop3_module \
403 --without-mail_imap_module \
404 --without-mail_smtp_module \
405 --with-http_secure_link_module \
406 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
407 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
408 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
409 --with-cc="%{__cc}" \
410 --with-cc-opt="%{rpmcflags}" \
411 --with-ld-opt="%{rpmldflags}" \
412 %{?debug:--with-debug}
414 mv -f objs/nginx contrib/nginx-light
418 --prefix=%{_prefix} \
419 --sbin-path=%{_sbindir}/%{name}-standard \
420 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
421 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
422 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
423 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
424 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
427 %{?with_addition:--with-http_addition_module} \
428 %{?with_dav:--with-http_dav_module} \
429 %{?with_flv:--with-http_flv_module} \
430 %{?with_ipv6:--with-ipv6} \
431 %{?with_sub:--with-http_sub_module} \
432 %{?with_poll:--with-poll_module} \
433 %{?with_realip:--with-http_realip_module} \
434 %{?with_rtsig:--with-rtsig_module} \
435 %{?with_select:--with-select_module} \
436 %{?with_status:--with-http_stub_status_module} \
437 %{?with_ssl:--with-http_ssl_module} \
438 %{!?with_http_browser:--without-http_browser_module} \
439 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
440 %{?with_auth_request:--with-http_auth_request_module} \
441 %{?with_threads:--with-threads} \
442 --with-http_secure_link_module \
443 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
444 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
445 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
446 --with-cc="%{__cc}" \
447 --with-cc-opt="%{rpmcflags}" \
448 --with-ld-opt="%{rpmldflags}" \
449 %{?debug:--with-debug}
454 rm -rf $RPM_BUILD_ROOT
455 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
456 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
457 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
458 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
459 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
460 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
461 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
462 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
464 cp -p conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
465 cp -p conf/scgi_params $RPM_BUILD_ROOT%{_sysconfdir}/scgi.params
466 cp -p conf/uwsgi_params $RPM_BUILD_ROOT%{_sysconfdir}/uwsgi.params
467 cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
468 cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
469 cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
470 cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
471 cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
472 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
473 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
474 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
475 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
476 cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
477 cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
478 install -p %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
479 cp -p %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
480 install -p objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
481 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
484 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
485 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
486 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
487 cp -p %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
488 install -p contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
492 cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
493 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
494 install -p contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
495 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
496 cp -p %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
500 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
501 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
502 cp -p %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
503 install -p %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
504 cp -p %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
505 cp -p contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
506 install -p contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
507 install -p contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
510 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
511 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
514 rm -rf $RPM_BUILD_ROOT
517 %groupadd -r -g 213 %{name}
519 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
520 %addusertogroup %{name} http
523 for a in access.log error.log; do
524 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
526 touch /var/log/%{name}/nginx-standard_$a
527 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
528 chmod 644 /var/log/%{name}/nginx-standard_$a
531 /sbin/chkconfig --add %{name}-standard
532 %systemd_post %{name}-standard.service
533 %service %{name}-standard restart
534 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
535 if ! [ -L /etc/systemd/system/nginx.service ] ; then
536 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
540 for a in access.log error.log; do
541 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
543 touch /var/log/%{name}/nginx-light_$a
544 chown nginx:nginx /var/log/%{name}/nginx-light_$a
545 chmod 644 /var/log/%{name}/nginx-light_$a
548 /sbin/chkconfig --add %{name}-light
549 %systemd_post %{name}-light.service
550 %service %{name}-light restart
551 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
554 for a in access.log error.log; do
555 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
557 touch /var/log/%{name}/nginx-perl_$a
558 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
559 chmod 644 /var/log/%{name}/nginx-perl_$a
562 /sbin/chkconfig --add %{name}-perl
563 %systemd_post %{name}-perl.service
564 %service %{name}-perl restart
565 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
568 for a in access.log error.log; do
569 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
571 touch /var/log/%{name}/nginx-mail_$a
572 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
573 chmod 644 /var/log/%{name}/nginx-mail_$a
576 /sbin/chkconfig --add %{name}-mail
577 %systemd_post %{name}-mail.service
578 %service %{name}-mail restart
579 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
582 if [ "$1" = "0" ];then
583 %service %{name}-standard stop
584 /sbin/chkconfig --del %{name}-standard
586 %systemd_preun %{name}-standard.service
589 if [ "$1" = "0" ]; then
590 %service %{name}-light stop
591 /sbin/chkconfig --del %{name}-light
593 %systemd_preun %{name}-light.service
596 if [ "$1" = "0" ]; then
597 %service %{name}-perl stop
598 /sbin/chkconfig --del %{name}-perl
600 %systemd_preun %{name}-perl.service
603 if [ "$1" = "0" ]; then
604 %service %{name}-mail stop
605 /sbin/chkconfig --del %{name}-mail
607 %systemd_preun %{name}-mail.service
610 if [ "$1" = "0" ]; then
627 %triggerpostun -- %{name}-standard < 1.4.1-4
628 %systemd_trigger %{name}-standard.service
630 %triggerpostun -- %{name}-light < 1.4.1-4
631 %systemd_trigger %{name}-light.service
633 %triggerpostun -- %{name}-perl < 1.4.1-4
634 %systemd_trigger %{name}-perl.service
636 %triggerpostun -- %{name}-mail < 1.4.1-4
637 %systemd_trigger %{name}-mail.service
640 %defattr(644,root,root,755)
641 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
642 %doc %lang(ru) CHANGES.ru
643 %dir %attr(754,root,root) %{_sysconfdir}
645 %dir %{_nginxdir}/cgi-bin
646 %dir %{_nginxdir}/html
647 %dir %{_nginxdir}/errors
648 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
649 # XXX: duplicates, don't use such glob here
650 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
651 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
652 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
653 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi.params
654 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi.params
655 %attr(640,root,root) %{_sysconfdir}/mime.types
656 %attr(640,root,root) %{_sysconfdir}/koi-utf
657 %attr(640,root,root) %{_sysconfdir}/koi-win
658 %attr(640,root,root) %{_sysconfdir}/win-utf
659 %dir %{_sysconfdir}/webapps.d
660 %dir %{_sysconfdir}/vhosts.d
661 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
662 %attr(750,nginx,logs) /var/log/%{name}
663 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
664 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
665 %ghost /etc/systemd/system/nginx.service
668 %defattr(644,root,root,755)
669 %attr(755,root,root) %{_sbindir}/%{name}-standard
670 %attr(770,root,%{name}) /var/cache/%{name}-standard
671 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
672 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
673 %{systemdunitdir}/%{name}-standard.service
677 %defattr(644,root,root,755)
678 %attr(755,root,root) %{_sbindir}/%{name}-mail
679 %attr(770,root,%{name}) /var/cache/%{name}-mail
680 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
681 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
682 %{systemdunitdir}/%{name}-mail.service
687 %defattr(644,root,root,755)
688 %attr(755,root,root) %{_sbindir}/%{name}-light
689 %attr(770,root,%{name}) /var/cache/%{name}-light
690 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
691 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
692 %{systemdunitdir}/%{name}-light.service
697 %defattr(644,root,root,755)
698 %attr(755,root,root) %{_sbindir}/%{name}-perl
699 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
700 %attr(770,root,%{name}) /var/cache/%{name}-perl
701 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
702 %dir %{perl_vendorarch}/auto/%{name}
703 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
704 %{perl_vendorarch}/%{name}.pm
705 %{systemdunitdir}/%{name}-perl.service
708 %files -n monit-rc-nginx
709 %defattr(644,root,root,755)
710 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
712 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
715 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
718 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc