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