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