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
52 Source8: %{name}-mail.conf
53 Source9: %{name}-mail.monitrc
54 Source11: %{name}-perl.conf
55 Source12: %{name}-perl.monitrc
56 Source14: %{name}-standard.conf
57 Source15: %{name}-standard.monitrc
58 Source17: %{name}-mime.types.sh
59 Source18: %{name}-standard.service
60 Source19: %{name}-light.service
61 Source20: %{name}-perl.service
62 Source21: %{name}-mail.service
63 Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
64 # Source101-md5: 8006de2560db3e55bb15d110220076ac
65 Patch0: %{name}-no-Werror.patch
66 URL: http://nginx.net/
67 BuildRequires: mailcap
68 BuildRequires: openssl-devel
69 BuildRequires: pcre-devel
70 %{?with_perl:BuildRequires: perl-CGI}
71 %{?with_perl:BuildRequires: perl-devel}
72 %{?with_perl:BuildRequires: python}
73 %{?with_perl:BuildRequires: rpm-perlprov}
74 BuildRequires: rpmbuild(macros) >= 1.644
75 BuildRequires: zlib-devel
76 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
78 %define _sysconfdir /etc/%{name}
79 %define _nginxdir /home/services/%{name}
82 nginx ("engine x") is a high-performance HTTP server and reverse
83 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
84 Sysoev for Rambler.ru, Russia's second-most visited website, where it
85 has been running in production for over two and a half years. Igor has
86 released the source code under a BSD-like license. Although still in
87 beta, nginx is known for its stability, rich feature set, simple
88 configuration, and low resource consumption.
90 %description -l pl.UTF-8
91 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
92 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
93 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
94 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
95 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
96 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
97 prostej konfiguracji oraz małej "zasobożerności".
100 Summary: nginx - common files
101 Summary(pl.UTF-8): nginx - pliki wspólne
102 Group: Networking/Daemons/HTTP
103 Requires(postun): /usr/sbin/groupdel
104 Requires(postun): /usr/sbin/userdel
105 Requires(pre): /bin/id
106 Requires(pre): /usr/bin/getgid
107 Requires(pre): /usr/sbin/groupadd
108 Requires(pre): /usr/sbin/useradd
111 Requires: rc-scripts >= 0.2.0
112 Requires: systemd-units >= 38
114 Provides: group(http)
115 Provides: group(nginx)
116 Provides: user(nginx)
118 Obsoletes: nginx < 1.4.1-4.1
119 Conflicts: logrotate < 3.8.0
122 Common files for the nginx daemon.
124 %description common -l pl.UTF-8
125 Niezbędne pliki dla nginx.
128 Summary: High perfomance HTTP and reverse proxy server
129 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
130 Group: Networking/Daemons/HTTP
131 Requires(post,preun): /sbin/chkconfig
132 Requires(post,preun,postun): systemd-units >= 38
133 Requires: %{name}-common = %{version}-%{release}
137 Provides: nginx-daemon
141 nginx ("engine x") is a high-performance HTTP server and reverse
142 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
143 Sysoev for Rambler.ru, Russia's second-most visited website, where it
144 has been running in production for over two and a half years. Igor has
145 released the source code under a BSD-like license. Although still in
146 beta, nginx is known for its stability, rich feature set, simple
147 configuration, and low resource consumption.
149 The smallest, but also the fastest nginx edition. No additional
150 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
152 %description light -l pl.UTF-8
153 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
154 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
155 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
156 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
157 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
158 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
159 prostej konfiguracji oraz małej "zasobożerności".
161 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
162 FLV oraz IMAP, POP3, SMTP proxy.
165 Summary: High perfomance HTTP and reverse proxy server
166 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
167 Group: Networking/Daemons/HTTP
168 Requires(post,preun): /sbin/chkconfig
169 Requires(post,preun,postun): systemd-units >= 38
170 Requires: %{name}-common = %{version}-%{release}
172 Provides: nginx-daemon
176 nginx ("engine x") is a high-performance HTTP server and reverse
177 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
178 Sysoev for Rambler.ru, Russia's second-most visited website, where it
179 has been running in production for over two and a half years. Igor has
180 released the source code under a BSD-like license. Although still in
181 beta, nginx is known for its stability, rich feature set, simple
182 configuration, and low resource consumption.
184 nginx with Perl support. Mail modules not included.
186 %description perl -l pl.UTF-8
187 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
188 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
189 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
190 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
191 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
192 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
193 prostej konfiguracji oraz małej "zasobożerności".
195 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
198 Summary: High perfomance IMAP, POP3, SMTP proxy server
199 Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
200 Group: Networking/Daemons/HTTP
201 Requires(post,preun): /sbin/chkconfig
202 Requires(post,preun,postun): systemd-units >= 38
203 Requires: %{name}-common = %{version}-%{release}
207 Provides: nginx-daemon
210 nginx ("engine x") is a high-performance HTTP server and reverse
211 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
212 Sysoev for Rambler.ru, Russia's second-most visited website, where it
213 has been running in production for over two and a half years. Igor has
214 released the source code under a BSD-like license. Although still in
215 beta, nginx is known for its stability, rich feature set, simple
216 configuration, and low resource consumption.
218 nginx with mail support. Only mail modules included.
220 %description mail -l pl.UTF-8
221 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
222 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
223 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
224 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
225 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
226 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
227 prostej konfiguracji oraz małej "zasobożerności".
229 nginx ze wsparciem tylko dla modułów poczty.
232 Summary: High perfomance HTTP and reverse proxy server
233 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
234 Group: Networking/Daemons/HTTP
235 Requires(post,preun): /sbin/chkconfig
236 Requires(post,preun,postun): systemd-units >= 38
237 Requires: %{name}-common = %{version}-%{release}
240 Provides: nginx-daemon
241 Conflicts: logrotate < 3.7-4
243 %description standard
244 nginx ("engine x") is a high-performance HTTP server and reverse
245 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
246 Sysoev for Rambler.ru, Russia's second-most visited website, where it
247 has been running in production for over two and a half years. Igor has
248 released the source code under a BSD-like license. Although still in
249 beta, nginx is known for its stability, rich feature set, simple
250 configuration, and low resource consumption.
252 This is standard nginx version, without Perl support and IMAP, POP3,
255 %description standard -l pl.UTF-8
256 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
257 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
258 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
259 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
260 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
261 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
262 prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x")
263 jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3
264 proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu
265 Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji
266 i działa od ponad dwóch i pół roku. Igor opublikował źródła na
267 licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął
268 dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej
271 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
274 %package -n monit-rc-nginx
275 Summary: nginx support for monit
276 Summary(pl.UTF-8): Wsparcie nginx dla monit
277 Group: Applications/System
278 URL: http://nginx.eu/
279 Requires: %{name}-common = %{version}-%{release}
282 %description -n monit-rc-nginx
283 monitrc file for monitoring nginx webserver.
285 %description -n monit-rc-nginx -l pl.UTF-8
286 Plik monitrc do monitorowania serwera WWW nginx.
289 %setup -q %{?with_rtmp:-a101}
293 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
296 # build mime.types.conf
297 #sh %{SOURCE17} /etc/mime.types
300 # NB: not autoconf generated configure
301 cp -f configure auto/
305 # build with common options
308 --prefix=%{_prefix} \
311 --with-cc="%{__cc}" \
312 --with-cc-opt="%{rpmcflags}" \
313 --with-ld-opt="%{rpmldflags}" \
314 %{?with_debug:--with-debug} \
321 --sbin-path=%{_sbindir}/%{name}-perl \
322 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
323 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
324 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
325 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
326 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
327 --with-http_perl_module \
328 --without-mail_pop3_module \
329 --without-mail_imap_module \
330 --without-mail_smtp_module \
331 %{?with_addition:--with-http_addition_module} \
332 %{?with_dav:--with-http_dav_module} \
333 %{?with_flv:--with-http_flv_module} \
334 %{?with_ipv6:--with-ipv6} \
335 %{?with_sub:--with-http_sub_module} \
336 %{?with_poll:--with-poll_module} \
337 %{?with_realip:--with-http_realip_module} \
338 %{?with_rtsig:--with-rtsig_module} \
339 %{?with_select:--with-select_module} \
340 %{?with_status:--with-http_stub_status_module} \
341 %{?with_ssl:--with-http_ssl_module} \
342 %{!?with_http_browser:--without-http_browser_module} \
343 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
344 %{?with_auth_request:--with-http_auth_request_module} \
345 %{?with_threads:--with-threads} \
346 %{?with_spdy:--with-http_spdy_module} \
347 --with-http_secure_link_module \
348 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
349 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
350 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
353 mv -f objs/nginx bin/nginx-perl
354 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so
355 mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm
360 --sbin-path=%{_sbindir}/%{name}-mail \
361 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
362 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
363 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
364 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
365 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
368 --with-mail_ssl_module \
370 %{?with_ipv6:--with-ipv6} \
371 %{?with_poll:--with-poll_module} \
372 %{?with_rtsig:--with-rtsig_module} \
373 %{?with_select:--with-select_module} \
374 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
375 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
376 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
379 mv -f objs/nginx bin/nginx-mail
384 --sbin-path=%{_sbindir}/%{name}-light \
385 --conf-path=%{_sysconfdir}/%{name}-light.conf \
386 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
387 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
388 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
389 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
390 %{?with_ipv6:--with-ipv6} \
391 %{?with_poll:--with-poll_module} \
392 %{?with_realip:--with-http_realip_module} \
393 %{?with_rtsig:--with-rtsig_module} \
394 %{?with_select:--with-select_module} \
395 %{?with_status:--with-http_stub_status_module} \
396 %{?with_ssl:--with-http_ssl_module} \
397 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
398 %{?with_auth_request:--with-http_auth_request_module} \
399 %{?with_threads:--with-threads} \
400 %{?with_spdy:--with-http_spdy_module} \
401 --without-http_browser_module \
402 --without-mail_pop3_module \
403 --without-mail_imap_module \
404 --without-mail_smtp_module \
405 --with-http_secure_link_module \
406 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
407 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
408 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
411 mv -f objs/nginx bin/nginx-light
415 --sbin-path=%{_sbindir}/%{name}-standard \
416 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
417 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
418 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
419 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
420 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
421 %{?with_addition:--with-http_addition_module} \
422 %{?with_dav:--with-http_dav_module} \
423 %{?with_flv:--with-http_flv_module} \
424 %{?with_ipv6:--with-ipv6} \
425 %{?with_sub:--with-http_sub_module} \
426 %{?with_poll:--with-poll_module} \
427 %{?with_realip:--with-http_realip_module} \
428 %{?with_rtsig:--with-rtsig_module} \
429 %{?with_select:--with-select_module} \
430 %{?with_status:--with-http_stub_status_module} \
431 %{?with_ssl:--with-http_ssl_module} \
432 %{!?with_http_browser:--without-http_browser_module} \
433 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
434 %{?with_auth_request:--with-http_auth_request_module} \
435 %{?with_threads:--with-threads} \
436 --with-http_secure_link_module \
437 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
438 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
439 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
442 mv -f objs/%{name} bin/%{name}-standard
445 rm -rf $RPM_BUILD_ROOT
446 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
447 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
448 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
449 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
450 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
451 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
452 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
453 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
455 cp -p conf/*_params $RPM_BUILD_ROOT%{_sysconfdir}
456 cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
457 cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
458 cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
459 cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
460 cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
461 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
462 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
463 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
464 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
465 cp -p %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
466 cp -p %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
467 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
468 %{__sed} -i -e 's/@flavor@/standard/g' $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
469 cp -p %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
470 install -p bin/nginx-standard $RPM_BUILD_ROOT%{_sbindir}
471 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
474 cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
475 cp -p %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
476 cp -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
477 %{__sed} -i -e 's/@flavor@/light/g' $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 %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
487 %{__sed} -i -e 's/@flavor@/mail/g' $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 %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
496 %{__sed} -i -e 's/@flavor@/perl/g' $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
497 cp -p %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
498 cp -p bin/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
499 install -p bin/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
500 install -p bin/nginx-perl $RPM_BUILD_ROOT%{_sbindir}
503 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
504 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
506 # only touch these for ghost packaging
507 touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params
510 rm -rf $RPM_BUILD_ROOT
513 %groupadd -r -g 213 %{name}
515 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
516 %addusertogroup %{name} http
519 for a in access.log error.log; do
520 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
522 touch /var/log/%{name}/nginx-standard_$a
523 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
524 chmod 644 /var/log/%{name}/nginx-standard_$a
527 /sbin/chkconfig --add %{name}-standard
528 %systemd_post %{name}-standard.service
529 %service %{name}-standard restart
530 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
531 if ! [ -L /etc/systemd/system/nginx.service ] ; then
532 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
536 for a in access.log error.log; do
537 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
539 touch /var/log/%{name}/nginx-light_$a
540 chown nginx:nginx /var/log/%{name}/nginx-light_$a
541 chmod 644 /var/log/%{name}/nginx-light_$a
544 /sbin/chkconfig --add %{name}-light
545 %systemd_post %{name}-light.service
546 %service %{name}-light restart
547 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
550 for a in access.log error.log; do
551 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
553 touch /var/log/%{name}/nginx-perl_$a
554 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
555 chmod 644 /var/log/%{name}/nginx-perl_$a
558 /sbin/chkconfig --add %{name}-perl
559 %systemd_post %{name}-perl.service
560 %service %{name}-perl restart
561 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
564 for a in access.log error.log; do
565 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
567 touch /var/log/%{name}/nginx-mail_$a
568 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
569 chmod 644 /var/log/%{name}/nginx-mail_$a
572 /sbin/chkconfig --add %{name}-mail
573 %systemd_post %{name}-mail.service
574 %service %{name}-mail restart
575 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
578 if [ "$1" = "0" ];then
579 %service %{name}-standard stop
580 /sbin/chkconfig --del %{name}-standard
582 %systemd_preun %{name}-standard.service
585 if [ "$1" = "0" ]; then
586 %service %{name}-light stop
587 /sbin/chkconfig --del %{name}-light
589 %systemd_preun %{name}-light.service
592 if [ "$1" = "0" ]; then
593 %service %{name}-perl stop
594 /sbin/chkconfig --del %{name}-perl
596 %systemd_preun %{name}-perl.service
599 if [ "$1" = "0" ]; then
600 %service %{name}-mail stop
601 /sbin/chkconfig --del %{name}-mail
603 %systemd_preun %{name}-mail.service
606 if [ "$1" = "0" ]; then
623 %triggerpostun -- %{name}-standard < 1.4.1-4
624 %systemd_trigger %{name}-standard.service
626 %triggerpostun -- %{name}-light < 1.4.1-4
627 %systemd_trigger %{name}-light.service
629 %triggerpostun -- %{name}-perl < 1.4.1-4
630 %systemd_trigger %{name}-perl.service
632 %triggerpostun -- %{name}-mail < 1.4.1-4
633 %systemd_trigger %{name}-mail.service
635 %triggerpostun common -- %{name}-common < 1.8.0-2
636 # skip *this* trigger on downgrade
637 [ $1 -le 1 ] && exit 0
638 ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params
639 ln -sf scgi_params %{_sysconfdir}/scgi.params
640 ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params
644 %defattr(644,root,root,755)
645 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
646 %doc %lang(ru) CHANGES.ru
647 %dir %attr(754,root,root) %{_sysconfdir}
649 %dir %{_nginxdir}/cgi-bin
650 %dir %{_nginxdir}/html
651 %dir %{_nginxdir}/errors
652 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
653 # XXX: duplicates, don't use such glob here
654 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
655 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
656 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params
657 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params
658 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params
659 %ghost %{_sysconfdir}/fastcgi.params
660 %ghost %{_sysconfdir}/scgi.params
661 %ghost %{_sysconfdir}/uwsgi.params
662 %attr(640,root,root) %{_sysconfdir}/mime.types
663 %attr(640,root,root) %{_sysconfdir}/koi-utf
664 %attr(640,root,root) %{_sysconfdir}/koi-win
665 %attr(640,root,root) %{_sysconfdir}/win-utf
666 %dir %{_sysconfdir}/webapps.d
667 %dir %{_sysconfdir}/vhosts.d
668 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
669 %attr(750,nginx,logs) /var/log/%{name}
670 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
671 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
672 %ghost /etc/systemd/system/nginx.service
675 %defattr(644,root,root,755)
676 %attr(755,root,root) %{_sbindir}/%{name}-standard
677 %attr(770,root,%{name}) /var/cache/%{name}-standard
678 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
679 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
680 %{systemdunitdir}/%{name}-standard.service
684 %defattr(644,root,root,755)
685 %attr(755,root,root) %{_sbindir}/%{name}-mail
686 %attr(770,root,%{name}) /var/cache/%{name}-mail
687 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
688 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
689 %{systemdunitdir}/%{name}-mail.service
694 %defattr(644,root,root,755)
695 %attr(755,root,root) %{_sbindir}/%{name}-light
696 %attr(770,root,%{name}) /var/cache/%{name}-light
697 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
698 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
699 %{systemdunitdir}/%{name}-light.service
704 %defattr(644,root,root,755)
705 %attr(755,root,root) %{_sbindir}/%{name}-perl
706 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
707 %attr(770,root,%{name}) /var/cache/%{name}-perl
708 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
709 %dir %{perl_vendorarch}/auto/%{name}
710 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
711 %{perl_vendorarch}/%{name}.pm
712 %{systemdunitdir}/%{name}-perl.service
715 %files -n monit-rc-nginx
716 %defattr(644,root,root,755)
717 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
719 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
722 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
725 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc