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_without rtmp # rtmp support
25 %define rtmp_version 1.1.3
26 Summary: High perfomance HTTP and reverse proxy server
27 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
29 # - stable: production quality with stable API
30 # - mainline: production quality but API can change
35 Group: Networking/Daemons/HTTP
36 Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
37 # Source0-md5: 017ca65f0101915143b7211977bb5dd2
38 Source1: http://nginx.net/favicon.ico
39 # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
41 Source3: %{name}.logrotate
43 Source5: %{name}-light.conf
44 Source6: %{name}-light.monitrc
45 Source7: %{name}-light.init
46 Source8: %{name}-mail.conf
47 Source9: %{name}-mail.monitrc
48 Source10: %{name}-mail.init
49 Source11: %{name}-perl.conf
50 Source12: %{name}-perl.monitrc
51 Source13: %{name}-perl.init
52 Source14: %{name}-standard.conf
53 Source15: %{name}-standard.monitrc
54 Source16: %{name}-standard.init
55 Source17: %{name}-mime.types.sh
56 Source18: %{name}-standard.service
57 Source19: %{name}-light.service
58 Source20: %{name}-perl.service
59 Source21: %{name}-mail.service
60 Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}.tar.gz
61 # Source101-md5: 66ee2b74799e03a25a9e3aaadd874436
62 Patch0: nginx-no-Werror.patch
63 URL: http://nginx.net/
64 BuildRequires: mailcap
65 BuildRequires: openssl-devel
66 BuildRequires: pcre-devel
67 %{?with_perl:BuildRequires: perl-CGI}
68 %{?with_perl:BuildRequires: perl-devel}
69 %{?with_perl:BuildRequires: python}
70 %{?with_perl:BuildRequires: rpm-perlprov}
71 BuildRequires: rpmbuild(macros) >= 1.644
72 BuildRequires: zlib-devel
73 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
75 %define _sysconfdir /etc/%{name}
76 %define _nginxdir /home/services/%{name}
79 nginx ("engine x") is a high-performance HTTP server and reverse
80 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
81 Sysoev for Rambler.ru, Russia's second-most visited website, where it
82 has been running in production for over two and a half years. Igor has
83 released the source code under a BSD-like license. Although still in
84 beta, nginx is known for its stability, rich feature set, simple
85 configuration, and low resource consumption.
87 %description -l pl.UTF-8
88 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
89 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
90 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
91 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
92 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
93 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
94 prostej konfiguracji oraz małej "zasobożerności".
97 Summary: nginx - common files
98 Summary(pl.UTF-8): nginx - pliki wspólne
99 Group: Networking/Daemons/HTTP
100 Requires(postun): /usr/sbin/groupdel
101 Requires(postun): /usr/sbin/userdel
102 Requires(pre): /bin/id
103 Requires(pre): /usr/bin/getgid
104 Requires(pre): /usr/sbin/groupadd
105 Requires(pre): /usr/sbin/useradd
108 Requires: rc-scripts >= 0.2.0
109 Requires: systemd-units >= 38
111 Provides: group(http)
112 Provides: group(nginx)
113 Provides: user(nginx)
115 Conflicts: logrotate < 3.8.0
116 Obsoletes: %{name} < 1.4.1-4.1
119 Common files for the nginx daemon.
121 %description common -l pl.UTF-8
122 Niezbędne pliki dla nginx.
125 Summary: High perfomance HTTP and reverse proxy server
126 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
127 Group: Networking/Daemons/HTTP
128 Requires(post,preun): /sbin/chkconfig
129 Requires(post,preun,postun): systemd-units >= 38
130 Requires: %{name}-common = %{version}-%{release}
134 Provides: nginx-daemon
138 nginx ("engine x") is a high-performance HTTP server and reverse
139 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
140 Sysoev for Rambler.ru, Russia's second-most visited website, where it
141 has been running in production for over two and a half years. Igor has
142 released the source code under a BSD-like license. Although still in
143 beta, nginx is known for its stability, rich feature set, simple
144 configuration, and low resource consumption.
146 The smallest, but also the fastest nginx edition. No additional
147 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
149 %description light -l pl.UTF-8
150 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
151 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
152 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
153 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
154 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
155 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
156 prostej konfiguracji oraz małej "zasobożerności".
158 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
159 FLV oraz IMAP, POP3, SMTP proxy.
162 Summary: High perfomance HTTP and reverse proxy server
163 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
164 Group: Networking/Daemons/HTTP
165 Requires(post,preun): /sbin/chkconfig
166 Requires(post,preun,postun): systemd-units >= 38
167 Requires: %{name}-common = %{version}-%{release}
169 Provides: nginx-daemon
173 nginx ("engine x") is a high-performance HTTP server and reverse
174 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
175 Sysoev for Rambler.ru, Russia's second-most visited website, where it
176 has been running in production for over two and a half years. Igor has
177 released the source code under a BSD-like license. Although still in
178 beta, nginx is known for its stability, rich feature set, simple
179 configuration, and low resource consumption.
181 nginx with Perl support. Mail modules not included.
183 %description perl -l pl.UTF-8
184 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
185 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
186 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
187 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
188 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
189 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
190 prostej konfiguracji oraz małej "zasobożerności".
192 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
195 Summary: High perfomance IMAP, POP3, SMTP proxy server
196 Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
197 Group: Networking/Daemons/HTTP
198 Requires(post,preun): /sbin/chkconfig
199 Requires(post,preun,postun): systemd-units >= 38
200 Requires: %{name}-common = %{version}-%{release}
204 Provides: nginx-daemon
207 nginx ("engine x") is a high-performance HTTP server and reverse
208 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
209 Sysoev for Rambler.ru, Russia's second-most visited website, where it
210 has been running in production for over two and a half years. Igor has
211 released the source code under a BSD-like license. Although still in
212 beta, nginx is known for its stability, rich feature set, simple
213 configuration, and low resource consumption.
215 nginx with mail support. Only mail modules included.
217 %description mail -l pl.UTF-8
218 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
219 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
220 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
221 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
222 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
223 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
224 prostej konfiguracji oraz małej "zasobożerności".
226 nginx ze wsparciem tylko dla modułów poczty.
229 Summary: High perfomance HTTP and reverse proxy server
230 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
231 Group: Networking/Daemons/HTTP
232 Requires(post,preun): /sbin/chkconfig
233 Requires(post,preun,postun): systemd-units >= 38
234 Requires: %{name}-common = %{version}-%{release}
237 Provides: nginx-daemon
238 Conflicts: logrotate < 3.7-4
240 %description standard
241 nginx ("engine x") is a high-performance HTTP server and reverse
242 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
243 Sysoev for Rambler.ru, Russia's second-most visited website, where it
244 has been running in production for over two and a half years. Igor has
245 released the source code under a BSD-like license. Although still in
246 beta, nginx is known for its stability, rich feature set, simple
247 configuration, and low resource consumption.
249 This is standard nginx version, without Perl support and IMAP, POP3,
252 %description standard -l pl.UTF-8
253 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
254 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
255 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
256 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
257 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
258 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
259 prostej konfiguracji oraz małej "zasobożerności".
260 ginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
261 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
262 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
263 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
264 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
265 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
266 prostej konfiguracji oraz małej "zasobożerności".
268 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
271 %package -n monit-rc-nginx
272 Summary: nginx support for monit
273 Summary(pl.UTF-8): Wsparcie nginx dla monit
274 Group: Applications/System
275 URL: http://nginx.eu/
276 Requires: %{name}-common = %{version}-%{release}
279 %description -n monit-rc-nginx
280 monitrc file for monitoring nginx webserver.
282 %description -n monit-rc-nginx -l pl.UTF-8
283 Plik monitrc do monitorowania serwera WWW nginx.
286 %setup -q %{?with_rtmp:-a101}
290 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
293 # build mime.types.conf
294 #sh %{SOURCE17} /etc/mime.types
297 # NB: not autoconf generated configure
298 cp -f configure auto/
302 --prefix=%{_prefix} \
303 --sbin-path=%{_sbindir}/%{name}-perl \
304 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
305 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
306 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
307 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
308 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
311 --with-http_perl_module \
312 --without-mail_pop3_module \
313 --without-mail_imap_module \
314 --without-mail_smtp_module \
315 %{?with_addition:--with-http_addition_module} \
316 %{?with_dav:--with-http_dav_module} \
317 %{?with_flv:--with-http_flv_module} \
318 %{?with_ipv6:--with-ipv6} \
319 %{?with_sub:--with-http_sub_module} \
320 %{?with_poll:--with-poll_module} \
321 %{?with_realip:--with-http_realip_module} \
322 %{?with_rtsig:--with-rtsig_module} \
323 %{?with_select:--with-select_module} \
324 %{?with_status:--with-http_stub_status_module} \
325 %{?with_ssl:--with-http_ssl_module} \
326 %{!?with_http_browser:--without-http_browser_module} \
327 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
328 --with-http_secure_link_module \
329 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
330 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
331 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
332 --with-cc="%{__cc}" \
333 --with-cc-opt="%{rpmcflags}" \
334 --with-ld-opt="%{rpmldflags}"
336 mv -f objs/nginx contrib/nginx-perl
337 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs
338 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
339 mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
344 --prefix=%{_prefix} \
345 --sbin-path=%{_sbindir}/%{name}-mail \
346 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
347 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
348 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
349 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
350 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
355 --with-mail_ssl_module \
357 %{?with_ipv6:--with-ipv6} \
358 %{?with_poll:--with-poll_module} \
359 %{?with_rtsig:--with-rtsig_module} \
360 %{?with_select:--with-select_module} \
361 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
362 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
363 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
364 --with-cc="%{__cc}" \
365 --with-cc-opt="%{rpmcflags}" \
366 --with-ld-opt="%{rpmldflags}" \
367 %{?debug:--with-debug}
369 mv -f objs/nginx contrib/nginx-mail
374 --prefix=%{_prefix} \
375 --sbin-path=%{_sbindir}/%{name}-light \
376 --conf-path=%{_sysconfdir}/%{name}-light.conf \
377 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
378 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
379 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
380 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
383 %{?with_ipv6:--with-ipv6} \
384 %{?with_poll:--with-poll_module} \
385 %{?with_realip:--with-http_realip_module} \
386 %{?with_rtsig:--with-rtsig_module} \
387 %{?with_select:--with-select_module} \
388 %{?with_status:--with-http_stub_status_module} \
389 %{?with_ssl:--with-http_ssl_module} \
390 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
391 --without-http_browser_module \
392 --without-mail_pop3_module \
393 --without-mail_imap_module \
394 --without-mail_smtp_module \
395 --with-http_secure_link_module \
396 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
397 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
398 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
399 --with-cc="%{__cc}" \
400 --with-cc-opt="%{rpmcflags}" \
401 --with-ld-opt="%{rpmldflags}" \
402 %{?debug:--with-debug}
404 mv -f objs/nginx contrib/nginx-light
408 --prefix=%{_prefix} \
409 --sbin-path=%{_sbindir}/%{name}-standard \
410 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
411 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
412 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
413 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
414 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
417 %{?with_addition:--with-http_addition_module} \
418 %{?with_dav:--with-http_dav_module} \
419 %{?with_flv:--with-http_flv_module} \
420 %{?with_ipv6:--with-ipv6} \
421 %{?with_sub:--with-http_sub_module} \
422 %{?with_poll:--with-poll_module} \
423 %{?with_realip:--with-http_realip_module} \
424 %{?with_rtsig:--with-rtsig_module} \
425 %{?with_select:--with-select_module} \
426 %{?with_status:--with-http_stub_status_module} \
427 %{?with_ssl:--with-http_ssl_module} \
428 %{!?with_http_browser:--without-http_browser_module} \
429 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
430 --with-http_secure_link_module \
431 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
432 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
433 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
434 --with-cc="%{__cc}" \
435 --with-cc-opt="%{rpmcflags}" \
436 --with-ld-opt="%{rpmldflags}" \
437 %{?debug:--with-debug}
442 rm -rf $RPM_BUILD_ROOT
443 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
444 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
445 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
446 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
447 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
448 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
449 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
450 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
452 install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
453 install conf/scgi_params $RPM_BUILD_ROOT%{_sysconfdir}/scgi.params
454 install conf/uwsgi_params $RPM_BUILD_ROOT%{_sysconfdir}/uwsgi.params
455 install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
456 install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
457 install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
458 install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
459 install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
460 install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
461 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
462 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
463 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
464 install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
465 install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
466 install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
467 install %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
468 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
469 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
472 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
473 install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
474 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
475 install %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
476 install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
480 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
481 install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
482 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
483 install %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
484 install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
488 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
489 install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
490 install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
491 install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
492 install %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
493 install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
494 install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
495 install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
496 install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
499 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
500 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
503 rm -rf $RPM_BUILD_ROOT
506 %groupadd -r -g 213 %{name}
508 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
509 %addusertogroup %{name} http
512 for a in access.log error.log; do
513 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
515 touch /var/log/%{name}/nginx-standard_$a
516 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
517 chmod 644 /var/log/%{name}/nginx-standard_$a
520 /sbin/chkconfig --add %{name}-standard
521 %systemd_post %{name}-standard.service
522 %service %{name}-standard restart
523 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
524 if ! [ -L /etc/systemd/system/nginx.service ] ; then
525 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
529 for a in access.log error.log; do
530 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
532 touch /var/log/%{name}/nginx-light_$a
533 chown nginx:nginx /var/log/%{name}/nginx-light_$a
534 chmod 644 /var/log/%{name}/nginx-light_$a
537 /sbin/chkconfig --add %{name}-light
538 %systemd_post %{name}-light.service
539 %service %{name}-light restart
540 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
543 for a in access.log error.log; do
544 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
546 touch /var/log/%{name}/nginx-perl_$a
547 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
548 chmod 644 /var/log/%{name}/nginx-perl_$a
551 /sbin/chkconfig --add %{name}-perl
552 %systemd_post %{name}-perl.service
553 %service %{name}-perl restart
554 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
557 for a in access.log error.log; do
558 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
560 touch /var/log/%{name}/nginx-mail_$a
561 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
562 chmod 644 /var/log/%{name}/nginx-mail_$a
565 /sbin/chkconfig --add %{name}-mail
566 %systemd_post %{name}-mail.service
567 %service %{name}-mail restart
568 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
571 if [ "$1" = "0" ];then
572 %service %{name}-standard stop
573 /sbin/chkconfig --del %{name}-standard
575 %systemd_preun %{name}-standard.service
578 if [ "$1" = "0" ]; then
579 %service %{name}-light stop
580 /sbin/chkconfig --del %{name}-light
582 %systemd_preun %{name}-light.service
585 if [ "$1" = "0" ]; then
586 %service %{name}-perl stop
587 /sbin/chkconfig --del %{name}-perl
589 %systemd_preun %{name}-perl.service
592 if [ "$1" = "0" ]; then
593 %service %{name}-mail stop
594 /sbin/chkconfig --del %{name}-mail
596 %systemd_preun %{name}-mail.service
599 if [ "$1" = "0" ]; then
616 %triggerpostun -- %{name}-standard < 1.4.1-4
617 %systemd_trigger %{name}-standard.service
619 %triggerpostun -- %{name}-light < 1.4.1-4
620 %systemd_trigger %{name}-light.service
622 %triggerpostun -- %{name}-perl < 1.4.1-4
623 %systemd_trigger %{name}-perl.service
625 %triggerpostun -- %{name}-mail < 1.4.1-4
626 %systemd_trigger %{name}-mail.service
629 %defattr(644,root,root,755)
630 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
631 %doc %lang(ru) CHANGES.ru
632 %dir %attr(754,root,root) %{_sysconfdir}
634 %dir %{_nginxdir}/cgi-bin
635 %dir %{_nginxdir}/html
636 %dir %{_nginxdir}/errors
637 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
638 # XXX: duplicates, don't use such glob here
639 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
640 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
641 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
642 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi.params
643 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi.params
644 %attr(640,root,root) %{_sysconfdir}/mime.types
645 %attr(640,root,root) %{_sysconfdir}/koi-utf
646 %attr(640,root,root) %{_sysconfdir}/koi-win
647 %attr(640,root,root) %{_sysconfdir}/win-utf
648 %dir %{_sysconfdir}/webapps.d
649 %dir %{_sysconfdir}/vhosts.d
650 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
651 %attr(750,nginx,logs) /var/log/%{name}
652 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
653 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
654 %ghost /etc/systemd/system/nginx.service
657 %defattr(644,root,root,755)
658 %attr(755,root,root) %{_sbindir}/%{name}-standard
659 %attr(770,root,%{name}) /var/cache/%{name}-standard
660 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
661 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
662 %{systemdunitdir}/%{name}-standard.service
666 %defattr(644,root,root,755)
667 %attr(755,root,root) %{_sbindir}/%{name}-mail
668 %attr(770,root,%{name}) /var/cache/%{name}-mail
669 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
670 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
671 %{systemdunitdir}/%{name}-mail.service
676 %defattr(644,root,root,755)
677 %attr(755,root,root) %{_sbindir}/%{name}-light
678 %attr(770,root,%{name}) /var/cache/%{name}-light
679 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
680 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
681 %{systemdunitdir}/%{name}-light.service
686 %defattr(644,root,root,755)
687 %attr(755,root,root) %{_sbindir}/%{name}-perl
688 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
689 %attr(770,root,%{name}) /var/cache/%{name}-perl
690 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
691 %dir %{perl_vendorarch}/auto/%{name}
692 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
693 %{perl_vendorarch}/auto/%{name}/%{name}.bs
694 %{perl_vendorarch}/%{name}.pm
695 %{systemdunitdir}/%{name}-perl.service
698 %files -n monit-rc-nginx
699 %defattr(644,root,root,755)
700 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
702 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
705 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
708 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc