]> git.pld-linux.org Git - packages/nginx.git/blob - nginx.spec
- %service cleanup (it already includes lockfile check)
[packages/nginx.git] / nginx.spec
1 # TODO
2 # - /etc/sysconfig/nginx file
3 # - missing perl build/install requires
4 # - maybe -with-cpu-opt=CPU (pentium, pentiumpro, pentium3, pentium4, athlon, opteron, amd64, sparc32, sparc64, ppc64) ?
5 # - nginx should have own group (and work with it) or use http group ?
6 #
7 # Conditional build for nginx:
8 %bcond_without  light           # don't build light version
9 %bcond_without  mail            # don't build imap/mail proxy
10 %bcond_without  perl            # don't build with perl module
11 %bcond_without  addition        # adds module
12 %bcond_without  dav             # WebDAV
13 %bcond_without  flv             # FLV stream
14 %bcond_without  sub             # ngx_http_sub_module
15 %bcond_without  poll            # poll
16 %bcond_without  realip          # real ip (behind proxy)
17 %bcond_without  rtsig           # rtsig
18 %bcond_without  select          # select
19 %bcond_without  status          # stats module
20 %bcond_without  ssl             # ssl support
21 %bcond_with     http_browser    # header "User-agent" parser
22 #
23 Summary:        High perfomance HTTP and reverse proxy server
24 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
25 Name:           nginx
26 Version:        0.5.33
27 Release:        0.8
28 License:        BSD-like
29 Group:          Networking/Daemons
30 Source0:        http://sysoev.ru/nginx/%{name}-%{version}.tar.gz
31 # Source0-md5:  a78be74b4fd8e009545ef02488fcac86
32 Source1:        http://www.nginx.eu/favicon.ico
33 # Source1-md5:  2aaf2115c752cbdbfb8a2f0b3c3189ab
34 Source2:        http://www.nginx.eu/download/proxy.conf
35 # Source2-md5:  f5263ae01c2edb18f46d5d1df2d3a5cd
36 Source3:        %{name}.logrotate
37 Source4:        %{name}.mime
38 Source5:        %{name}-light.conf
39 Source6:        %{name}-light.monitrc
40 Source7:        %{name}-light.init
41 Source8:        %{name}-mail.conf
42 Source9:        %{name}-mail.monitrc
43 Source10:       %{name}-mail.init
44 Source11:       %{name}-perl.conf
45 Source12:       %{name}-perl.monitrc
46 Source13:       %{name}-perl.init
47 Source14:       %{name}-standard.conf
48 Source15:       %{name}-standard.monitrc
49 Source16:       %{name}-standard.init
50 Source17:       %{name}-mime.types.sh
51 Patch0:         %{name}-config.patch
52 URL:            http://nginx.net/
53 BuildRequires:  mailcap
54 BuildRequires:  openssl-devel
55 BuildRequires:  pcre-devel
56 %{?with_perl:BuildRequires: perl-CGI}
57 %{?with_perl:BuildRequires: perl-devel}
58 %{?with_perl:BuildRequires: rpm-perlprov}
59 BuildRequires:  rpmbuild(macros) >= 1.268
60 BuildRequires:  zlib-devel
61 Requires(post,preun):   /sbin/chkconfig
62 Requires(postun):       /usr/sbin/groupdel
63 Requires(postun):       /usr/sbin/userdel
64 Requires(pre):  /bin/id
65 Requires(pre):  /usr/bin/getgid
66 Requires(pre):  /usr/sbin/groupadd
67 Requires(pre):  /usr/sbin/useradd
68 Requires:       nginx-daemon
69 Requires:       openssl
70 Requires:       pcre
71 Requires:       rc-scripts >= 0.2.0
72 Requires:       zlib
73 Suggests:       nginx-standard
74 Provides:       group(http)
75 Provides:       group(nginx)
76 Provides:       user(nginx)
77 Provides:       webserver
78 Conflicts:      logrotate < 3.7-4
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 Common files for Nginx daemon.
94
95 %description -l pl.UTF-8
96 Nginx ("engine x") jest wysokowydajnym serwerem HTTP, odwrotnym proxy
97 a także IMAP/POP3 proxy. Nginx został napisany przez Igora Sysoev'a
98 na potrzeby serwisu Rambler.ru. Jest to drugi pod względem ilości
99 odwiedzin serwis w Rosji i działa od ponad dwóch i pół roku. Igor
100 opublikował źródła na licencji BSD. Mimo, że projekt jest ciągle
101 w fazie beta, już zasÅynÄÅ dzieki stabilnoÅi, bogactwu dodatków,
102 prostej konfiguracji oraz maÅej "zasobożernoÅi".
103
104 Niezb¿dne pliki dla Nginx.
105
106 %package light
107 Summary:        High perfomance HTTP and reverse proxy server
108 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
109 License:        BSD-like
110 Group:          Networking/Daemons
111 URL:            http://nginx.net/
112 Requires(post,preun):   /sbin/chkconfig
113 Requires(postun):       /usr/sbin/groupdel
114 Requires(postun):       /usr/sbin/userdel
115 Requires:       %{name} = %{version}-%{release}
116 Requires:       openssl
117 Requires:       pcre
118 Requires:       zlib
119 Provides:       group(http)
120 Provides:       group(nginx)
121 Provides:       nginx-daemon
122 Provides:       user(nginx)
123 Provides:       webserver
124
125 %description light
126 The smallest, but also the fastest Nginx edition. No additional
127 modules, no Perl, no DAV, no FLV, no IMAP, POP3, SMTP proxy.
128
129 %description light -l pl.UTF-8
130 Najmniejsza i najszybsza wersja Nginx. Bez wsparcia dla Perla, DAV,
131 FLV oraz IMAP, POP3, SMTP proxy.
132
133 %package perl
134 Summary:        High perfomance HTTP and reverse proxy server
135 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
136 License:        BSD-like
137 Group:          Networking/Daemons
138 URL:            http://nginx.net/
139 Requires(post,preun):   /sbin/chkconfig
140 Requires(postun):       /usr/sbin/groupdel
141 Requires(postun):       /usr/sbin/userdel
142 Requires:       %{name} = %{version}-%{release}
143 Requires:       openssl
144 Provides:       group(http)
145 Provides:       group(nginx)
146 Provides:       nginx-daemon
147 Provides:       user(nginx)
148 Provides:       webserver
149
150 %description perl
151 Nginx with Perl support. Mail modules not included.
152
153 %description perl -l pl.UTF-8
154 Nignx z obsługą Perla. Bez wsparcia dla modułów poczty.
155
156 %package mail
157 Summary:        High perfomance HTTP and reverse proxy server
158 Summary(pl.UTF-8):      Serwer HTTP i odwrotne proxy o wysokiej wydajności
159 License:        BSD-like
160 Group:          Networking/Daemons
161 URL:            http://nginx.net/
162 Requires(post,preun):   /sbin/chkconfig
163 Requires(postun):       /usr/sbin/groupdel
164 Requires(postun):       /usr/sbin/userdel
165 Requires:       %{name} = %{version}-%{release}
166 Requires:       openssl
167 Requires:       pcre
168 Requires:       zlib
169 Provides:       group(http)
170 Provides:       group(nginx)
171 Provides:       nginx-daemon
172 Provides:       user(nginx)
173 Provides:       webserver
174
175 %description mail
176 Nginx with mail support. Only mail modules included.
177
178 %description mail -l pl.UTF-8
179 Nginx ze wsparciem tylko dla modułów poczty.
180
181 %package standard
182 Summary:        Configuration files and documentation for Nginx
183 Summary(pl.UTF-8):      Pliki konfiguracyjne i dokumentacja dla Nginx
184 License:        BSD-like
185 Group:          Networking/Daemons
186 URL:            http://nginx.net/
187 Requires(post,preun):   /sbin/chkconfig
188 Requires(postun):       /usr/sbin/groupdel
189 Requires(postun):       /usr/sbin/userdel
190 Requires:       %{name} = %{version}-%{release}
191 Requires:       openssl
192 Provides:       group(http)
193 Provides:       group(nginx)
194 Provides:       nginx-daemon
195 Conflicts:      logrotate < 3.7-4
196
197 %description standard
198 Nginx ("engine x") is a high-performance HTTP server and reverse
199 proxy, as well as an IMAP/POP3 proxy server. Nginx was written by Igor
200 Sysoev for Rambler.ru, Russia's second-most visited website, where it
201 has been running in production for over two and a half years. Igor has
202 released the source code under a BSD-like license. Although still in
203 beta, Nginx is known for its stability, rich feature set, simple
204 configuration, and low resource consumption.
205
206 This is standard nginx version, without perl support and imap, pop3,
207 smtp proxy. 
208
209 %description standard -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 Sysoev'a
212 na 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
215 w fazie beta, już zasÅynÄÅ dzieki stabilnoÅi, bogactwu dodatków,
216 prostej konfiguracji oraz maÅej "zasobożernoÅi".
217
218 To jest standardowa wersja nginx, bez obs?ugi perla oraz proxy dla
219 imap, pop3, smtp.
220
221 %package -n monit-rc-nginx
222 Summary:        Nginx support for monit
223 Summary(pl.UTF-8):      Wsparcie Nginx dla monit
224 License:        BSD-like
225 Group:          Applications/System
226 URL:            http://nginx.eu/
227 Requires:       %{name} = %{version}-%{release}
228 Requires:       monit
229
230 %description -n monit-rc-nginx
231 monitrc file for monitoring nginx webserver server.
232
233 %description -n monit-rc-nginx -l pl.UTF-8
234 Plik monitrc do monitorowania serwera WWW nginx.
235
236 %prep
237 %setup -q
238 %patch0 -p0
239
240 # build mime.types.conf
241 #sh %{SOURCE17} /etc/mime.types
242
243 %build
244 # NB: not autoconf generated configure
245 cp -f configure auto/
246 #
247 %if %{with perl}
248 ./configure \
249         --prefix=%{_prefix} \
250         --sbin-path=%{_sbindir}/%{name}-perl \
251         --conf-path=%{_sysconfdir}/%{name}-perl.conf \
252         --error-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_error.log \
253         --http-log-path=%{_localstatedir}/log/%{name}/%{name}-perl_access.log \
254         --pid-path=%{_localstatedir}/run/%{name}-perl.pid \
255         --lock-path=%{_localstatedir}/lock/subsys/%{name}-perl \
256         --user=nginx \
257         --group=nginx \
258         --with-http_perl_module \
259         --without-mail_pop3_module \
260         --without-mail_imap_module \
261         --without-mail_smtp_module \
262         %{?with_addition:--with-http_addition_module} \
263         %{?with_dav:--with-http_dav_module} \
264         %{?with_flv:--with-http_flv_module} \
265         %{?with_sub:--with-http_sub_module} \
266         %{?with_poll:--with-poll_module} \
267         %{?with_realip:--with-http_realip_module} \
268         %{?with_rtsig:--with-rtsig_module} \
269         %{?with_select:--with-select_module} \
270         %{?with_status:--with-http_stub_status_module} \
271         %{?with_ssl:--with-http_ssl_module} \
272         %{!?with_http_browser:--without-http_browser_module} \
273         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-perl/client_body_temp \
274         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-perl/proxy_temp \
275         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-perl/fastcgi_temp \
276         --with-cc="%{__cc}" \
277         --with-cc-opt="%{rpmcflags}" \
278         --with-ld-opt="%{rpmldflags}"
279 %{__make}
280 mv -f objs/nginx contrib/nginx-perl
281 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.bs contrib/nginx.bs
282 mv -f objs/src/http/modules/perl/blib/arch/auto/nginx/nginx.so contrib/nginx.so
283 mv -f objs/src/http/modules/perl/nginx.pm contrib/nginx.pm
284 %endif
285
286 %if %{with mail}
287 ./configure \
288         --prefix=%{_prefix} \
289         --sbin-path=%{_sbindir}/%{name}-mail \
290         --conf-path=%{_sysconfdir}/%{name}-mail.conf \
291         --error-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_error.log \
292         --http-log-path=%{_localstatedir}/log/%{name}/%{name}-mail_access.log \
293         --pid-path=%{_localstatedir}/run/%{name}-mail.pid \
294         --lock-path=%{_localstatedir}/lock/subsys/%{name}-mail \
295         --user=nginx \
296         --group=nginx \
297         --with-imap \
298         --with-mail \
299         --with-mail_ssl_module \
300         --without-http \
301         %{?with_poll:--with-poll_module} \
302         %{?with_rtsig:--with-rtsig_module} \
303         %{?with_select:--with-select_module} \
304         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-mail/client_body_temp \
305         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-mail/proxy_temp \
306         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-mail/fastcgi_temp \
307         --with-cc="%{__cc}" \
308         --with-cc-opt="%{rpmcflags}" \
309         --with-ld-opt="%{rpmldflags}" \
310         %{?debug:--with-debug}
311 %{__make}
312 mv -f objs/nginx contrib/nginx-mail
313 %endif
314
315 %if %{with light}
316 ./configure \
317         --prefix=%{_prefix} \
318         --sbin-path=%{_sbindir}/%{name}-light \
319         --conf-path=%{_sysconfdir}/%{name}-light.conf \
320         --error-log-path=%{_localstatedir}/log/%{name}/%{name}-light_error.log \
321         --http-log-path=%{_localstatedir}/log/%{name}/%{name}-light_access.log \
322         --pid-path=%{_localstatedir}/run/%{name}-light.pid \
323         --lock-path=%{_localstatedir}/lock/subsys/%{name}-light \
324         --user=nginx \
325         --group=nginx \
326         %{?with_poll:--with-poll_module} \
327         %{?with_realip:--with-http_realip_module} \
328         %{?with_rtsig:--with-rtsig_module} \
329         %{?with_select:--with-select_module} \
330         %{?with_status:--with-http_stub_status_module} \
331         %{?with_ssl:--with-http_ssl_module} \
332         --without-http_browser_module \
333         --without-mail_pop3_module \
334         --without-mail_imap_module \
335         --without-mail_smtp_module \
336         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-light/client_body_temp \
337         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-light/proxy_temp \
338         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-light/fastcgi_temp \
339         --with-cc="%{__cc}" \
340         --with-cc-opt="%{rpmcflags}" \
341         --with-ld-opt="%{rpmldflags}" \
342         %{?debug:--with-debug}
343 %{__make}
344 mv -f objs/nginx contrib/nginx-light
345 %endif
346
347 ./configure \
348         --prefix=%{_prefix} \
349         --sbin-path=%{_sbindir}/%{name}-standard \
350         --conf-path=%{_sysconfdir}/%{name}-standard.conf \
351         --error-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_error.log \
352         --http-log-path=%{_localstatedir}/log/%{name}/%{name}-standard_access.log \
353         --pid-path=%{_localstatedir}/run/%{name}-standard.pid \
354         --lock-path=%{_localstatedir}/lock/subsys/%{name}-standard \
355         --user=nginx \
356         --group=nginx \
357         %{?with_addition:--with-http_addition_module} \
358         %{?with_dav:--with-http_dav_module} \
359         %{?with_flv:--with-http_flv_module} \
360         %{?with_sub:--with-http_sub_module} \
361         %{?with_poll:--with-poll_module} \
362         %{?with_realip:--with-http_realip_module} \
363         %{?with_rtsig:--with-rtsig_module} \
364         %{?with_select:--with-select_module} \
365         %{?with_status:--with-http_stub_status_module} \
366         %{?with_ssl:--with-http_ssl_module} \
367         %{!?with_http_browser:--without-http_browser_module} \
368         --http-client-body-temp-path=%{_localstatedir}/cache/%{name}-standard/client_body_temp \
369         --http-proxy-temp-path=%{_localstatedir}/cache/%{name}-standard/proxy_temp \
370         --http-fastcgi-temp-path=%{_localstatedir}/cache/%{name}-standard/fastcgi_temp \
371         --with-cc="%{__cc}" \
372         --with-cc-opt="%{rpmcflags}" \
373         --with-ld-opt="%{rpmldflags}" \
374         %{?debug:--with-debug}
375 %{__make}
376
377
378 %install
379 rm -rf $RPM_BUILD_ROOT
380 install -d $RPM_BUILD_ROOT/etc/rc.d/init.d \
381         $RPM_BUILD_ROOT%{_nginxdir}/{cgi-bin,html,errors} \
382         $RPM_BUILD_ROOT%{_localstatedir}/log/{%{name},archive/%{name}} \
383         $RPM_BUILD_ROOT%{_localstatedir}/cache/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
384         $RPM_BUILD_ROOT%{_localstatedir}/lock/subsys/{%{name}-standard,%{name}-perl,%{name}-mail,%{name}-light} \
385         $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}} \
386         $RPM_BUILD_ROOT/etc/{logrotate.d,monit}
387
388 install conf/* $RPM_BUILD_ROOT%{_sysconfdir}
389 install conf/fastcgi_params $RPM_BUILD_ROOT%{_sysconfdir}/fastcgi.params
390 install html/index.html $RPM_BUILD_ROOT%{_nginxdir}/html
391 install html/50x.html $RPM_BUILD_ROOT%{_nginxdir}/errors
392 install %{SOURCE1} $RPM_BUILD_ROOT%{_nginxdir}/html/favicon.ico
393 install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/proxy.conf
394 install %{SOURCE3} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}
395 install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/mime.types
396 install %{SOURCE14} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-standard.conf
397 install %{SOURCE15} $RPM_BUILD_ROOT/etc/monit/%{name}-standard.monitrc
398 install %{SOURCE16} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-standard
399 install objs/%{name} $RPM_BUILD_ROOT%{_sbindir}/%{name}-standard
400
401 %if %{with light}
402 install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-light.conf
403 install %{SOURCE6} $RPM_BUILD_ROOT/etc/monit/%{name}-light.monitrc
404 install %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-light
405 install contrib/nginx-light $RPM_BUILD_ROOT%{_sbindir}/%{name}-light
406 %endif
407
408 %if %{with mail}
409 install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-mail.conf
410 install %{SOURCE9} $RPM_BUILD_ROOT/etc/monit/%{name}-mail.monitrc
411 install %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-mail
412 install contrib/nginx-mail $RPM_BUILD_ROOT%{_sbindir}/%{name}-mail
413 %endif
414
415 %if %{with perl}
416 install -d $RPM_BUILD_ROOT{%{perl_vendorarch},%{perl_vendorarch}/auto/%{name}}
417 install %{SOURCE11} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}-perl.conf
418 install %{SOURCE12} $RPM_BUILD_ROOT/etc/monit/%{name}-perl.monitrc
419 install %{SOURCE13} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-perl
420 install contrib/nginx.pm $RPM_BUILD_ROOT%{perl_vendorarch}/%{name}.pm
421 install contrib/nginx.so $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.so
422 install contrib/nginx.bs $RPM_BUILD_ROOT%{perl_vendorarch}/auto/%{name}/%{name}.bs
423 install contrib/nginx-perl $RPM_BUILD_ROOT%{_sbindir}/%{name}-perl
424 %endif
425
426 rm -f $RPM_BUILD_ROOT%{_sysconfdir}/*.default
427 rm -rf $RPM_BUILD_ROOT%{_prefix}/html
428
429 %clean
430 rm -rf $RPM_BUILD_ROOT
431
432 %pre
433 %groupadd -r -g 213 %{name}
434 %groupadd -g 51 http
435 %useradd -r -u 213 -d /usr/share/empty -s /bin/false -c "Nginx HTTP User" -g %{name} %{name}
436 %addusertogroup %{name} http
437
438 %post standard
439 for a in access.log error.log; do
440         if [ ! -f /var/log/%{name}/nginx-standard_$a ]; then
441                 touch /var/log/%{name}/nginx-standard_$a
442                 chown nginx:nginx /var/log/%{name}/nginx-standard_$a
443                 chmod 644 /var/log/%{name}/nginx-standard_$a
444         fi
445 done
446 if [ "$1" = "1" ]; then
447         /sbin/chkconfig --add %{name}-standard
448         %service %{name}-standard restart
449 fi
450 echo "Notice: deamon is now using \"/etc/nginx/nginx-standard.conf\" file"
451
452 %post light
453 for a in access.log error.log; do
454         if [ ! -f /var/log/%{name}/nginx-light_$a ]; then
455                 touch /var/log/%{name}/nginx-light_$a
456                 chown nginx:nginx /var/log/%{name}/nginx-light_$a
457                 chmod 644 /var/log/%{name}/nginx-light_$a
458         fi
459 done
460 if [ "$1" = "1" ]; then
461         /sbin/chkconfig --add %{name}-light
462         %service %{name}-light restart
463 fi
464 echo "Notice: deamon is now using \"/etc/nginx/nginx-light.conf\" file"
465
466 %post perl
467 for a in access.log error.log; do
468         if [ ! -f /var/log/%{name}/nginx-perl_$a ]; then
469                 touch /var/log/%{name}/nginx-perl_$a
470                 chown nginx:nginx /var/log/%{name}/nginx-perl_$a
471                 chmod 644 /var/log/%{name}/nginx-perl_$a
472         fi
473 done
474 if [ "$1" = "1" ]; then
475         /sbin/chkconfig --add %{name}-perl
476         %service %{name}-perl restart
477 fi
478 echo "Notice: deamon is now using \"/etc/nginx/nginx-perl.conf\" file"
479
480 %post mail
481 for a in access.log error.log; do
482         if [ ! -f /var/log/%{name}/nginx-mail_$a ]; then
483                 touch /var/log/%{name}/nginx-mail_$a
484                 chown nginx:nginx /var/log/%{name}/nginx-mail_$a
485                 chmod 644 /var/log/%{name}/nginx-mail_$a
486         fi
487 done
488 if [ "$1" = "1" ]; then
489         /sbin/chkconfig --add %{name}-mail
490         %service %{name}-mail restart
491 fi
492 echo "Notice: deamon is now using \"/etc/nginx/nginx-mail.conf\" file"
493
494 %preun standard
495 if [ "$1" = "0" ];then
496         %service %{name}-standard stop
497         /sbin/chkconfig --del %{name}-standard
498 fi
499
500 %preun light
501 if [ "$1" = "0" ]; then
502         %service %{name}-light stop
503         /sbin/chkconfig --del %{name}-light
504 fi
505
506 %preun perl
507 if [ "$1" = "0" ]; then
508         %service %{name}-perl stop
509         /sbin/chkconfig --del %{name}-perl
510 fi
511
512 %preun mail
513 if [ "$1" = "0" ]; then
514         %service %{name}-mail stop
515         /sbin/chkconfig --del %{name}-mail
516 fi
517
518 %postun
519 if [ "$1" = "0" ]; then
520         %userremove %{name}
521         %groupremove %{name}
522 fi
523
524 %files
525 %defattr(644,root,root,755)
526 %doc CHANGES LICENSE README html/index.html conf/nginx.conf
527 %doc %lang(ru) CHANGES.ru
528 %dir %attr(754,root,root) %{_sysconfdir}
529 %dir %{_nginxdir}
530 %dir %{_nginxdir}/cgi-bin
531 %dir %{_nginxdir}/html
532 %dir %{_nginxdir}/errors
533 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}
534 %attr(640,root,root) %{_sysconfdir}/*[_-]*
535 %attr(640,root,root) %{_sysconfdir}/proxy.conf
536 %attr(640,root,root) %{_sysconfdir}/mime.types
537 %attr(750,root,root) %dir /var/log/archive/%{name}
538 %attr(750,%{name},logs) /var/log/%{name}
539 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/html/*
540 %config(noreplace,missingok) %verify(not md5 mtime size) %{_nginxdir}/errors/*
541
542 %files standard
543 %defattr(644,root,root,755)
544 %attr(755,root,root) %{_sbindir}/%{name}-standard
545 %attr(770,root,%{name}) /var/cache/%{name}-standard
546 %attr(754,root,root) /etc/rc.d/init.d/%{name}-standard
547 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-standard.conf
548
549 %if %{with mail}
550 %files mail
551 %defattr(644,root,root,755)
552 %attr(755,root,root) %{_sbindir}/%{name}-mail
553 %attr(770,root,%{name}) /var/cache/%{name}-mail
554 %attr(754,root,root) /etc/rc.d/init.d/%{name}-mail
555 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-mail.conf
556 %endif
557
558 %if %{with light}
559 %files light
560 %defattr(644,root,root,755)
561 %attr(755,root,root) %{_sbindir}/%{name}-light
562 %attr(770,root,%{name}) /var/cache/%{name}-light
563 %attr(754,root,root) /etc/rc.d/init.d/%{name}-light
564 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-light.conf
565 %endif
566
567 %if %{with perl}
568 %files perl
569 %defattr(644,root,root,755)
570 %attr(755,root,root) %{_sbindir}/%{name}-perl
571 %attr(754,root,root) /etc/rc.d/init.d/%{name}-perl
572 %attr(770,root,%{name}) /var/cache/%{name}-perl
573 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}-perl.conf
574 %dir %{perl_vendorarch}/auto/%{name}
575 %attr(755,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.so
576 %attr(700,root,root) %{perl_vendorarch}/auto/%{name}/%{name}.bs
577 %attr(700,root,root) %{perl_vendorarch}/%{name}.pm
578 %endif
579
580 %files -n monit-rc-nginx
581 %defattr(644,root,root,755)
582 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-standard.monitrc
583 %if %{with perl}
584 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-perl.monitrc
585 %endif
586 %if %{with light}
587 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-light.monitrc
588 %endif
589 %if %{with mail}
590 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/monit/%{name}-mail.monitrc
591 %endif
This page took 0.108973 seconds and 4 git commands to generate.