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/
6 # Conditional build for nginx:
7 %bcond_without light # don't build light version
8 %bcond_without mail # don't build imap/mail proxy
9 %bcond_without perl # don't build with perl module
10 %bcond_without addition # adds module
11 %bcond_without dav # WebDAV
12 %bcond_without flv # FLV stream
13 %bcond_without ipv6 # build without ipv6 support
14 %bcond_without sub # ngx_http_sub_module
15 %bcond_without poll # poll
16 %bcond_without realip # real ip (behind proxy)
17 %bcond_without rtsig # rtsig
18 %bcond_without select # select
19 %bcond_without status # stats module
20 %bcond_without ssl # ssl support
21 %bcond_with http_browser # header "User-agent" parser
22 %bcond_without rtmp # rtmp support
24 %define rtmp_version 1.0.2
25 Summary: High perfomance HTTP and reverse proxy server
26 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
31 Group: Networking/Daemons/HTTP
32 Source0: http://nginx.org/download/%{name}-%{version}.tar.gz
33 # Source0-md5: 5dfaba1cbeae9087f3949860a02caa9f
34 Source1: http://nginx.net/favicon.ico
35 # Source1-md5: 2aaf2115c752cbdbfb8a2f0b3c3189ab
37 Source3: %{name}.logrotate
39 Source5: %{name}-light.conf
40 Source6: %{name}-light.monitrc
41 Source7: %{name}-light.init
42 Source8: %{name}-mail.conf
43 Source9: %{name}-mail.monitrc
44 Source10: %{name}-mail.init
45 Source11: %{name}-perl.conf
46 Source12: %{name}-perl.monitrc
47 Source13: %{name}-perl.init
48 Source14: %{name}-standard.conf
49 Source15: %{name}-standard.monitrc
50 Source16: %{name}-standard.init
51 Source17: %{name}-mime.types.sh
52 Source18: %{name}-standard.service
53 Source19: %{name}-light.service
54 Source20: %{name}-perl.service
55 Source21: %{name}-mail.service
56 Source101: https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}.tar.gz
57 # Source101-md5: 989659b13382e4ee3649fcaa6573c08e
58 Patch0: nginx-no-Werror.patch
59 URL: http://nginx.net/
60 BuildRequires: mailcap
61 BuildRequires: openssl-devel
62 BuildRequires: pcre-devel
63 %{?with_perl:BuildRequires: perl-CGI}
64 %{?with_perl:BuildRequires: perl-devel}
65 %{?with_perl:BuildRequires: python}
66 %{?with_perl:BuildRequires: rpm-perlprov}
67 BuildRequires: rpmbuild(macros) >= 1.644
68 BuildRequires: zlib-devel
69 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71 %define _sysconfdir /etc/%{name}
72 %define _nginxdir /home/services/%{name}
75 nginx ("engine x") is a high-performance HTTP server and reverse
76 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
77 Sysoev for Rambler.ru, Russia's second-most visited website, where it
78 has been running in production for over two and a half years. Igor has
79 released the source code under a BSD-like license. Although still in
80 beta, nginx is known for its stability, rich feature set, simple
81 configuration, and low resource consumption.
83 %description -l pl.UTF-8
84 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
85 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
86 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
87 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
88 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
89 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
90 prostej konfiguracji oraz małej "zasobożerności".
93 Summary: nginx - common files
94 Summary(pl.UTF-8): nginx - pliki wspólne
95 Group: Networking/Daemons/HTTP
96 Requires(postun): /usr/sbin/groupdel
97 Requires(postun): /usr/sbin/userdel
98 Requires(pre): /bin/id
99 Requires(pre): /usr/bin/getgid
100 Requires(pre): /usr/sbin/groupadd
101 Requires(pre): /usr/sbin/useradd
104 Requires: rc-scripts >= 0.2.0
105 Requires: systemd-units >= 38
107 Provides: group(http)
108 Provides: group(nginx)
109 Provides: user(nginx)
111 Conflicts: logrotate < 3.8.0
112 Obsoletes: %{name} < 1.4.1-4.1
115 Common files for the nginx daemon.
117 %description common -l pl.UTF-8
118 Niezbędne pliki dla nginx.
121 Summary: High perfomance HTTP and reverse proxy server
122 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
123 Group: Networking/Daemons/HTTP
124 Requires(post,preun): /sbin/chkconfig
125 Requires(post,preun,postun): systemd-units >= 38
126 Requires: %{name}-common = %{version}-%{release}
130 Provides: nginx-daemon
134 nginx ("engine x") is a high-performance HTTP server and reverse
135 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
136 Sysoev for Rambler.ru, Russia's second-most visited website, where it
137 has been running in production for over two and a half years. Igor has
138 released the source code under a BSD-like license. Although still in
139 beta, nginx is known for its stability, rich feature set, simple
140 configuration, and low resource consumption.
142 The smallest, but also the fastest nginx edition. No additional
143 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
145 %description light -l pl.UTF-8
146 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
147 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
148 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
149 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
150 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
151 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
152 prostej konfiguracji oraz małej "zasobożerności".
154 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
155 FLV oraz IMAP, POP3, SMTP proxy.
158 Summary: High perfomance HTTP and reverse proxy server
159 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
160 Group: Networking/Daemons/HTTP
161 Requires(post,preun): /sbin/chkconfig
162 Requires(post,preun,postun): systemd-units >= 38
163 Requires: %{name}-common = %{version}-%{release}
165 Provides: nginx-daemon
169 nginx ("engine x") is a high-performance HTTP server and reverse
170 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
171 Sysoev for Rambler.ru, Russia's second-most visited website, where it
172 has been running in production for over two and a half years. Igor has
173 released the source code under a BSD-like license. Although still in
174 beta, nginx is known for its stability, rich feature set, simple
175 configuration, and low resource consumption.
177 nginx with Perl support. Mail modules not included.
179 %description perl -l pl.UTF-8
180 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
181 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
182 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
183 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
184 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
185 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
186 prostej konfiguracji oraz małej "zasobożerności".
188 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
191 Summary: High perfomance IMAP, POP3, SMTP proxy server
192 Summary(pl.UTF-8): IMAP, POP3, SMTP proxy o wysokiej wydajności
193 Group: Networking/Daemons/HTTP
194 Requires(post,preun): /sbin/chkconfig
195 Requires(post,preun,postun): systemd-units >= 38
196 Requires: %{name}-common = %{version}-%{release}
200 Provides: nginx-daemon
203 nginx ("engine x") is a high-performance HTTP server and reverse
204 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
205 Sysoev for Rambler.ru, Russia's second-most visited website, where it
206 has been running in production for over two and a half years. Igor has
207 released the source code under a BSD-like license. Although still in
208 beta, nginx is known for its stability, rich feature set, simple
209 configuration, and low resource consumption.
211 nginx with mail support. Only mail modules included.
213 %description mail -l pl.UTF-8
214 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
215 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
216 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
217 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
218 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
219 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
220 prostej konfiguracji oraz małej "zasobożerności".
222 nginx ze wsparciem tylko dla modułów poczty.
225 Summary: High perfomance HTTP and reverse proxy server
226 Summary(pl.UTF-8): Serwer HTTP i odwrotne proxy o wysokiej wydajności
227 Group: Networking/Daemons/HTTP
228 Requires(post,preun): /sbin/chkconfig
229 Requires(post,preun,postun): systemd-units >= 38
230 Requires: %{name}-common = %{version}-%{release}
233 Provides: nginx-daemon
234 Conflicts: logrotate < 3.7-4
236 %description standard
237 nginx ("engine x") is a high-performance HTTP server and reverse
238 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
239 Sysoev for Rambler.ru, Russia's second-most visited website, where it
240 has been running in production for over two and a half years. Igor has
241 released the source code under a BSD-like license. Although still in
242 beta, nginx is known for its stability, rich feature set, simple
243 configuration, and low resource consumption.
245 This is standard nginx version, without Perl support and IMAP, POP3,
248 %description standard -l pl.UTF-8
249 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
250 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
251 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
252 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
253 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
254 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
255 prostej konfiguracji oraz małej "zasobożerności".
256 ginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
257 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva
258 na 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
261 w fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
262 prostej konfiguracji oraz małej "zasobożerności".
264 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
267 %package -n monit-rc-nginx
268 Summary: nginx support for monit
269 Summary(pl.UTF-8): Wsparcie nginx dla monit
270 Group: Applications/System
271 URL: http://nginx.eu/
272 Requires: %{name}-common = %{version}-%{release}
275 %description -n monit-rc-nginx
276 monitrc file for monitoring nginx webserver.
278 %description -n monit-rc-nginx -l pl.UTF-8
279 Plik monitrc do monitorowania serwera WWW nginx.
282 %setup -q %{?with_rtmp:-a101}
286 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
289 # build mime.types.conf
290 #sh %{SOURCE17} /etc/mime.types
293 # NB: not autoconf generated configure
294 cp -f configure auto/
298 --prefix=%{_prefix} \
299 --sbin-path=%{_sbindir}/%{name}-perl \
300 --conf-path=%{_sysconfdir}/%{name}-perl.conf \
301 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
302 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
303 --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
304 --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
307 --with-http_perl_module \
308 --without-mail_pop3_module \
309 --without-mail_imap_module \
310 --without-mail_smtp_module \
311 %{?with_addition:--with-http_addition_module} \
312 %{?with_dav:--with-http_dav_module} \
313 %{?with_flv:--with-http_flv_module} \
314 %{?with_ipv6:--with-ipv6} \
315 %{?with_sub:--with-http_sub_module} \
316 %{?with_poll:--with-poll_module} \
317 %{?with_realip:--with-http_realip_module} \
318 %{?with_rtsig:--with-rtsig_module} \
319 %{?with_select:--with-select_module} \
320 %{?with_status:--with-http_stub_status_module} \
321 %{?with_ssl:--with-http_ssl_module} \
322 %{!?with_http_browser:--without-http_browser_module} \
323 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
324 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
325 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
326 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
327 --with-cc="%{__cc}" \
328 --with-cc-opt="%{rpmcflags}" \
329 --with-ld-opt="%{rpmldflags}"
331 mv -f objs/nginx contrib/nginx-perl
332 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs
333 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
334 mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
339 --prefix=%{_prefix} \
340 --sbin-path=%{_sbindir}/%{name}-mail \
341 --conf-path=%{_sysconfdir}/%{name}-mail.conf \
342 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
343 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
344 --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
345 --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
350 --with-mail_ssl_module \
352 %{?with_ipv6:--with-ipv6} \
353 %{?with_poll:--with-poll_module} \
354 %{?with_rtsig:--with-rtsig_module} \
355 %{?with_select:--with-select_module} \
356 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
357 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
358 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
359 --with-cc="%{__cc}" \
360 --with-cc-opt="%{rpmcflags}" \
361 --with-ld-opt="%{rpmldflags}" \
362 %{?debug:--with-debug}
364 mv -f objs/nginx contrib/nginx-mail
369 --prefix=%{_prefix} \
370 --sbin-path=%{_sbindir}/%{name}-light \
371 --conf-path=%{_sysconfdir}/%{name}-light.conf \
372 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
373 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
374 --pid-path=%{_localstatedir}/run/%{name}-light.pid \
375 --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
378 %{?with_ipv6:--with-ipv6} \
379 %{?with_poll:--with-poll_module} \
380 %{?with_realip:--with-http_realip_module} \
381 %{?with_rtsig:--with-rtsig_module} \
382 %{?with_select:--with-select_module} \
383 %{?with_status:--with-http_stub_status_module} \
384 %{?with_ssl:--with-http_ssl_module} \
385 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
386 --without-http_browser_module \
387 --without-mail_pop3_module \
388 --without-mail_imap_module \
389 --without-mail_smtp_module \
390 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
391 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
392 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
393 --with-cc="%{__cc}" \
394 --with-cc-opt="%{rpmcflags}" \
395 --with-ld-opt="%{rpmldflags}" \
396 %{?debug:--with-debug}
398 mv -f objs/nginx contrib/nginx-light
402 --prefix=%{_prefix} \
403 --sbin-path=%{_sbindir}/%{name}-standard \
404 --conf-path=%{_sysconfdir}/%{name}-standard.conf \
405 --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
406 --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
407 --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
408 --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
411 %{?with_addition:--with-http_addition_module} \
412 %{?with_dav:--with-http_dav_module} \
413 %{?with_flv:--with-http_flv_module} \
414 %{?with_ipv6:--with-ipv6} \
415 %{?with_sub:--with-http_sub_module} \
416 %{?with_poll:--with-poll_module} \
417 %{?with_realip:--with-http_realip_module} \
418 %{?with_rtsig:--with-rtsig_module} \
419 %{?with_select:--with-select_module} \
420 %{?with_status:--with-http_stub_status_module} \
421 %{?with_ssl:--with-http_ssl_module} \
422 %{!?with_http_browser:--without-http_browser_module} \
423 %{?with_rtmp:--add-module=./nginx-rtmp-module} \
424 --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
425 --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
426 --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
427 --with-cc="%{__cc}" \
428 --with-cc-opt="%{rpmcflags}" \
429 --with-ld-opt="%{rpmldflags}" \
430 %{?debug:--with-debug}
435 rm -rf $RPM_BUILD_ROOT
436 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
437 $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
438 $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
439 $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
440 $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
441 $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
442 $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
443 $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
445 install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
446 install conf/scgi_params $RPM_BUILD_ROOT%{_sysconfdir}/scgi.params
447 install conf/uwsgi_params $RPM_BUILD_ROOT%{_sysconfdir}/uwsgi.params
448 install conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
449 install conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
450 install conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
451 install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
452 install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
453 install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
454 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
455 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
456 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
457 install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
458 install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
459 install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
460 install %{SOURCE18} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-standard.service
461 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
462 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
465 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
466 install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
467 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
468 install %{SOURCE19} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-light.service
469 install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
473 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
474 install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
475 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
476 install %{SOURCE21} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-mail.service
477 install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
481 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
482 install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
483 install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
484 install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
485 install %{SOURCE20} $RPM_BUILD_ROOT%{systemdunitdir}/%{name}-perl.service
486 install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
487 install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
488 install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
489 install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
492 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
493 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
496 rm -rf $RPM_BUILD_ROOT
499 %groupadd -r -g 213 %{name}
501 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
502 %addusertogroup %{name} http
505 for a in access.log error.log; do
506 if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
508 touch /var/log/%{name}/nginx-standard_$a
509 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
510 chmod 644 /var/log/%{name}/nginx-standard_$a
513 /sbin/chkconfig --add %{name}-standard
514 %systemd_post %{name}-standard.service
515 %service %{name}-standard restart
516 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
517 if ! [ -L /etc/systemd/system/nginx.service ] ; then
518 ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
522 for a in access.log error.log; do
523 if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
525 touch /var/log/%{name}/nginx-light_$a
526 chown nginx:nginx /var/log/%{name}/nginx-light_$a
527 chmod 644 /var/log/%{name}/nginx-light_$a
530 /sbin/chkconfig --add %{name}-light
531 %systemd_post %{name}-light.service
532 %service %{name}-light restart
533 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
536 for a in access.log error.log; do
537 if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
539 touch /var/log/%{name}/nginx-perl_$a
540 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
541 chmod 644 /var/log/%{name}/nginx-perl_$a
544 /sbin/chkconfig --add %{name}-perl
545 %systemd_post %{name}-perl.service
546 %service %{name}-perl restart
547 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
550 for a in access.log error.log; do
551 if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
553 touch /var/log/%{name}/nginx-mail_$a
554 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
555 chmod 644 /var/log/%{name}/nginx-mail_$a
558 /sbin/chkconfig --add %{name}-mail
559 %systemd_post %{name}-mail.service
560 %service %{name}-mail restart
561 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
564 if [ "$1" = "0" ];then
565 %service %{name}-standard stop
566 /sbin/chkconfig --del %{name}-standard
568 %systemd_preun %{name}-standard.service
571 if [ "$1" = "0" ]; then
572 %service %{name}-light stop
573 /sbin/chkconfig --del %{name}-light
575 %systemd_preun %{name}-light.service
578 if [ "$1" = "0" ]; then
579 %service %{name}-perl stop
580 /sbin/chkconfig --del %{name}-perl
582 %systemd_preun %{name}-perl.service
585 if [ "$1" = "0" ]; then
586 %service %{name}-mail stop
587 /sbin/chkconfig --del %{name}-mail
589 %systemd_preun %{name}-mail.service
592 if [ "$1" = "0" ]; then
609 %triggerpostun -- %{name}-standard < 1.4.1-4
610 %systemd_trigger %{name}-standard.service
612 %triggerpostun -- %{name}-light < 1.4.1-4
613 %systemd_trigger %{name}-light.service
615 %triggerpostun -- %{name}-perl < 1.4.1-4
616 %systemd_trigger %{name}-perl.service
618 %triggerpostun -- %{name}-mail < 1.4.1-4
619 %systemd_trigger %{name}-mail.service
622 %defattr(644,root,root,755)
623 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
624 %doc %lang(ru) CHANGES.ru
625 %dir %attr(754,root,root) %{_sysconfdir}
627 %dir %{_nginxdir}/cgi-bin
628 %dir %{_nginxdir}/html
629 %dir %{_nginxdir}/errors
630 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
631 # XXX: duplicates, don't use such glob here
632 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
633 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
634 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi.params
635 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi.params
636 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi.params
637 %attr(640,root,root) %{_sysconfdir}/mime.types
638 %attr(640,root,root) %{_sysconfdir}/koi-utf
639 %attr(640,root,root) %{_sysconfdir}/koi-win
640 %attr(640,root,root) %{_sysconfdir}/win-utf
641 %dir %{_sysconfdir}/webapps.d
642 %dir %{_sysconfdir}/vhosts.d
643 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
644 %attr(750,nginx,logs) /var/log/%{name}
645 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
646 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
647 %ghost /etc/systemd/system/nginx.service
650 %defattr(644,root,root,755)
651 %attr(755,root,root) %{_sbindir}/%{name}-standard
652 %attr(770,root,%{name}) /var/cache/%{name}-standard
653 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
654 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
655 %{systemdunitdir}/%{name}-standard.service
659 %defattr(644,root,root,755)
660 %attr(755,root,root) %{_sbindir}/%{name}-mail
661 %attr(770,root,%{name}) /var/cache/%{name}-mail
662 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
663 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
664 %{systemdunitdir}/%{name}-mail.service
669 %defattr(644,root,root,755)
670 %attr(755,root,root) %{_sbindir}/%{name}-light
671 %attr(770,root,%{name}) /var/cache/%{name}-light
672 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
673 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
674 %{systemdunitdir}/%{name}-light.service
679 %defattr(644,root,root,755)
680 %attr(755,root,root) %{_sbindir}/%{name}-perl
681 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
682 %attr(770,root,%{name}) /var/cache/%{name}-perl
683 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
684 %dir %{perl_vendorarch}/auto/%{name}
685 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
686 %{perl_vendorarch}/auto/%{name}/%{name}.bs
687 %{perl_vendorarch}/%{name}.pm
688 %{systemdunitdir}/%{name}-perl.service
691 %files -n monit-rc-nginx
692 %defattr(644,root,root,755)
693 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
695 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
698 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
701 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc