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