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_with debug # build with debug enabled: http://nginx.org/en/docs/debugging_log.html
25 %bcond_without auth_request # auth_request module
31 %define rtmp_version 1.1.7
32 Summary: High perfomance HTTP and reverse proxy server
33 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
35 # - stable: production quality with stable API
36 # - mainline: production quality but API can change
41 Group: Networking/Daemons/HTTP
42 Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
43 # Source0-md5: 3ca4a37931e9fa301964b8ce889da8cb
44 Source1: http://nginx.net/favicon.ico
45 # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
47 Source3: %{name}.logrotate
49 Source5: %{name}-light.conf
50 Source6: %{name}-light.monitrc
51 Source7: %{name}-light.init
52 Source8: %{name}-mail.conf
53 Source9: %{name}-mail.monitrc
54 Source10: %{name}-mail.init
55 Source11: %{name}-perl.conf
56 Source12: %{name}-perl.monitrc
57 Source13: %{name}-perl.init
58 Source14: %{name}-standard.conf
59 Source15: %{name}-standard.monitrc
60 Source16: %{name}-standard.init
61 Source17: %{name}-mime.types.sh
62 Source18: %{name}-standard.service
63 Source19: %{name}-light.service
64 Source20: %{name}-perl.service
65 Source21: %{name}-mail.service
66 Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
67 # Source101-md5: 8006de2560db3e55bb15d110220076ac
68 Patch0: %{name}-no-Werror.patch
69 URL: http://nginx.net/
70 BuildRequires: mailcap
71 BuildRequires: openssl-devel
72 BuildRequires: pcre-devel
73 %{?with_perl:BuildRequires: perl-CGI}
74 %{?with_perl:BuildRequires: perl-devel}
75 %{?with_perl:BuildRequires: python}
76 %{?with_perl:BuildRequires: rpm-perlprov}
77 BuildRequires: rpmbuild(macros) >= 1.644
78 BuildRequires: zlib-devel
79 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
81 %define _sysconfdir /etc/%{name}
82 %define _nginxdir /home/services/%{name}
85 nginx ("engine x") is a high-performance HTTP server and reverse
86 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
87 Sysoev for Rambler.ru, Russia's second-most visited website, where it
88 has been running in production for over two and a half years. Igor has
89 released the source code under a BSD-like license. Although still in
90 beta, nginx is known for its stability, rich feature set, simple
91 configuration, and low resource consumption.
93 %description -l pl.UTF-8
94 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
95 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
96 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
97 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
98 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
99 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
100 prostej konfiguracji oraz małej "zasobożerności".
103 Summary: nginx - common files
104 Summary(pl.UTF-8): nginx - pliki wspólne
105 Group: Networking/Daemons/HTTP
106 Requires(postun): /usr/sbin/groupdel
107 Requires(postun): /usr/sbin/userdel
108 Requires(pre): /bin/id
109 Requires(pre): /usr/bin/getgid
110 Requires(pre): /usr/sbin/groupadd
111 Requires(pre): /usr/sbin/useradd
114 Requires: rc-scripts >= 0.2.0
115 Requires: systemd-units >= 38
117 Provides: group(http)
118 Provides: group(nginx)
119 Provides: user(nginx)
121 Obsoletes: nginx < 1.4.1-4.1
122 Conflicts: logrotate < 3.8.0
125 Common files for the nginx daemon.
127 %description common -l pl.UTF-8
128 Niezbędne pliki dla nginx.
131 Summary: High perfomance HTTP and reverse proxy server
132 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
133 Group: Networking/Daemons/HTTP
134 Requires(post,preun): /sbin/chkconfig
135 Requires(post,preun,postun): systemd-units >= 38
136 Requires: %{name}-common = %{version}-%{release}
140 Provides: nginx-daemon
144 nginx ("engine x") is a high-performance HTTP server and reverse
145 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
146 Sysoev for Rambler.ru, Russia's second-most visited website, where it
147 has been running in production for over two and a half years. Igor has
148 released the source code under a BSD-like license. Although still in
149 beta, nginx is known for its stability, rich feature set, simple
150 configuration, and low resource consumption.
152 The smallest, but also the fastest nginx edition. No additional
153 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
155 %description light -l pl.UTF-8
156 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
157 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
158 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
159 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
160 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
161 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
162 prostej konfiguracji oraz małej "zasobożerności".
164 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
165 FLV oraz IMAP, POP3, SMTP proxy.
168 Summary: High perfomance HTTP and reverse proxy server
169 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
170 Group: Networking/Daemons/HTTP
171 Requires(post,preun): /sbin/chkconfig
172 Requires(post,preun,postun): systemd-units >= 38
173 Requires: %{name}-common = %{version}-%{release}
175 Provides: nginx-daemon
179 nginx ("engine x") is a high-performance HTTP server and reverse
180 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
181 Sysoev for Rambler.ru, Russia's second-most visited website, where it
182 has been running in production for over two and a half years. Igor has
183 released the source code under a BSD-like license. Although still in
184 beta, nginx is known for its stability, rich feature set, simple
185 configuration, and low resource consumption.
187 nginx with Perl support. Mail modules not included.
189 %description perl -l pl.UTF-8
190 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
191 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
192 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
193 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
194 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
195 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
196 prostej konfiguracji oraz małej "zasobożerności".
198 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
201 Summary: High perfomance IMAP, POP3, SMTP proxy server
202 Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
203 Group: Networking/Daemons/HTTP
204 Requires(post,preun): /sbin/chkconfig
205 Requires(post,preun,postun): systemd-units >= 38
206 Requires: %{name}-common = %{version}-%{release}
210 Provides: nginx-daemon
213 nginx ("engine x") is a high-performance HTTP server and reverse
214 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
215 Sysoev for Rambler.ru, Russia's second-most visited website, where it
216 has been running in production for over two and a half years. Igor has
217 released the source code under a BSD-like license. Although still in
218 beta, nginx is known for its stability, rich feature set, simple
219 configuration, and low resource consumption.
221 nginx with mail support. Only mail modules included.
223 %description mail -l pl.UTF-8
224 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
225 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
226 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
227 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
228 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
229 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
230 prostej konfiguracji oraz małej "zasobożerności".
232 nginx ze wsparciem tylko dla modułów poczty.
235 Summary: High perfomance HTTP and reverse proxy server
236 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
237 Group: Networking/Daemons/HTTP
238 Requires(post,preun): /sbin/chkconfig
239 Requires(post,preun,postun): systemd-units >= 38
240 Requires: %{name}-common = %{version}-%{release}
243 Provides: nginx-daemon
244 Conflicts: logrotate < 3.7-4
246 %description standard
247 nginx ("engine x") is a high-performance HTTP server and reverse
248 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
249 Sysoev for Rambler.ru, Russia's second-most visited website, where it
250 has been running in production for over two and a half years. Igor has
251 released the source code under a BSD-like license. Although still in
252 beta, nginx is known for its stability, rich feature set, simple
253 configuration, and low resource consumption.
255 This is standard nginx version, without Perl support and IMAP, POP3,
258 %description standard -l pl.UTF-8
259 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
260 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
261 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
262 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
263 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
264 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
265 prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x")
266 jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3
267 proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu
268 Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji
269 i działa od ponad dwóch i pół roku. Igor opublikował źródła na
270 licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął
271 dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej
274 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
277 %package -n monit-rc-nginx
278 Summary: nginx support for monit
279 Summary(pl.UTF-8): Wsparcie nginx dla monit
280 Group: Applications/System
281 URL: http://nginx.eu/
282 Requires: %{name}-common = %{version}-%{release}
285 %description -n monit-rc-nginx
286 monitrc file for monitoring nginx webserver.
288 %description -n monit-rc-nginx -l pl.UTF-8
289 Plik monitrc do monitorowania serwera WWW nginx.
292 %setup -q %{?with_rtmp:-a101}
296 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
299 # build mime.types.conf
300 #sh %{SOURCE17} /etc/mime.types
303 # NB: not autoconf generated configure
304 cp -f configure auto/
308 # build with common options
311 --prefix=%{_prefix} \
314 --with-cc="%{__cc}" \
315 --with-cc-opt="%{rpmcflags}" \
316 --with-ld-opt="%{rpmldflags}" \
317 %{?with_debug:--with-debug} \
324 --sbin-path=%{_sbindir}/%{name}-perl \
325 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
326 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
327 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
328 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
329 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
330 --with-http_perl_module \
331 --without-mail_pop3_module \
332 --without-mail_imap_module \
333 --without-mail_smtp_module \
334 %{?with_addition:--with-http_addition_module} \
335 %{?with_dav:--with-http_dav_module} \
336 %{?with_flv:--with-http_flv_module} \
337 %{?with_ipv6:--with-ipv6} \
338 %{?with_sub:--with-http_sub_module} \
339 %{?with_poll:--with-poll_module} \
340 %{?with_realip:--with-http_realip_module} \
341 %{?with_rtsig:--with-rtsig_module} \
342 %{?with_select:--with-select_module} \
343 %{?with_status:--with-http_stub_status_module} \
344 %{?with_ssl:--with-http_ssl_module} \
345 %{!?with_http_browser:--without-http_browser_module} \
346 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
347 %{?with_auth_request:--with-http_auth_request_module} \
348 %{?with_threads:--with-threads} \
349 %{?with_spdy:--with-http_spdy_module} \
350 --with-http_secure_link_module \
351 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
352 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
353 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
356 mv -f objs/nginx bin/nginx-perl
357 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so
358 mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm
363 --sbin-path=%{_sbindir}/%{name}-mail \
364 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
365 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
366 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
367 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
368 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
371 --with-mail_ssl_module \
373 %{?with_ipv6:--with-ipv6} \
374 %{?with_poll:--with-poll_module} \
375 %{?with_rtsig:--with-rtsig_module} \
376 %{?with_select:--with-select_module} \
377 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
378 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
379 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
382 mv -f objs/nginx bin/nginx-mail
387 --sbin-path=%{_sbindir}/%{name}-light \
388 --conf-path=%{_sysconfdir}/%{name}-light.conf \
389 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
390 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
391 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
392 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
393 %{?with_ipv6:--with-ipv6} \
394 %{?with_poll:--with-poll_module} \
395 %{?with_realip:--with-http_realip_module} \
396 %{?with_rtsig:--with-rtsig_module} \
397 %{?with_select:--with-select_module} \
398 %{?with_status:--with-http_stub_status_module} \
399 %{?with_ssl:--with-http_ssl_module} \
400 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
401 %{?with_auth_request:--with-http_auth_request_module} \
402 %{?with_threads:--with-threads} \
403 %{?with_spdy:--with-http_spdy_module} \
404 --without-http_browser_module \
405 --without-mail_pop3_module \
406 --without-mail_imap_module \
407 --without-mail_smtp_module \
408 --with-http_secure_link_module \
409 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
410 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
411 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
414 mv -f objs/nginx bin/nginx-light
418 --sbin-path=%{_sbindir}/%{name}-standard \
419 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
420 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
421 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
422 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
423 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
424 %{?with_addition:--with-http_addition_module} \
425 %{?with_dav:--with-http_dav_module} \
426 %{?with_flv:--with-http_flv_module} \
427 %{?with_ipv6:--with-ipv6} \
428 %{?with_sub:--with-http_sub_module} \
429 %{?with_poll:--with-poll_module} \
430 %{?with_realip:--with-http_realip_module} \
431 %{?with_rtsig:--with-rtsig_module} \
432 %{?with_select:--with-select_module} \
433 %{?with_status:--with-http_stub_status_module} \
434 %{?with_ssl:--with-http_ssl_module} \
435 %{!?with_http_browser:--without-http_browser_module} \
436 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
437 %{?with_auth_request:--with-http_auth_request_module} \
438 %{?with_threads:--with-threads} \
439 --with-http_secure_link_module \
440 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
441 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
442 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
445 mv -f objs/%{name} bin/%{name}-standard
448 rm -rf $RPM_BUILD_ROOT
449 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
450 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
451 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
452 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
453 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
454 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
455 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
456 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
458 cp -p conf/*_params $RPM_BUILD_ROOT%{_sysconfdir}
459 cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
460 cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
461 cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
462 cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
463 cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
464 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
465 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
466 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
467 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
468 cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
469 cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
470 install -p %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
471 cp -p %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
472 install -p bin/nginx-standard $RPM_BUILD_ROOT%{_sbindir}
473 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
476 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
477 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
478 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
479 cp -p %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
480 install -p bin/nginx-light $RPM_BUILD_ROOT%{_sbindir}
484 cp -p %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
485 cp -p %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
486 install -p bin/nginx-mail $RPM_BUILD_ROOT%{_sbindir}
487 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
488 cp -p %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
492 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
493 cp -p %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
494 cp -p %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
495 install -p %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
496 cp -p %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
497 cp -p bin/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
498 install -p bin/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
499 install -p bin/nginx-perl $RPM_BUILD_ROOT%{_sbindir}
502 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
503 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
505 # only touch these for ghost packaging
506 touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params
509 rm -rf $RPM_BUILD_ROOT
512 %groupadd -r -g 213 %{name}
514 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
515 %addusertogroup %{name} http
518 for a in access.log error.log; do
519 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
521 touch /var/log/%{name}/nginx-standard_$a
522 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
523 chmod 644 /var/log/%{name}/nginx-standard_$a
526 /sbin/chkconfig --add %{name}-standard
527 %systemd_post %{name}-standard.service
528 %service %{name}-standard restart
529 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
530 if ! [ -L /etc/systemd/system/nginx.service ] ; then
531 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
535 for a in access.log error.log; do
536 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
538 touch /var/log/%{name}/nginx-light_$a
539 chown nginx:nginx /var/log/%{name}/nginx-light_$a
540 chmod 644 /var/log/%{name}/nginx-light_$a
543 /sbin/chkconfig --add %{name}-light
544 %systemd_post %{name}-light.service
545 %service %{name}-light restart
546 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
549 for a in access.log error.log; do
550 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
552 touch /var/log/%{name}/nginx-perl_$a
553 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
554 chmod 644 /var/log/%{name}/nginx-perl_$a
557 /sbin/chkconfig --add %{name}-perl
558 %systemd_post %{name}-perl.service
559 %service %{name}-perl restart
560 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
563 for a in access.log error.log; do
564 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
566 touch /var/log/%{name}/nginx-mail_$a
567 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
568 chmod 644 /var/log/%{name}/nginx-mail_$a
571 /sbin/chkconfig --add %{name}-mail
572 %systemd_post %{name}-mail.service
573 %service %{name}-mail restart
574 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
577 if [ "$1" = "0" ];then
578 %service %{name}-standard stop
579 /sbin/chkconfig --del %{name}-standard
581 %systemd_preun %{name}-standard.service
584 if [ "$1" = "0" ]; then
585 %service %{name}-light stop
586 /sbin/chkconfig --del %{name}-light
588 %systemd_preun %{name}-light.service
591 if [ "$1" = "0" ]; then
592 %service %{name}-perl stop
593 /sbin/chkconfig --del %{name}-perl
595 %systemd_preun %{name}-perl.service
598 if [ "$1" = "0" ]; then
599 %service %{name}-mail stop
600 /sbin/chkconfig --del %{name}-mail
602 %systemd_preun %{name}-mail.service
605 if [ "$1" = "0" ]; then
622 %triggerpostun -- %{name}-standard < 1.4.1-4
623 %systemd_trigger %{name}-standard.service
625 %triggerpostun -- %{name}-light < 1.4.1-4
626 %systemd_trigger %{name}-light.service
628 %triggerpostun -- %{name}-perl < 1.4.1-4
629 %systemd_trigger %{name}-perl.service
631 %triggerpostun -- %{name}-mail < 1.4.1-4
632 %systemd_trigger %{name}-mail.service
634 %triggerpostun common -- %{name}-common < 1.8.0-2
635 # skip *this* trigger on downgrade
636 [ $1 -le 1 ] && exit 0
637 ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params
638 ln -sf scgi_params %{_sysconfdir}/scgi.params
639 ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params
643 %defattr(644,root,root,755)
644 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
645 %doc %lang(ru) CHANGES.ru
646 %dir %attr(754,root,root) %{_sysconfdir}
648 %dir %{_nginxdir}/cgi-bin
649 %dir %{_nginxdir}/html
650 %dir %{_nginxdir}/errors
651 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
652 # XXX: duplicates, don't use such glob here
653 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
654 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
655 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params
656 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params
657 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params
658 %ghost %{_sysconfdir}/fastcgi.params
659 %ghost %{_sysconfdir}/scgi.params
660 %ghost %{_sysconfdir}/uwsgi.params
661 %attr(640,root,root) %{_sysconfdir}/mime.types
662 %attr(640,root,root) %{_sysconfdir}/koi-utf
663 %attr(640,root,root) %{_sysconfdir}/koi-win
664 %attr(640,root,root) %{_sysconfdir}/win-utf
665 %dir %{_sysconfdir}/webapps.d
666 %dir %{_sysconfdir}/vhosts.d
667 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
668 %attr(750,nginx,logs) /var/log/%{name}
669 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
670 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
671 %ghost /etc/systemd/system/nginx.service
674 %defattr(644,root,root,755)
675 %attr(755,root,root) %{_sbindir}/%{name}-standard
676 %attr(770,root,%{name}) /var/cache/%{name}-standard
677 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
678 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
679 %{systemdunitdir}/%{name}-standard.service
683 %defattr(644,root,root,755)
684 %attr(755,root,root) %{_sbindir}/%{name}-mail
685 %attr(770,root,%{name}) /var/cache/%{name}-mail
686 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
687 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
688 %{systemdunitdir}/%{name}-mail.service
693 %defattr(644,root,root,755)
694 %attr(755,root,root) %{_sbindir}/%{name}-light
695 %attr(770,root,%{name}) /var/cache/%{name}-light
696 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
697 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
698 %{systemdunitdir}/%{name}-light.service
703 %defattr(644,root,root,755)
704 %attr(755,root,root) %{_sbindir}/%{name}-perl
705 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
706 %attr(770,root,%{name}) /var/cache/%{name}-perl
707 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
708 %dir %{perl_vendorarch}/auto/%{name}
709 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
710 %{perl_vendorarch}/%{name}.pm
711 %{systemdunitdir}/%{name}-perl.service
714 %files -n monit-rc-nginx
715 %defattr(644,root,root,755)
716 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
718 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
721 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
724 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc