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: 3ca4a37931e9fa301964b8ce889da8cb
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 # build with common options
310 --prefix=%{_prefix} \
313 --with-cc="%{__cc}" \
314 --with-cc-opt="%{rpmcflags}" \
315 --with-ld-opt="%{rpmldflags}" \
316 %{?debug:--with-debug} \
323 --sbin-path=%{_sbindir}/%{name}-perl \
324 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
325 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
326 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
327 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
328 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
329 --with-http_perl_module \
330 --without-mail_pop3_module \
331 --without-mail_imap_module \
332 --without-mail_smtp_module \
333 %{?with_addition:--with-http_addition_module} \
334 %{?with_dav:--with-http_dav_module} \
335 %{?with_flv:--with-http_flv_module} \
336 %{?with_ipv6:--with-ipv6} \
337 %{?with_sub:--with-http_sub_module} \
338 %{?with_poll:--with-poll_module} \
339 %{?with_realip:--with-http_realip_module} \
340 %{?with_rtsig:--with-rtsig_module} \
341 %{?with_select:--with-select_module} \
342 %{?with_status:--with-http_stub_status_module} \
343 %{?with_ssl:--with-http_ssl_module} \
344 %{!?with_http_browser:--without-http_browser_module} \
345 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
346 %{?with_auth_request:--with-http_auth_request_module} \
347 %{?with_threads:--with-threads} \
348 %{?with_spdy:--with-http_spdy_module} \
349 --with-http_secure_link_module \
350 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
351 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
352 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
355 mv -f objs/nginx bin/nginx-perl
356 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so
357 mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm
362 --sbin-path=%{_sbindir}/%{name}-mail \
363 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
364 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
365 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
366 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
367 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
370 --with-mail_ssl_module \
372 %{?with_ipv6:--with-ipv6} \
373 %{?with_poll:--with-poll_module} \
374 %{?with_rtsig:--with-rtsig_module} \
375 %{?with_select:--with-select_module} \
376 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
377 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
378 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
381 mv -f objs/nginx bin/nginx-mail
386 --sbin-path=%{_sbindir}/%{name}-light \
387 --conf-path=%{_sysconfdir}/%{name}-light.conf \
388 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
389 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
390 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
391 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
392 %{?with_ipv6:--with-ipv6} \
393 %{?with_poll:--with-poll_module} \
394 %{?with_realip:--with-http_realip_module} \
395 %{?with_rtsig:--with-rtsig_module} \
396 %{?with_select:--with-select_module} \
397 %{?with_status:--with-http_stub_status_module} \
398 %{?with_ssl:--with-http_ssl_module} \
399 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
400 %{?with_auth_request:--with-http_auth_request_module} \
401 %{?with_threads:--with-threads} \
402 %{?with_spdy:--with-http_spdy_module} \
403 --without-http_browser_module \
404 --without-mail_pop3_module \
405 --without-mail_imap_module \
406 --without-mail_smtp_module \
407 --with-http_secure_link_module \
408 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
409 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
410 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
413 mv -f objs/nginx bin/nginx-light
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 \
423 %{?with_addition:--with-http_addition_module} \
424 %{?with_dav:--with-http_dav_module} \
425 %{?with_flv:--with-http_flv_module} \
426 %{?with_ipv6:--with-ipv6} \
427 %{?with_sub:--with-http_sub_module} \
428 %{?with_poll:--with-poll_module} \
429 %{?with_realip:--with-http_realip_module} \
430 %{?with_rtsig:--with-rtsig_module} \
431 %{?with_select:--with-select_module} \
432 %{?with_status:--with-http_stub_status_module} \
433 %{?with_ssl:--with-http_ssl_module} \
434 %{!?with_http_browser:--without-http_browser_module} \
435 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
436 %{?with_auth_request:--with-http_auth_request_module} \
437 %{?with_threads:--with-threads} \
438 --with-http_secure_link_module \
439 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
440 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
441 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
444 mv -f objs/%{name} bin/%{name}-standard
447 rm -rf $RPM_BUILD_ROOT
448 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
449 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
450 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
451 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
452 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
453 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
454 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
455 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
457 cp -p conf/*_params $RPM_BUILD_ROOT%{_sysconfdir}
458 cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
459 cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
460 cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
461 cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
462 cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
463 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
464 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
465 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
466 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
467 cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
468 cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
469 install -p %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
470 cp -p %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
471 install -p bin/nginx-standard $RPM_BUILD_ROOT%{_sbindir}
472 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
475 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
476 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
477 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
478 cp -p %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
479 install -p bin/nginx-light $RPM_BUILD_ROOT%{_sbindir}
483 cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
484 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
485 install -p bin/nginx-mail $RPM_BUILD_ROOT%{_sbindir}
486 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
487 cp -p %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
491 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
492 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
493 cp -p %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
494 install -p %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
495 cp -p %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
496 cp -p bin/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
497 install -p bin/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
498 install -p bin/nginx-perl $RPM_BUILD_ROOT%{_sbindir}
501 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
502 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
504 # only touch these for ghost packaging
505 touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params
508 rm -rf $RPM_BUILD_ROOT
511 %groupadd -r -g 213 %{name}
513 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
514 %addusertogroup %{name} http
517 for a in access.log error.log; do
518 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
520 touch /var/log/%{name}/nginx-standard_$a
521 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
522 chmod 644 /var/log/%{name}/nginx-standard_$a
525 /sbin/chkconfig --add %{name}-standard
526 %systemd_post %{name}-standard.service
527 %service %{name}-standard restart
528 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
529 if ! [ -L /etc/systemd/system/nginx.service ] ; then
530 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
534 for a in access.log error.log; do
535 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
537 touch /var/log/%{name}/nginx-light_$a
538 chown nginx:nginx /var/log/%{name}/nginx-light_$a
539 chmod 644 /var/log/%{name}/nginx-light_$a
542 /sbin/chkconfig --add %{name}-light
543 %systemd_post %{name}-light.service
544 %service %{name}-light restart
545 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
548 for a in access.log error.log; do
549 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
551 touch /var/log/%{name}/nginx-perl_$a
552 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
553 chmod 644 /var/log/%{name}/nginx-perl_$a
556 /sbin/chkconfig --add %{name}-perl
557 %systemd_post %{name}-perl.service
558 %service %{name}-perl restart
559 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
562 for a in access.log error.log; do
563 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
565 touch /var/log/%{name}/nginx-mail_$a
566 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
567 chmod 644 /var/log/%{name}/nginx-mail_$a
570 /sbin/chkconfig --add %{name}-mail
571 %systemd_post %{name}-mail.service
572 %service %{name}-mail restart
573 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
576 if [ "$1" = "0" ];then
577 %service %{name}-standard stop
578 /sbin/chkconfig --del %{name}-standard
580 %systemd_preun %{name}-standard.service
583 if [ "$1" = "0" ]; then
584 %service %{name}-light stop
585 /sbin/chkconfig --del %{name}-light
587 %systemd_preun %{name}-light.service
590 if [ "$1" = "0" ]; then
591 %service %{name}-perl stop
592 /sbin/chkconfig --del %{name}-perl
594 %systemd_preun %{name}-perl.service
597 if [ "$1" = "0" ]; then
598 %service %{name}-mail stop
599 /sbin/chkconfig --del %{name}-mail
601 %systemd_preun %{name}-mail.service
604 if [ "$1" = "0" ]; then
621 %triggerpostun -- %{name}-standard < 1.4.1-4
622 %systemd_trigger %{name}-standard.service
624 %triggerpostun -- %{name}-light < 1.4.1-4
625 %systemd_trigger %{name}-light.service
627 %triggerpostun -- %{name}-perl < 1.4.1-4
628 %systemd_trigger %{name}-perl.service
630 %triggerpostun -- %{name}-mail < 1.4.1-4
631 %systemd_trigger %{name}-mail.service
633 %triggerpostun common -- %{name}-common < 1.8.0-2
634 # skip *this* trigger on downgrade
635 [ $1 -le 1 ] && exit 0
636 ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params
637 ln -sf scgi_params %{_sysconfdir}/scgi.params
638 ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params
642 %defattr(644,root,root,755)
643 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
644 %doc %lang(ru) CHANGES.ru
645 %dir %attr(754,root,root) %{_sysconfdir}
647 %dir %{_nginxdir}/cgi-bin
648 %dir %{_nginxdir}/html
649 %dir %{_nginxdir}/errors
650 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
651 # XXX: duplicates, don't use such glob here
652 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
653 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
654 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params
655 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params
656 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params
657 %ghost %{_sysconfdir}/fastcgi.params
658 %ghost %{_sysconfdir}/scgi.params
659 %ghost %{_sysconfdir}/uwsgi.params
660 %attr(640,root,root) %{_sysconfdir}/mime.types
661 %attr(640,root,root) %{_sysconfdir}/koi-utf
662 %attr(640,root,root) %{_sysconfdir}/koi-win
663 %attr(640,root,root) %{_sysconfdir}/win-utf
664 %dir %{_sysconfdir}/webapps.d
665 %dir %{_sysconfdir}/vhosts.d
666 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
667 %attr(750,nginx,logs) /var/log/%{name}
668 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
669 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
670 %ghost /etc/systemd/system/nginx.service
673 %defattr(644,root,root,755)
674 %attr(755,root,root) %{_sbindir}/%{name}-standard
675 %attr(770,root,%{name}) /var/cache/%{name}-standard
676 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
677 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
678 %{systemdunitdir}/%{name}-standard.service
682 %defattr(644,root,root,755)
683 %attr(755,root,root) %{_sbindir}/%{name}-mail
684 %attr(770,root,%{name}) /var/cache/%{name}-mail
685 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
686 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
687 %{systemdunitdir}/%{name}-mail.service
692 %defattr(644,root,root,755)
693 %attr(755,root,root) %{_sbindir}/%{name}-light
694 %attr(770,root,%{name}) /var/cache/%{name}-light
695 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
696 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
697 %{systemdunitdir}/%{name}-light.service
702 %defattr(644,root,root,755)
703 %attr(755,root,root) %{_sbindir}/%{name}-perl
704 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
705 %attr(770,root,%{name}) /var/cache/%{name}-perl
706 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
707 %dir %{perl_vendorarch}/auto/%{name}
708 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
709 %{perl_vendorarch}/%{name}.pm
710 %{systemdunitdir}/%{name}-perl.service
713 %files -n monit-rc-nginx
714 %defattr(644,root,root,755)
715 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
717 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
720 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
723 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc