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