]> git.pld-linux.org Git - packages/nginx.git/blob - nginx.spec
Version: 1.9.9, with HTTP/2 support
[packages/nginx.git] / nginx.spec
1 # TODO
2 # - /etc/sysconfig/nginx file
3 # - missing perl build/install requires
4 #
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  select          # select
17 %bcond_without  http2           # HTTP/2 module
18 %bcond_without  status          # status module
19 %bcond_without  ssl             # ssl support
20 %bcond_without  threads         # thread pool support
21 %bcond_with     http_browser    # header "User-agent" parser
22 %bcond_with     rtmp            # rtmp support
23 %bcond_with     debug           # enable debug logging: http://nginx.org/en/docs/debugging_log.html
24 %bcond_without  auth_request    # auth_request module
25 %bcond_with     modsecurity     # modsecurity module
26
27 %ifarch x32
28 %undefine       with_rtsig
29 %endif
30
31 %define         rtmp_version    1.1.7
32 %define         modsecurity_version     2.9.0
33 Summary:        High perfomance HTTP and reverse proxy server
34 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
35 # nginx lines:
36 # - stable: production quality with stable API
37 # - mainline: production quality but API can change
38 Name:           nginx
39 Version:        1.9.9
40 Release:        1
41 License:        BSD-like
42 Group:          Networking/Daemons/HTTP
43 Source0:        http://nginx.org/download/%{name}-%{version}.tar.gz
44 # Source0-md5:  50fdfa08e93ead7a111cba5a5f5735af
45 Source1:        http://nginx.net/favicon.ico
46 # Source1-md5:  2aaf2115c752cbdbfb8a2f0b3c3189ab
47 Source2:        proxy.conf
48 Source3:        %{name}.logrotate
49 Source4:        %{name}.mime
50 Source6:        %{name}-light.monitrc
51 Source7:        %{name}.init
52 Source8:        %{name}-mail.conf
53 Source9:        %{name}-mail.monitrc
54 Source12:       %{name}-perl.monitrc
55 Source14:       %{name}.conf
56 Source15:       %{name}-standard.monitrc
57 Source17:       %{name}-mime.types.sh
58 Source18:       %{name}-standard.service
59 Source19:       %{name}-light.service
60 Source20:       %{name}-perl.service
61 Source21:       %{name}-mail.service
62 Source22:       http://www.modsecurity.org/tarball/%{modsecurity_version}/modsecurity-%{modsecurity_version}.tar.gz
63 # Source22-md5: ecf42d21f26338443d7111891851628c
64 Source101:      https://github.com/arut/nginx-rtmp-module/archive/v%{rtmp_version}/nginx-rtmp-module-%{rtmp_version}.tar.gz
65 # Source101-md5:        8006de2560db3e55bb15d110220076ac
66 Patch0:         %{name}-no-Werror.patch
67 Patch1:         %{name}-modsecurity-xheaders.patch
68 URL:            http://nginx.net/
69 %{?with_modsecurity:BuildRequires: lua-devel}
70 BuildRequires:  mailcap
71 %{?with_ssl:BuildRequires: openssl-devel >= 1.0.2}
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)
80
81 %define         _sysconfdir     /etc/%{name}
82 %define         _nginxdir       /home/services/%{name}
83
84 %description
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.
92
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".
101
102 %package common
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
112 Requires:       rc-scripts >= 0.2.0
113 Requires:       systemd-units >= 38
114 Provides:       group(http)
115 Provides:       group(nginx)
116 Provides:       user(nginx)
117 Provides:       webserver
118 Obsoletes:      nginx < 1.4.1-4.1
119 Conflicts:      logrotate < 3.8.0
120
121 %description common
122 Common files for the nginx daemon.
123
124 %description common -l pl.UTF-8
125 Niezbędne pliki dla nginx.
126
127 %package light
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}
134 %{?with_ssl:Requires: openssl >= 1.0.2}
135 Provides:       nginx-daemon
136 Provides:       webserver
137
138 %description light
139 nginx ("engine x") is a high-performance HTTP server and reverse
140 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
141 Sysoev for Rambler.ru, Russia's second-most visited website, where it
142 has been running in production for over two and a half years. Igor has
143 released the source code under a BSD-like license. Although still in
144 beta, nginx is known for its stability, rich feature set, simple
145 configuration, and low resource consumption.
146
147 The smallest, but also the fastest nginx edition. No additional
148 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
149
150 %description light -l pl.UTF-8
151 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
152 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
153 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
154 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
155 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
156 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
157 prostej konfiguracji oraz małej "zasobożerności".
158
159 Najmniejsza i najszybsza wersja nginx. Bez wsparcia dla Perla, DAV,
160 FLV oraz IMAP, POP3, SMTP proxy.
161
162 %package perl
163 Summary:        High perfomance HTTP and reverse proxy server
164 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
165 Group:          Networking/Daemons/HTTP
166 Requires(post,preun):   /sbin/chkconfig
167 Requires(post,preun,postun):    systemd-units >= 38
168 Requires:       %{name}-common = %{version}-%{release}
169 %{?with_ssl:Requires: openssl >= 1.0.2}
170 Provides:       nginx-daemon
171 Provides:       webserver
172
173 %description perl
174 nginx ("engine x") is a high-performance HTTP server and reverse
175 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
176 Sysoev for Rambler.ru, Russia's second-most visited website, where it
177 has been running in production for over two and a half years. Igor has
178 released the source code under a BSD-like license. Although still in
179 beta, nginx is known for its stability, rich feature set, simple
180 configuration, and low resource consumption.
181
182 nginx with Perl support. Mail modules not included.
183
184 %description perl -l pl.UTF-8
185 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
186 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
187 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
188 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
189 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
190 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
191 prostej konfiguracji oraz małej "zasobożerności".
192
193 nginx z obsługą Perla. Bez wsparcia dla modułów poczty.
194
195 %package mail
196 Summary:        High perfomance IMAP, POP3, SMTP proxy server
197 Summary(pl.UTF-8):      IMAP, POP3, SMTP proxy o wysokiej wydajności
198 Group:          Networking/Daemons/HTTP
199 Requires(post,preun):   /sbin/chkconfig
200 Requires(post,preun,postun):    systemd-units >= 38
201 Requires:       %{name}-common = %{version}-%{release}
202 Provides:       nginx-daemon
203
204 %description mail
205 nginx ("engine x") is a high-performance HTTP server and reverse
206 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
207 Sysoev for Rambler.ru, Russia's second-most visited website, where it
208 has been running in production for over two and a half years. Igor has
209 released the source code under a BSD-like license. Although still in
210 beta, nginx is known for its stability, rich feature set, simple
211 configuration, and low resource consumption.
212
213 nginx with mail support. Only mail modules included.
214
215 %description mail -l pl.UTF-8
216 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
217 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
218 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
219 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
220 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
221 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
222 prostej konfiguracji oraz małej "zasobożerności".
223
224 nginx ze wsparciem tylko dla modułów poczty.
225
226 %package standard
227 Summary:        High perfomance HTTP and reverse proxy server
228 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
229 Group:          Networking/Daemons/HTTP
230 Requires(post,preun):   /sbin/chkconfig
231 Requires(post,preun,postun):    systemd-units >= 38
232 Requires:       %{name}-common = %{version}-%{release}
233 %{?with_ssl:Requires: openssl >= 1.0.2}
234 Provides:       nginx
235 Provides:       nginx-daemon
236 Conflicts:      logrotate < 3.7-4
237
238 %description standard
239 nginx ("engine x") is a high-performance HTTP server and reverse
240 proxy, as well as an IMAP/POP3 proxy server. nginx was written by Igor
241 Sysoev for Rambler.ru, Russia's second-most visited website, where it
242 has been running in production for over two and a half years. Igor has
243 released the source code under a BSD-like license. Although still in
244 beta, nginx is known for its stability, rich feature set, simple
245 configuration, and low resource consumption.
246
247 This is standard nginx version, without Perl support and IMAP, POP3,
248 SMTP proxy.
249
250 %description standard -l pl.UTF-8
251 nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
252 a także IMAP/POP3 proxy. nginx został napisany przez Igora Sysoeva na
253 potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
254 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
255 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle w
256 fazie beta, już zasłynął dzięki stabilności, bogactwu dodatków,
257 prostej konfiguracji oraz małej "zasobożerności". ginx ("engine x")
258 jest wysokowydajnym serwerem HTTP, odwrotnym proxy a także IMAP/POP3
259 proxy. nginx został napisany przez Igora Sysoeva na potrzeby serwisu
260 Rambler.ru. Jest to drugi pod względem ilości odwiedzin serwis w Rosji
261 i działa od ponad dwóch i pół roku. Igor opublikował źródła na
262 licencji BSD. Mimo, że projekt jest ciągle w fazie beta, już zasłynął
263 dzięki stabilności, bogactwu dodatków, prostej konfiguracji oraz małej
264 "zasobożerności".
265
266 To jest standardowa wersja nginx, bez obsługi Perla oraz proxy dla
267 IMAP, POP3, SMTP.
268
269 %package -n monit-rc-nginx
270 Summary:        nginx support for monit
271 Summary(pl.UTF-8):      Wsparcie nginx dla monit
272 Group:          Applications/System
273 URL:            http://nginx.eu/
274 Requires:       %{name}-common = %{version}-%{release}
275 Requires:       monit
276
277 %description -n monit-rc-nginx
278 monitrc file for monitoring nginx webserver.
279
280 %description -n monit-rc-nginx -l pl.UTF-8
281 Plik monitrc do monitorowania serwera WWW nginx.
282
283 %prep
284 %setup -q %{?with_rtmp:-a101} %{?with_modsecurity:-a22}
285 %patch0 -p0
286 %{?with_modsecurity:%patch1 -p0}
287
288 %if %{with rtmp}
289 mv nginx-rtmp-module-%{rtmp_version} nginx-rtmp-module
290 %endif
291
292 # build mime.types.conf
293 #sh %{SOURCE17} /etc/mime.types
294
295 %build
296 # NB: not autoconf generated configure
297 cp -f configure auto/
298
299 install -d bin
300
301 # build with default options
302 build() {
303         local type=$1; shift
304 ./configure \
305         --prefix=%{_prefix} \
306         --sbin-path=%{_sbindir}/%{name}-$type \
307         --conf-path=%{_sysconfdir}/%{name}-$type.conf \
308         --error-log-path=%{_localstatedir}/log/%{name}/%{name}-${type}_error.log \
309         --http-log-path=%{_localstatedir}/log/%{name}/%{name}-${type}_access.log \
310         --pid-path=%{_localstatedir}/run/%{name}-$type.pid \
311         --lock-path=%{_localstatedir}/lock/subsys/%{name}-$type \
312         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-$type/client_body_temp \
313         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-$type/fastcgi_temp \
314         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-$type/proxy_temp \
315         --user=nginx \
316         --group=nginx \
317         %{?with_ipv6:--with-ipv6} \
318         %{?with_select:--with-select_module} \
319         %{?with_poll:--with-poll_module} \
320         %{?with_rtsig:--with-rtsig_module} \
321         --with-cc="%{__cc}" \
322         --with-cc-opt="%{rpmcflags}" \
323         --with-ld-opt="%{rpmldflags}" \
324         %{?with_debug:--with-debug} \
325         "$@"
326 %{__make}
327 }
328
329 %if %{with modsecurity}
330 cd modsecurity-%{modsecurity_version}
331 ./autogen.sh
332 %configure \
333         --enable-standalone-module \
334         --disable-mlogc \
335         --enable-alp2 \
336         --with-lua=/usr
337 %{__make}
338 cd ..
339 %endif
340
341 %if %{with perl}
342 build perl \
343         --with-http_perl_module \
344         %{?with_addition:--with-http_addition_module} \
345         %{?with_dav:--with-http_dav_module} \
346         %{?with_flv:--with-http_flv_module} \
347         %{?with_sub:--with-http_sub_module} \
348         %{?with_realip:--with-http_realip_module} \
349         %{?with_status:--with-http_stub_status_module} \
350         %{?with_ssl:--with-http_ssl_module} \
351         %{!?with_http_browser:--without-http_browser_module} \
352         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
353         %{?with_auth_request:--with-http_auth_request_module} \
354         %{?with_threads:--with-threads} \
355         %{?with_http2:--with-http_v2_module} \
356         --with-http_secure_link_module \
357         %{nil}
358
359 mv -f objs/nginx bin/nginx-perl
360 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so bin/nginx.so
361 mv -f objs/src/http/modules/perl/nginx.pm bin/nginx.pm
362 %endif
363
364 %if %{with mail}
365 build mail \
366         --without-http \
367         --with-imap \
368         --with-mail \
369         --with-mail_ssl_module \
370         %{nil}
371
372 mv -f objs/nginx bin/nginx-mail
373 %endif
374
375 %if %{with light}
376 build light \
377         %{?with_realip:--with-http_realip_module} \
378         %{?with_status:--with-http_stub_status_module} \
379         %{?with_ssl:--with-http_ssl_module} \
380         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
381         %{?with_auth_request:--with-http_auth_request_module} \
382         %{?with_threads:--with-threads} \
383         %{?with_http2:--with-http_v2_module} \
384         %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
385         --without-http_browser_module \
386         --with-http_secure_link_module \
387         %{nil}
388
389 mv -f objs/nginx bin/nginx-light
390 %endif
391
392 build standard \
393         %{?with_addition:--with-http_addition_module} \
394         %{?with_dav:--with-http_dav_module} \
395         %{?with_flv:--with-http_flv_module} \
396         %{?with_sub:--with-http_sub_module} \
397         %{?with_realip:--with-http_realip_module} \
398         %{?with_status:--with-http_stub_status_module} \
399         %{?with_ssl:--with-http_ssl_module} \
400         %{!?with_http_browser:--without-http_browser_module} \
401         %{?with_rtmp:--add-module=./nginx-rtmp-module} \
402         %{?with_auth_request:--with-http_auth_request_module} \
403         %{?with_threads:--with-threads} \
404         %{?with_modsecurity:--add-module=modsecurity-%{modsecurity_version}/nginx/modsecurity} \
405         --with-http_secure_link_module \
406         %{nil}
407
408 mv -f objs/nginx bin/nginx-standard
409
410 %install
411 rm -rf $RPM_BUILD_ROOT
412 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
413         $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
414         $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
415         $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
416         $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
417         $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/{vhosts,webapps}.d} \
418         $RPM_BUILD_ROOT/etc/{logrotate.d,monit} \
419         $RPM_BUILD_ROOT{%{systemdunitdir},/etc/systemd/system}
420
421 cp -p conf/*_params $RPM_BUILD_ROOT%{_sysconfdir}
422 cp -p conf/koi-utf $RPM_BUILD_ROOT%{_sysconfdir}/koi-utf
423 cp -p conf/koi-win $RPM_BUILD_ROOT%{_sysconfdir}/koi-win
424 cp -p conf/win-utf $RPM_BUILD_ROOT%{_sysconfdir}/win-utf
425 cp -p html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
426 cp -p html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
427 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
428 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
429 cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
430 cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
431
432 install_build() {
433         local type=$1
434         %{__sed} -e "s/@type@/${type}/g" %{_sourcedir}/%{name}.conf \
435                 > $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-$type.conf
436
437         install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-$type
438         %{__sed} -i -e "s/@type@/${type}/g" $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-$type
439
440         cp -p %{_sourcedir}/%{name}-$type.service $RPM_BUILD_ROOT%{systemdunitdir}
441         cp -p %{_sourcedir}/%{name}-$type.monitrc $RPM_BUILD_ROOT/etc/monit
442         install -p bin/%{name}-$type $RPM_BUILD_ROOT%{_sbindir}
443 }
444
445 install_build standard
446 ln -sf %{systemdunitdir}/%{name}-standard.service $RPM_BUILD_ROOT/etc/systemd/system/nginx.service
447
448 %if %{with light}
449 install_build light
450 %endif
451
452 %if %{with perl}
453 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
454 install_build perl
455 cp -p bin/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
456 install -p bin/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
457 install -p bin/nginx-perl $RPM_BUILD_ROOT%{_sbindir}
458 %endif
459
460 %if %{with mail}
461 install_build mail
462 %endif
463
464 # only touch these for ghost packaging
465 touch $RPM_BUILD_ROOT%{_sysconfdir}/{fastcgi,scgi,uwsgi}.params
466
467 %clean
468 rm -rf $RPM_BUILD_ROOT
469
470 %pre common
471 %groupadd -r -g 213 %{name}
472 %groupadd -g 51 http
473 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
474 %addusertogroup %{name} http
475
476 %post standard
477 for a in access.log error.log; do
478         if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
479                 umask 022
480                 touch /var/log/%{name}/nginx-standard_$a
481                 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
482                 chmod 644 /var/log/%{name}/nginx-standard_$a
483         fi
484 done
485 /sbin/chkconfig --add %{name}-standard
486 %systemd_post %{name}-standard.service
487 %service %{name}-standard force-reload
488 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-standard.conf" as config.'
489 if ! [ -L /etc/systemd/system/nginx.service ] ; then
490         ln -s %{systemdunitdir}/%{name}-standard.service /etc/systemd/system/nginx.service || :
491 fi
492
493 %post light
494 for a in access.log error.log; do
495         if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
496                 umask 022
497                 touch /var/log/%{name}/nginx-light_$a
498                 chown nginx:nginx /var/log/%{name}/nginx-light_$a
499                 chmod 644 /var/log/%{name}/nginx-light_$a
500         fi
501 done
502 /sbin/chkconfig --add %{name}-light
503 %systemd_post %{name}-light.service
504 %service %{name}-light force-reload
505 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-light.conf" as config'
506
507 %post perl
508 for a in access.log error.log; do
509         if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
510                 umask 022
511                 touch /var/log/%{name}/nginx-perl_$a
512                 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
513                 chmod 644 /var/log/%{name}/nginx-perl_$a
514         fi
515 done
516 /sbin/chkconfig --add %{name}-perl
517 %systemd_post %{name}-perl.service
518 %service %{name}-perl force-reload
519 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-perl.conf" as config'
520
521 %post mail
522 for a in access.log error.log; do
523         if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
524                 umask 022
525                 touch /var/log/%{name}/nginx-mail_$a
526                 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
527                 chmod 644 /var/log/%{name}/nginx-mail_$a
528         fi
529 done
530 /sbin/chkconfig --add %{name}-mail
531 %systemd_post %{name}-mail.service
532 %service %{name}-mail force-reload
533 echo 'NOTE: this nginx daemon is using "/etc/nginx/nginx-mail.conf" as config'
534
535 %preun standard
536 if [ "$1" = "0" ];then
537         %service %{name}-standard stop
538         /sbin/chkconfig --del %{name}-standard
539 fi
540 %systemd_preun %{name}-standard.service
541
542 %preun light
543 if [ "$1" = "0" ]; then
544         %service %{name}-light stop
545         /sbin/chkconfig --del %{name}-light
546 fi
547 %systemd_preun %{name}-light.service
548
549 %preun perl
550 if [ "$1" = "0" ]; then
551         %service %{name}-perl stop
552         /sbin/chkconfig --del %{name}-perl
553 fi
554 %systemd_preun %{name}-perl.service
555
556 %preun mail
557 if [ "$1" = "0" ]; then
558         %service %{name}-mail stop
559         /sbin/chkconfig --del %{name}-mail
560 fi
561 %systemd_preun %{name}-mail.service
562
563 %postun common
564 if [ "$1" = "0" ]; then
565         %userremove %{name}
566         %groupremove %{name}
567 fi
568
569 %postun standard
570 %systemd_reload
571
572 %postun light
573 %systemd_reload
574
575 %postun perl
576 %systemd_reload
577
578 %postun mail
579 %systemd_reload
580
581 %triggerpostun -- %{name}-standard < 1.4.1-4
582 %systemd_trigger %{name}-standard.service
583
584 %triggerpostun -- %{name}-light < 1.4.1-4
585 %systemd_trigger %{name}-light.service
586
587 %triggerpostun -- %{name}-perl < 1.4.1-4
588 %systemd_trigger %{name}-perl.service
589
590 %triggerpostun -- %{name}-mail < 1.4.1-4
591 %systemd_trigger %{name}-mail.service
592
593 %triggerpostun common -- %{name}-common < 1.8.0-2
594 # skip *this* trigger on downgrade
595 [ $1 -le 1 ] && exit 0
596 ln -sf fastcgi_params %{_sysconfdir}/fastcgi.params
597 ln -sf scgi_params %{_sysconfdir}/scgi.params
598 ln -sf uwsgi_params %{_sysconfdir}/uwsgi.params
599 exit 0
600
601 %files common
602 %defattr(644,root,root,755)
603 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
604 %doc %lang(ru) CHANGES.ru
605 %dir %attr(750,root,nginx) %{_sysconfdir}
606 %dir %{_nginxdir}
607 %dir %{_nginxdir}/cgi-bin
608 %dir %{_nginxdir}/html
609 %dir %{_nginxdir}/errors
610 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
611 # XXX: duplicates, don't use such glob here
612 #%attr(640,root,root) %{_sysconfdir}/*[_-]*
613 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/proxy.conf
614 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fastcgi_params
615 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/scgi_params
616 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/uwsgi_params
617 %ghost %{_sysconfdir}/fastcgi.params
618 %ghost %{_sysconfdir}/scgi.params
619 %ghost %{_sysconfdir}/uwsgi.params
620 %attr(640,root,root) %{_sysconfdir}/mime.types
621 %attr(640,root,root) %{_sysconfdir}/koi-utf
622 %attr(640,root,root) %{_sysconfdir}/koi-win
623 %attr(640,root,root) %{_sysconfdir}/win-utf
624 %dir %{_sysconfdir}/webapps.d
625 %dir %{_sysconfdir}/vhosts.d
626 %attr(750,nginx,logs) %dir /var/log/archive/%{name}
627 %attr(750,nginx,logs) /var/log/%{name}
628 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
629 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
630 %ghost /etc/systemd/system/nginx.service
631
632 %files standard
633 %defattr(644,root,root,755)
634 %attr(755,root,root) %{_sbindir}/%{name}-standard
635 %attr(770,root,%{name}) /var/cache/%{name}-standard
636 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
637 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
638 %{systemdunitdir}/%{name}-standard.service
639
640 %if %{with mail}
641 %files mail
642 %defattr(644,root,root,755)
643 %attr(755,root,root) %{_sbindir}/%{name}-mail
644 %attr(770,root,%{name}) /var/cache/%{name}-mail
645 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
646 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
647 %{systemdunitdir}/%{name}-mail.service
648 %endif
649
650 %if %{with light}
651 %files light
652 %defattr(644,root,root,755)
653 %attr(755,root,root) %{_sbindir}/%{name}-light
654 %attr(770,root,%{name}) /var/cache/%{name}-light
655 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
656 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
657 %{systemdunitdir}/%{name}-light.service
658 %endif
659
660 %if %{with perl}
661 %files perl
662 %defattr(644,root,root,755)
663 %attr(755,root,root) %{_sbindir}/%{name}-perl
664 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
665 %attr(770,root,%{name}) /var/cache/%{name}-perl
666 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
667 %dir %{perl_vendorarch}/auto/%{name}
668 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
669 %{perl_vendorarch}/%{name}.pm
670 %{systemdunitdir}/%{name}-perl.service
671 %endif
672
673 %files -n monit-rc-nginx
674 %defattr(644,root,root,755)
675 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
676 %if %{with perl}
677 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
678 %endif
679 %if %{with light}
680 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
681 %endif
682 %if %{with mail}
683 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
684 %endif
This page took 0.140068 seconds and 3 git commands to generate.