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 status # stats module
19 %bcond_without ssl # ssl support
20 %bcond_with http_browser # header "User-agent" parser
21 %bcond_without rtmp # rtmp support
23 %define rtmp_version 1.0.2
24 Summary: High perfomance HTTP and reverse proxy server
25 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
30 Group: Networking/Daemons/HTTP
31 Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
32 # Source0-md5: 5dfaba1cbeae9087f3949860a02caa9f
33 Source1: http://nginx.net/favicon.ico
34 # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
36 Source3: %{name}.logrotate
38 Source5: %{name}-light.conf
39 Source6: %{name}-light.monitrc
40 Source7: %{name}-light.init
41 Source8: %{name}-mail.conf
42 Source9: %{name}-mail.monitrc
43 Source10: %{name}-mail.init
44 Source11: %{name}-perl.conf
45 Source12: %{name}-perl.monitrc
46 Source13: %{name}-perl.init
47 Source14: %{name}-standard.conf
48 Source15: %{name}-standard.monitrc
49 Source16: %{name}-standard.init
50 Source17: %{name}-mime.types.sh
51 Source18: %{name}-standard.service
52 Source19: %{name}-light.service
53 Source20: %{name}-perl.service
54 Source21: %{name}-mail.service
55 Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}.tar.gz
56 # Source101-md5: 989659b13382e4ee3649fcaa6573c08e
57 Patch0: nginx-no-Werror.patch
58 URL: http://nginx.net/
59 BuildRequires: mailcap
60 BuildRequires: openssl-devel
61 BuildRequires: pcre-devel
62 %{?with_perl:BuildRequires: perl-CGI}
63 %{?with_perl:BuildRequires: perl-devel}
64 %{?with_perl:BuildRequires: python}
65 %{?with_perl:BuildRequires: rpm-perlprov}
66 BuildRequires: rpmbuild(macros) >= 1.644
67 BuildRequires: zlib-devel
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 Sysoeva
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ął dzięki stabilności, bogactwu dodatków,
89 prostej konfiguracji oraz małej "zasobożerności".
92 Summary: nginx - common files
93 Summary(pl.UTF-8): nginx - pliki wspólne
94 Group: Networking/Daemons/HTTP
95 Requires(postun): /usr/sbin/groupdel
96 Requires(postun): /usr/sbin/userdel
97 Requires(pre): /bin/id
98 Requires(pre): /usr/bin/getgid
99 Requires(pre): /usr/sbin/groupadd
100 Requires(pre): /usr/sbin/useradd
103 Requires: rc-scripts >= 0.2.0
104 Requires: systemd-units >= 38
106 Provides: group(http)
107 Provides: group(nginx)
108 Provides: user(nginx)
110 Conflicts: logrotate < 3.8.0
111 Obsoletes: %{name} < 1.4.1-4.1
114 Common files for the nginx daemon.
116 %description common -l pl.UTF-8
117 Niezbędne pliki dla nginx.
120 Summary: High perfomance HTTP and reverse proxy server
121 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
122 Group: Networking/Daemons/HTTP
123 Requires(post,preun): /sbin/chkconfig
124 Requires(post,preun,postun): systemd-units >= 38
125 Requires: %{name}-common = %{version}-%{release}
129 Provides: nginx-daemon
133 nginx ("engine x") is a high-performance HTTP server and reverse
134 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
135 Sysoev for Rambler.ru, Russia's second-most visited website, where it
136 has been running in production for over two and a half years. Igor has
137 released the source code under a BSD-like license. Although still in
138 beta, nginx is known for its stability, rich feature set, simple
139 configuration, and low resource consumption.
141 The smallest, but also the fastest nginx edition. No additional
142 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
144 %description light -l pl.UTF-8
145 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
146 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
147 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
148 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
149 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
150 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
151 prostej konfiguracji oraz małej "zasobożerności".
153 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
154 FLV oraz IMAP, POP3, SMTP proxy.
157 Summary: High perfomance HTTP and reverse proxy server
158 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
159 Group: Networking/Daemons/HTTP
160 Requires(post,preun): /sbin/chkconfig
161 Requires(post,preun,postun): systemd-units >= 38
162 Requires: %{name}-common = %{version}-%{release}
164 Provides: nginx-daemon
168 nginx ("engine x") is a high-performance HTTP server and reverse
169 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
170 Sysoev for Rambler.ru, Russia's second-most visited website, where it
171 has been running in production for over two and a half years. Igor has
172 released the source code under a BSD-like license. Although still in
173 beta, nginx is known for its stability, rich feature set, simple
174 configuration, and low resource consumption.
176 nginx with Perl support. Mail modules not included.
178 %description perl -l pl.UTF-8
179 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
180 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
181 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
182 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
183 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
184 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
185 prostej konfiguracji oraz małej "zasobożerności".
187 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
190 Summary: High perfomance IMAP, POP3, SMTP proxy server
191 Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
192 Group: Networking/Daemons/HTTP
193 Requires(post,preun): /sbin/chkconfig
194 Requires(post,preun,postun): systemd-units >= 38
195 Requires: %{name}-common = %{version}-%{release}
199 Provides: nginx-daemon
202 nginx ("engine x") is a high-performance HTTP server and reverse
203 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
204 Sysoev for Rambler.ru, Russia's second-most visited website, where it
205 has been running in production for over two and a half years. Igor has
206 released the source code under a BSD-like license. Although still in
207 beta, nginx is known for its stability, rich feature set, simple
208 configuration, and low resource consumption.
210 nginx with mail support. Only mail modules included.
212 %description mail -l pl.UTF-8
213 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
214 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
215 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
216 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
217 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
218 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
219 prostej konfiguracji oraz małej "zasobożerności".
221 nginx ze wsparciem tylko dla modułów poczty.
224 Summary: High perfomance HTTP and reverse proxy server
225 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
226 Group: Networking/Daemons/HTTP
227 Requires(post,preun): /sbin/chkconfig
228 Requires(post,preun,postun): systemd-units >= 38
229 Requires: %{name}-common = %{version}-%{release}
232 Provides: nginx-daemon
233 Conflicts: logrotate < 3.7-4
235 %description standard
236 nginx ("engine x") is a high-performance HTTP server and reverse
237 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
238 Sysoev for Rambler.ru, Russia's second-most visited website, where it
239 has been running in production for over two and a half years. Igor has
240 released the source code under a BSD-like license. Although still in
241 beta, nginx is known for its stability, rich feature set, simple
242 configuration, and low resource consumption.
244 This is standard nginx version, without Perl support and IMAP, POP3,
247 %description standard -l pl.UTF-8
248 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
249 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
250 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
251 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
252 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
253 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
254 prostej konfiguracji oraz małej "zasobożerności".
255 ginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
256 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
257 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
258 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
259 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
260 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
261 prostej konfiguracji oraz małej "zasobożerności".
263 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
266 %package -n monit-rc-nginx
267 Summary: nginx support for monit
268 Summary(pl.UTF-8): Wsparcie nginx dla monit
269 Group: Applications/System
270 URL: http://nginx.eu/
271 Requires: %{name}-common = %{version}-%{release}
274 %description -n monit-rc-nginx
275 monitrc file for monitoring nginx webserver.
277 %description -n monit-rc-nginx -l pl.UTF-8
278 Plik monitrc do monitorowania serwera WWW nginx.
281 %setup -q %{?with_rtmp:-a101}
285 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
288 # build mime.types.conf
289 #sh %{SOURCE17} /etc/mime.types
292 # NB: not autoconf generated configure
293 cp -f configure auto/
297 --prefix=%{_prefix} \
298 --sbin-path=%{_sbindir}/%{name}-perl \
299 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
300 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
301 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
302 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
303 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
306 --with-http_perl_module \
307 --without-mail_pop3_module \
308 --without-mail_imap_module \
309 --without-mail_smtp_module \
310 %{?with_addition:--with-http_addition_module} \
311 %{?with_dav:--with-http_dav_module} \
312 %{?with_flv:--with-http_flv_module} \
313 %{?with_ipv6:--with-ipv6} \
314 %{?with_sub:--with-http_sub_module} \
315 %{?with_poll:--with-poll_module} \
316 %{?with_realip:--with-http_realip_module} \
317 %{?with_rtsig:--with-rtsig_module} \
318 %{?with_select:--with-select_module} \
319 %{?with_status:--with-http_stub_status_module} \
320 %{?with_ssl:--with-http_ssl_module} \
321 %{!?with_http_browser:--without-http_browser_module} \
322 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
323 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
324 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
325 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
326 --with-cc="%{__cc}" \
327 --with-cc-opt="%{rpmcflags}" \
328 --with-ld-opt="%{rpmldflags}"
330 mv -f objs/nginx contrib/nginx-perl
331 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs
332 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
333 mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
338 --prefix=%{_prefix} \
339 --sbin-path=%{_sbindir}/%{name}-mail \
340 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
341 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
342 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
343 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
344 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
349 --with-mail_ssl_module \
351 %{?with_ipv6:--with-ipv6} \
352 %{?with_poll:--with-poll_module} \
353 %{?with_rtsig:--with-rtsig_module} \
354 %{?with_select:--with-select_module} \
355 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
356 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
357 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
358 --with-cc="%{__cc}" \
359 --with-cc-opt="%{rpmcflags}" \
360 --with-ld-opt="%{rpmldflags}" \
361 %{?debug:--with-debug}
363 mv -f objs/nginx contrib/nginx-mail
368 --prefix=%{_prefix} \
369 --sbin-path=%{_sbindir}/%{name}-light \
370 --conf-path=%{_sysconfdir}/%{name}-light.conf \
371 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
372 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
373 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
374 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
377 %{?with_ipv6:--with-ipv6} \
378 %{?with_poll:--with-poll_module} \
379 %{?with_realip:--with-http_realip_module} \
380 %{?with_rtsig:--with-rtsig_module} \
381 %{?with_select:--with-select_module} \
382 %{?with_status:--with-http_stub_status_module} \
383 %{?with_ssl:--with-http_ssl_module} \
384 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
385 --without-http_browser_module \
386 --without-mail_pop3_module \
387 --without-mail_imap_module \
388 --without-mail_smtp_module \
389 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
390 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
391 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
392 --with-cc="%{__cc}" \
393 --with-cc-opt="%{rpmcflags}" \
394 --with-ld-opt="%{rpmldflags}" \
395 %{?debug:--with-debug}
397 mv -f objs/nginx contrib/nginx-light
401 --prefix=%{_prefix} \
402 --sbin-path=%{_sbindir}/%{name}-standard \
403 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
404 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
405 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
406 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
407 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
410 %{?with_addition:--with-http_addition_module} \
411 %{?with_dav:--with-http_dav_module} \
412 %{?with_flv:--with-http_flv_module} \
413 %{?with_ipv6:--with-ipv6} \
414 %{?with_sub:--with-http_sub_module} \
415 %{?with_poll:--with-poll_module} \
416 %{?with_realip:--with-http_realip_module} \
417 %{?with_rtsig:--with-rtsig_module} \
418 %{?with_select:--with-select_module} \
419 %{?with_status:--with-http_stub_status_module} \
420 %{?with_ssl:--with-http_ssl_module} \
421 %{!?with_http_browser:--without-http_browser_module} \
422 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
423 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
424 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
425 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
426 --with-cc="%{__cc}" \
427 --with-cc-opt="%{rpmcflags}" \
428 --with-ld-opt="%{rpmldflags}" \
429 %{?debug:--with-debug}
434 rm -rf $RPM_BUILD_ROOT
435 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
436 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
437 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
438 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
439 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
440 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
441 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
442 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
444 install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
445 install conf/scgi_params $RPM_BUILD_ROOT%{_sysconfdir}/scgi.params
446 install conf/uwsgi_params $RPM_BUILD_ROOT%{_sysconfdir}/uwsgi.params
447 install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
448 install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
449 install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
450 install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
451 install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
452 install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
453 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
454 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
455 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
456 install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
457 install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
458 install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
459 install %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
460 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
461 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
464 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
465 install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
466 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
467 install %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
468 install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
472 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
473 install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
474 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
475 install %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
476 install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
480 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
481 install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
482 install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
483 install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
484 install %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
485 install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
486 install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
487 install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
488 install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
491 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
492 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
495 rm -rf $RPM_BUILD_ROOT
498 %groupadd -r -g 213 %{name}
500 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
501 %addusertogroup %{name} http
504 for a in access.log error.log; do
505 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
507 touch /var/log/%{name}/nginx-standard_$a
508 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
509 chmod 644 /var/log/%{name}/nginx-standard_$a
512 /sbin/chkconfig --add %{name}-standard
513 %systemd_post %{name}-standard.service
514 %service %{name}-standard restart
515 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
516 if ! [ -L /etc/systemd/system/nginx.service ] ; then
517 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
521 for a in access.log error.log; do
522 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
524 touch /var/log/%{name}/nginx-light_$a
525 chown nginx:nginx /var/log/%{name}/nginx-light_$a
526 chmod 644 /var/log/%{name}/nginx-light_$a
529 /sbin/chkconfig --add %{name}-light
530 %systemd_post %{name}-light.service
531 %service %{name}-light restart
532 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
535 for a in access.log error.log; do
536 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
538 touch /var/log/%{name}/nginx-perl_$a
539 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
540 chmod 644 /var/log/%{name}/nginx-perl_$a
543 /sbin/chkconfig --add %{name}-perl
544 %systemd_post %{name}-perl.service
545 %service %{name}-perl restart
546 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
549 for a in access.log error.log; do
550 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
552 touch /var/log/%{name}/nginx-mail_$a
553 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
554 chmod 644 /var/log/%{name}/nginx-mail_$a
557 /sbin/chkconfig --add %{name}-mail
558 %systemd_post %{name}-mail.service
559 %service %{name}-mail restart
560 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
563 if [ "$1" = "0" ];then
564 %service %{name}-standard stop
565 /sbin/chkconfig --del %{name}-standard
567 %systemd_preun %{name}-standard.service
570 if [ "$1" = "0" ]; then
571 %service %{name}-light stop
572 /sbin/chkconfig --del %{name}-light
574 %systemd_preun %{name}-light.service
577 if [ "$1" = "0" ]; then
578 %service %{name}-perl stop
579 /sbin/chkconfig --del %{name}-perl
581 %systemd_preun %{name}-perl.service
584 if [ "$1" = "0" ]; then
585 %service %{name}-mail stop
586 /sbin/chkconfig --del %{name}-mail
588 %systemd_preun %{name}-mail.service
591 if [ "$1" = "0" ]; then
608 %triggerpostun -- %{name}-standard < 1.4.1-4
609 %systemd_trigger %{name}-standard.service
611 %triggerpostun -- %{name}-light < 1.4.1-4
612 %systemd_trigger %{name}-light.service
614 %triggerpostun -- %{name}-perl < 1.4.1-4
615 %systemd_trigger %{name}-perl.service
617 %triggerpostun -- %{name}-mail < 1.4.1-4
618 %systemd_trigger %{name}-mail.service
621 %defattr(644,root,root,755)
622 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
623 %doc %lang(ru) CHANGES.ru
624 %dir %attr(754,root,root) %{_sysconfdir}
626 %dir %{_nginxdir}/cgi-bin
627 %dir %{_nginxdir}/html
628 %dir %{_nginxdir}/errors
629 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
630 # XXX: duplicates, don't use such glob here
631 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
632 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
633 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
634 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi.params
635 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi.params
636 %attr(640,root,root) %{_sysconfdir}/mime.types
637 %attr(640,root,root) %{_sysconfdir}/koi-utf
638 %attr(640,root,root) %{_sysconfdir}/koi-win
639 %attr(640,root,root) %{_sysconfdir}/win-utf
640 %dir %{_sysconfdir}/webapps.d
641 %dir %{_sysconfdir}/vhosts.d
642 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
643 %attr(750,nginx,logs) /var/log/%{name}
644 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
645 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
646 %ghost /etc/systemd/system/nginx.service
649 %defattr(644,root,root,755)
650 %attr(755,root,root) %{_sbindir}/%{name}-standard
651 %attr(770,root,%{name}) /var/cache/%{name}-standard
652 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
653 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
654 %{systemdunitdir}/%{name}-standard.service
658 %defattr(644,root,root,755)
659 %attr(755,root,root) %{_sbindir}/%{name}-mail
660 %attr(770,root,%{name}) /var/cache/%{name}-mail
661 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
662 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
663 %{systemdunitdir}/%{name}-mail.service
668 %defattr(644,root,root,755)
669 %attr(755,root,root) %{_sbindir}/%{name}-light
670 %attr(770,root,%{name}) /var/cache/%{name}-light
671 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
672 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
673 %{systemdunitdir}/%{name}-light.service
678 %defattr(644,root,root,755)
679 %attr(755,root,root) %{_sbindir}/%{name}-perl
680 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
681 %attr(770,root,%{name}) /var/cache/%{name}-perl
682 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
683 %dir %{perl_vendorarch}/auto/%{name}
684 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
685 %{perl_vendorarch}/auto/%{name}/%{name}.bs
686 %{perl_vendorarch}/%{name}.pm
687 %{systemdunitdir}/%{name}-perl.service
690 %files -n monit-rc-nginx
691 %defattr(644,root,root,755)
692 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
694 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
697 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
700 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc